DISCLAIMER! (In big red text!)
I'm really really really bored! So I attempted to make a good post for Phanx's sake
Anyways:
I feel like my buttons are screwed up somewhere >.> or I missed another stupid thing. Or I really did forget how to do stuff lua or rather in general.
Phanx (or someone else
) please point out the error in my ways! all my buttons are the same texture even though they should be diffeent colors!
code (because I'm a good OP like that!)
Lua Code:
local use_Minimap = false --disabling this forces Click Menu to make a button
local button_location = { "CENTER", UIParent, "CENTER", 0, 0 }
local blizzard_theme = false
local color_normal = { 1, 1, 1, 0.5 }
local color_hover = { 1, 0, 1, 0.5 }
local color_pushed = { 1, 1, 0, 0.5 }
local button = CreateFrame("Button", nil, mainframe)
button:SetPoint(unpack(button_location))
button:SetWidth(50)
button:SetHeight(25)
button:SetText("Menu")
button:SetNormalFontObject("GameFontNormal")
local ntex = button:CreateTexture()
if blizzard_theme then
ntex:SetTexture("Interface/Buttons/UI-Panel-Button-Up")
else
ntex:SetTexture("Interface\\Buttons\\WHITE8x8")
ntex:SetVertexColor("color_normal")
end
ntex:SetTexCoord(0, 0.625, 0, 0.6875)
ntex:SetAllPoints()
button:SetNormalTexture(ntex)
local htex = button:CreateTexture()
if blizzard_theme then
htex:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
else
htex:SetTexture("Interface\\Buttons\\WHITE8x8")
htex:SetVertexColor("color_hover")
end
htex:SetTexCoord(0, 0.625, 0, 0.6875)
htex:SetAllPoints()
button:SetHighlightTexture(htex)
local ptex = button:CreateTexture()
if blizzard_theme then
ptex:SetTexture("Interface/Buttons/UI-Panel-Button-Down")
else
ptex:SetTexture("Interface\\Buttons\\WHITE8x8")
ptex:SetVertexColor("color_pushed")
end
ptex:SetTexCoord(0, 0.625, 0, 0.6875)
ptex:SetAllPoints()
button:SetPushedTexture(ptex)
button:SetScript('OnMouseUp', function(self, button)
if button == "LeftButton" or button == "RightButton" then
securecall(EasyMenu, menuList, menuFrame, self, 27, 190, 'MENU', 8)
end
end)
end
TL;DR
I need to go to bed and get some sleep been up for well over 48 hours at this point.....