mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 05:20:49 +00:00
ui-widgets: hook old function for button highlight
This commit is contained in:
+4
-9
@@ -568,15 +568,12 @@ function pfUI.api.EnableClickRotate(frame)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function SetHighlightEnter()
|
||||||
local SetHighlightEnter = function()
|
|
||||||
if this.funce then this:funce() end
|
|
||||||
if this.locked then return end
|
if this.locked then return end
|
||||||
(this.backdrop or this):SetBackdropBorderColor(this.cr,this.cg,this.cb,1)
|
(this.backdrop or this):SetBackdropBorderColor(this.cr,this.cg,this.cb,1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local SetHighlightLeave = function()
|
local function SetHighlightLeave()
|
||||||
if this.funcl then this:funcl() end
|
|
||||||
if this.locked then return end
|
if this.locked then return end
|
||||||
(this.backdrop or this):SetBackdropBorderColor(this.rr,this.rg,this.rb,1)
|
(this.backdrop or this):SetBackdropBorderColor(this.rr,this.rg,this.rb,1)
|
||||||
end
|
end
|
||||||
@@ -593,10 +590,8 @@ function pfUI.api.SetHighlight(frame, cr, cg, cb)
|
|||||||
frame.rr, frame.rg, frame.rb = GetStringColor(pfUI_config.appearance.border.color)
|
frame.rr, frame.rg, frame.rb = GetStringColor(pfUI_config.appearance.border.color)
|
||||||
|
|
||||||
if not frame.pfEnterLeave then
|
if not frame.pfEnterLeave then
|
||||||
frame.funce = frame:GetScript("OnEnter")
|
HookScript(frame, "OnEnter", SetHighlightEnter)
|
||||||
frame.funcl = frame:GetScript("OnLeave")
|
HookScript(frame, "OnLeave", SetHighlightLeave)
|
||||||
frame:SetScript("OnEnter", SetHighlightEnter)
|
|
||||||
frame:SetScript("OnLeave", SetHighlightLeave)
|
|
||||||
frame.pfEnterLeave = true
|
frame.pfEnterLeave = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user