34 lines
1.8 KiB
Lua
34 lines
1.8 KiB
Lua
ShaguDPS={config={backdrop=1}}
|
|
dofile('skin.lua')
|
|
local function region()
|
|
return {SetGradientAlpha=function(self,axis,r,g,b) self.r,self.g,self.b=r,g,b end,
|
|
SetTexture=function(self,path) self.path=path end,SetTexCoord=function() end,
|
|
SetAllPoints=function(self,target) self.anchor=target end,
|
|
SetVertexColor=function(self,r,g,b,a) self.r,self.g,self.b,self.a=r,g,b,a end,
|
|
Show=function(self) self.shown=true end,Hide=function(self) self.shown=false end}
|
|
end
|
|
local allocations=0
|
|
local frame={title={},titleRule={left=region(),right=region()},CreateTexture=function()
|
|
allocations=allocations+1;return region()
|
|
end}
|
|
local apply=ShaguDPS.skin.MeterPalette
|
|
apply(frame)
|
|
local stone=frame.titleStone
|
|
assert(frame.titleRule.left.r==.8 and stone.shown and stone.anchor==frame.title)
|
|
assert(stone.r==1 and stone.g==1 and stone.b==1,'native stone colors without tweaks')
|
|
ShaguTweaks={}
|
|
apply(frame)
|
|
assert(stone.shown and stone.r==1,'native stone with the default tweaks palette')
|
|
ShaguTweaks={GoldMode=true,UITint={r=1,g=.78,b=.4},UIBorder={r=.8,g=.62,b=.32},
|
|
T={['Golden UI']='Golden'},mods={Golden={config={['goldmode.bar']={r=.7,g=.5,b=.3}}}}}
|
|
apply(frame)
|
|
assert(frame.titleRule.left.g==.62 and frame.titleRule.right.b==.32,'underline uses border palette')
|
|
assert(stone.shown and stone.a==1,'gold uses opaque stone')
|
|
assert(stone.r==.7 and math.abs(stone.g-.39)<.00001,'custom title palette respected')
|
|
apply(frame);assert(allocations==1,'reuse header texture')
|
|
ShaguDPS.config.backdrop=0;apply(frame);assert(not stone.shown,'backdrop toggle hides header')
|
|
ShaguDPS.config.backdrop=1;ShaguTweaks.DarkMode=true;apply(frame)
|
|
assert(not stone.shown and frame.titleRule.left.r==.8,'dark mode wins')
|
|
ShaguTweaks=nil;apply(frame);assert(stone.shown and stone.r==1 and stone.g==1 and stone.b==1,'default palette restored')
|
|
print('Silver and golden meter header palettes passed (Lua 5.0)')
|