diff --git a/modules/skin.lua b/modules/skin.lua index d9e2a99c..c651fbcc 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -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 diff --git a/pfUI.lua b/pfUI.lua index ad08eecf..3580f732 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -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