mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-01 08:26:57 +00:00
Hook OnClick/OnEnter/OnLeave instead of wrapping saved handlers; drop dead TBC bank-slot OnUpdate
This commit is contained in:
+1
-3
@@ -592,9 +592,7 @@ function pfUI.api.SkinDropDown(frame, cr, cg, cb, useSmall)
|
||||
CloseDropDownMenus()
|
||||
end
|
||||
|
||||
local funcc = button:GetScript("OnClick")
|
||||
button:SetScript("OnClick", function()
|
||||
if funcc then funcc() end
|
||||
button:HookScript("OnClick", function()
|
||||
local DropDownListWidth = DropDownList1:GetWidth()
|
||||
local DropDownFrameWidth = frame.backdrop:GetWidth()
|
||||
if DropDownListWidth < DropDownFrameWidth then
|
||||
|
||||
+2
-17
@@ -585,31 +585,16 @@ pfUI:RegisterModule("bags", function ()
|
||||
frame.bagslots.slots[slot].slot = slot
|
||||
end
|
||||
|
||||
local SlotEnter = frame.bagslots.slots[slot].frame:GetScript("OnEnter")
|
||||
frame.bagslots.slots[slot].frame:SetScript("OnEnter", function()
|
||||
frame.bagslots.slots[slot].frame:HookScript("OnEnter", function()
|
||||
for slot, f in ipairs(pfUI.bags[this.slot + 1].slots) do
|
||||
CreateBackdrop(f.frame, default_border)
|
||||
f.frame.backdrop:SetBackdropBorderColor(.2,1,.8,1)
|
||||
end
|
||||
SlotEnter(this)
|
||||
end)
|
||||
|
||||
local SlotLeave = frame.bagslots.slots[slot].frame:GetScript("OnLeave")
|
||||
frame.bagslots.slots[slot].frame:SetScript("OnLeave", function()
|
||||
frame.bagslots.slots[slot].frame:HookScript("OnLeave", function()
|
||||
pfUI.bag:UpdateBag(this.slot + 1)
|
||||
SlotLeave()
|
||||
end)
|
||||
|
||||
-- On TBC, the OnEvent function of the template scans for framenames,
|
||||
-- and obviously doesn't know the pf-Names. Therefore, triggering
|
||||
-- the update function on each frame manually
|
||||
if frame == pfUI.bag.left and BankFrameItemButton_Update then
|
||||
local SlotUpdate = frame.bagslots.slots[slot].frame:GetScript("OnUpdate")
|
||||
frame.bagslots.slots[slot].frame:SetScript("OnUpdate", function()
|
||||
if SlotUpdate then SlotUpdate(this) end
|
||||
BankFrameItemButton_Update(this)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local left = (slot-min)*(frame.button_size/5*4+default_border*2) + default_border
|
||||
|
||||
Reference in New Issue
Block a user