mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-05 21:20:00 +00:00
ui-widgets: only write enter/leave once per button
This commit is contained in:
+17
-12
@@ -307,17 +307,22 @@ function pfUI.api.SkinButton(button, cr, cg, cb)
|
||||
b:SetHighlightTexture(nil)
|
||||
b:SetPushedTexture(nil)
|
||||
b:SetDisabledTexture(nil)
|
||||
local funce = b:GetScript("OnEnter")
|
||||
local funcl = b:GetScript("OnLeave")
|
||||
b:SetScript("OnEnter", function()
|
||||
if funce then funce() end
|
||||
pfUI.api.CreateBackdrop(b, nil, true)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
if funcl then funcl() end
|
||||
pfUI.api.CreateBackdrop(b, nil, true)
|
||||
end)
|
||||
|
||||
if not b.pfEnterLeave then
|
||||
local funce = b:GetScript("OnEnter")
|
||||
local funcl = b:GetScript("OnLeave")
|
||||
b:SetScript("OnEnter", function()
|
||||
if funce then funce() end
|
||||
pfUI.api.CreateBackdrop(b, nil, true)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
if funcl then funcl() end
|
||||
pfUI.api.CreateBackdrop(b, nil, true)
|
||||
end)
|
||||
|
||||
b.pfEnterLeave = true
|
||||
end
|
||||
b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
|
||||
end
|
||||
|
||||
@@ -783,4 +788,4 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
|
||||
|
||||
infobox:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||
infobox:Show()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user