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) assert(frame.titleRule.left.r==.8 and not frame.goldenTitle,'stock appearance without tweaks') 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(frame.goldenTitle.shown and frame.goldenTitle.anchor==frame.title and frame.goldenTitle.a==1) assert(frame.goldenTitle.r==.7 and math.abs(frame.goldenTitle.g-.39)<.00001,'custom title palette respected') apply(frame);assert(allocations==1,'reuse header texture') ShaguDPS.config.backdrop=0;apply(frame);assert(not frame.goldenTitle.shown,'backdrop toggle hides header') ShaguDPS.config.backdrop=1;ShaguTweaks.DarkMode=true;apply(frame) assert(not frame.goldenTitle.shown and frame.titleRule.left.r==.8,'dark mode wins') ShaguTweaks=nil;apply(frame);assert(not frame.goldenTitle.shown,'optional dependency fallback') print('Golden meter header palette, precedence, reuse and backdrop checks passed (Lua 5.0)')