Epicgrim/EpicUI — Issue #23: Style functionality needed 
Author: Epicgrim
Created: 2012-01-22 22:26:29+00:00
State: open
Labels: customactionbar

-- styleButton function authors are Chiril & Karudon.
local function StyleButton(b, c)
local name = b:GetName()

local button = _G[name]
local icon = _G[name.."Icon"]
local count = _G[name.."Count"]
local border = _G[name.."Border"]
local hotkey = _G[name.."HotKey"]
local cooldown = _G[name.."Cooldown"]
local nametext = _G[name.."Name"]
local flash = _G[name.."Flash"]
local normaltexture = _G[name.."NormalTexture"]
local icontexture = _G[name.."IconTexture"]

local hover = b:CreateTexture("frame", nil, self) -- hover
hover:SetTexture(1,1,1,0.3)
hover:SetHeight(button:GetHeight())
hover:SetWidth(button:GetWidth())
hover:Point("TOPLEFT",button,2,-2)
hover:Point("BOTTOMRIGHT",button,-2,2)
button:SetHighlightTexture(hover)

local pushed = b:CreateTexture("frame", nil, self) -- pushed
pushed:SetTexture(0.9,0.8,0.1,0.3)
pushed:SetHeight(button:GetHeight())
pushed:SetWidth(button:GetWidth())
pushed:Point("TOPLEFT",button,2,-2)
pushed:Point("BOTTOMRIGHT",button,-2,2)
button:SetPushedTexture(pushed)

if c then
local checked = b:CreateTexture("frame", nil, self) -- checked
checked:SetTexture(0,1,0,0.3)
checked:SetHeight(button:GetHeight())
checked:SetWidth(button:GetWidth())
checked:Point("TOPLEFT",button,2,-2)
checked:Point("BOTTOMRIGHT",button,-2,2)
button:SetCheckedTexture(checked)
end
end