45 lines
2.1 KiB
Lua
45 lines
2.1 KiB
Lua
ShaguDPS = { expansion=function() return 'vanilla' end, window={}, config={} }
|
|
local file=assert(io.open('window.lua'))
|
|
local source=file:read('*a');file:close()
|
|
local boundary=assert(string.find(source,'-- time used for',1,true))
|
|
assert(loadstring(string.sub(source,1,boundary-1)))()
|
|
local config=ShaguDPS.config
|
|
local function bar()
|
|
return {
|
|
SetMinMaxValues=function(self,min,max,mode) self.maximum,self.rangeMode=max,mode end,
|
|
SetValue=function(self,value,mode) self.value,self.mode=value,mode end,
|
|
GetInterpolatedValue=function() end,SetToTargetValue=function() end,
|
|
}
|
|
end
|
|
local row=bar();row.lowerBar=bar()
|
|
local segment={}
|
|
local function update(name,view,target,force)
|
|
ShaguDPS.window.SetBarValues(row,name or 'Warlock',segment,view or 1,target,1000,400,1000,600,force)
|
|
end
|
|
config.smooth_bars,config.smooth_threat=1,0
|
|
update()
|
|
assert(row.mode==nil,'plain client gets vanilla argument lists')
|
|
Enum={StatusBarInterpolation={ExponentialEaseOut=1}}
|
|
update()
|
|
assert(row.mode==0,'new row snaps')
|
|
row.wasShown=true
|
|
update()
|
|
assert(row.mode==1 and row.rangeMode==1 and row.lowerBar.mode==1,'both healing layers ease together')
|
|
update('Mage')
|
|
assert(row.mode==0,'reordered rows snap')
|
|
update('Mage');assert(row.mode==1)
|
|
segment={};update('Mage');assert(row.mode==0,'new segments snap')
|
|
update('Mage',3);assert(row.mode==0,'view changes snap')
|
|
update('Mage',3);assert(row.mode==1,'healing smoothing enabled')
|
|
update('Mage',5,'boss1');update('Mage',5,'boss1')
|
|
assert(row.mode==0,'threat defaults to immediate independently')
|
|
config.smooth_threat=1;config.smooth_bars=0
|
|
update('Mage',5,'boss1');assert(row.mode==1)
|
|
update('Mage',5,'boss2');assert(row.mode==0,'target switches snap')
|
|
update('Mage',5,'boss2',true);assert(row.mode==0,'forced refresh snaps')
|
|
update('Mage',1);update('Mage',1);assert(row.mode==0,'damage toggle independent')
|
|
update('Mage',6);update('Mage',6);assert(row.mode==0,'dispels remain immediate')
|
|
row.wasShown=false;update('Mage',5,'boss2');assert(row.mode==0,'hidden rows snap on reuse')
|
|
row.GetInterpolatedValue=nil;update();assert(row.mode==nil,'partial API falls back')
|
|
print('Native smoothing toggles, row reuse and fallback checks passed (Lua 5.0)')
|