mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 14:10:01 +00:00
api: use separate button skin function
This commit is contained in:
+1
-14
@@ -46,20 +46,7 @@ pfUI:RegisterModule("skin", function ()
|
||||
GameMenuButtonContinue:SetPoint("BOTTOM", 0, 10)
|
||||
|
||||
for _, button in pairs(buttons) do
|
||||
local b = getglobal(button)
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
b:SetNormalTexture(nil)
|
||||
b:SetHighlightTexture(nil)
|
||||
b:SetPushedTexture(nil)
|
||||
b:SetDisabledTexture(nil)
|
||||
b:SetScript("OnEnter", function()
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
end)
|
||||
b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
|
||||
pfUI.utils:SkinButton(button, cr, cg, cb)
|
||||
end
|
||||
|
||||
for _, box in pairs(boxes) do
|
||||
|
||||
@@ -174,6 +174,29 @@ function pfUI.utils:CreateBackdrop(f, inset, legacy, transp)
|
||||
end
|
||||
|
||||
|
||||
function pfUI.utils:SkinButton(button, cr, cg, cb)
|
||||
local b = getglobal(button)
|
||||
if not b then b = button end
|
||||
if not cr or not cg or not cb then
|
||||
_, class = UnitClass("player")
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
cr, cg, cb = color.r , color.g, color.b
|
||||
end
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
b:SetNormalTexture(nil)
|
||||
b:SetHighlightTexture(nil)
|
||||
b:SetPushedTexture(nil)
|
||||
b:SetDisabledTexture(nil)
|
||||
b:SetScript("OnEnter", function()
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
pfUI.utils:CreateBackdrop(b, nil, true)
|
||||
end)
|
||||
b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
|
||||
end
|
||||
|
||||
message = function (msg)
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffcccc33INFO: |cffffff55"..msg)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user