mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-08 03:18:58 +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()
|
CloseDropDownMenus()
|
||||||
end
|
end
|
||||||
|
|
||||||
local funcc = button:GetScript("OnClick")
|
button:HookScript("OnClick", function()
|
||||||
button:SetScript("OnClick", function()
|
|
||||||
if funcc then funcc() end
|
|
||||||
local DropDownListWidth = DropDownList1:GetWidth()
|
local DropDownListWidth = DropDownList1:GetWidth()
|
||||||
local DropDownFrameWidth = frame.backdrop:GetWidth()
|
local DropDownFrameWidth = frame.backdrop:GetWidth()
|
||||||
if DropDownListWidth < DropDownFrameWidth then
|
if DropDownListWidth < DropDownFrameWidth then
|
||||||
|
|||||||
+2
-17
@@ -585,31 +585,16 @@ pfUI:RegisterModule("bags", function ()
|
|||||||
frame.bagslots.slots[slot].slot = slot
|
frame.bagslots.slots[slot].slot = slot
|
||||||
end
|
end
|
||||||
|
|
||||||
local SlotEnter = frame.bagslots.slots[slot].frame:GetScript("OnEnter")
|
frame.bagslots.slots[slot].frame:HookScript("OnEnter", function()
|
||||||
frame.bagslots.slots[slot].frame:SetScript("OnEnter", function()
|
|
||||||
for slot, f in ipairs(pfUI.bags[this.slot + 1].slots) do
|
for slot, f in ipairs(pfUI.bags[this.slot + 1].slots) do
|
||||||
CreateBackdrop(f.frame, default_border)
|
CreateBackdrop(f.frame, default_border)
|
||||||
f.frame.backdrop:SetBackdropBorderColor(.2,1,.8,1)
|
f.frame.backdrop:SetBackdropBorderColor(.2,1,.8,1)
|
||||||
end
|
end
|
||||||
SlotEnter(this)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local SlotLeave = frame.bagslots.slots[slot].frame:GetScript("OnLeave")
|
frame.bagslots.slots[slot].frame:HookScript("OnLeave", function()
|
||||||
frame.bagslots.slots[slot].frame:SetScript("OnLeave", function()
|
|
||||||
pfUI.bag:UpdateBag(this.slot + 1)
|
pfUI.bag:UpdateBag(this.slot + 1)
|
||||||
SlotLeave()
|
|
||||||
end)
|
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
|
end
|
||||||
|
|
||||||
local left = (slot-min)*(frame.button_size/5*4+default_border*2) + default_border
|
local left = (slot-min)*(frame.button_size/5*4+default_border*2) + default_border
|
||||||
|
|||||||
Reference in New Issue
Block a user