api: use separate button skin function

This commit is contained in:
shagu
2016-12-23 19:35:21 +01:00
parent 063c196429
commit edd169eb78
2 changed files with 24 additions and 14 deletions
+1 -14
View File
@@ -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
+23
View File
@@ -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