WoWInterface SVN Broker_Equipment

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 25 to Rev 24
    Reverse comparison

Rev 25 → Rev 24

trunk/Broker_Equipment/Broker_Equipment.lua
81,20 → 81,20
 
local function handleClick(name, icon)
if(IsShiftKeyDown()) then
local dialog = StaticPopup_Show('CUSTOM_OVERWRITE_EQUIPMENT_SET', name) -- Custom popup to update the info
dialog.name = name
dialog.icon = icon
local dialog = StaticPopup_Show('CONFIRM_OVERWRITE_EQUIPMENT_SET', name)
dialog.selectedIcon = GetTextureIndex(icon) -- Blizzard sucks
dialog.data = name
return
elseif(IsControlKeyDown()) then
local dialog = StaticPopup_Show('CONFIRM_DELETE_EQUIPMENT_SET', name)
dialog.data = name
else
EquipmentManager_EquipSet(name)
 
if(InCombatLockdown()) then
pendingName = name
addon:RegisterEvent('PLAYER_REGEN_ENABLED')
end
return
elseif(InCombatLockdown()) then
pendingName = name
addon:RegisterEvent('PLAYER_REGEN_ENABLED')
end
 
EquipmentManager_EquipSet(name)
end
 
local function updateInfo(name, icon)
133,19 → 133,6
end
end
 
-- Fuck blizzard!
StaticPopupDialogs.CUSTOM_OVERWRITE_EQUIPMENT_SET = {
text = CONFIRM_OVERWRITE_EQUIPMENT_SET,
button1 = YES,
button2 = NO,
OnAccept = function(self) SaveEquipmentSet(self.name, GetTextureIndex(self.icon)); GearManagerDialogPopup:Hide() updateInfo(self.name, self.icon) end,
OnCancel = function() end,
OnHide = function(self) self.name, self.icon = nil, nil end,
hideOnEscape = 1,
timeout = 0,
exclusive = 1,
}
 
function broker:OnClick(button)
if(button == 'RightButton') then
if(GearManagerDialog:IsVisible()) then
159,7 → 146,7
end
GearManagerDialog:Show()
end
elseif(GetNumEquipmentSets() > 0) then
else
if(pendingUpdate) then updateMenu() end
EasyMenu(menu, addon, self, 0, 0, 'MENU')
 
186,7 → 173,8
broker.icon = Broker_EquipmentDB.icon
 
self:RegisterEvent('EQUIPMENT_SETS_CHANGED')
self:RegisterEvent('UNIT_INVENTORY_CHANGED')
-- self:RegisterEvent('EQUIPMENT_SWAP_FINISHED') -- 3.2
self:RegisterEvent('UNIT_INVENTORY_CHANGED') -- experimental
self:RegisterEvent('VARIABLES_LOADED')
self:UnregisterEvent(event)
end
194,7 → 182,20
function addon:EQUIPMENT_SETS_CHANGED()
pendingUpdate = true
end
 
--[[
-- new event in 3.2, needs more testing vs UIC
function addon:EQUIPMENT_SWAP_FINISHED(event, completed, setName)
if(completed) then
for index = 1, GetNumEquipmentSets() do
local name, icon = GetEquipmentSetInfo(index)
if(name == setName) then
updateInfo(name, icon)
break
end
end
end
end
--]]
function addon:UNIT_INVENTORY_CHANGED(event, unit)
if(unit ~= 'player') then return end
 
209,11 → 210,9
end
end
 
function addon:VARIABLES_LOADED(event)
function addon:VARIABLES_LOADED()
SetCVar('equipmentManager', 1)
GearManagerToggleButton:Show()
 
self:UnregisterEvent(event)
end
 
addon:RegisterEvent('ADDON_LOADED')