comparison Turok/Modules/Combat/Powerbar.lua @ 9:9400a0ff8540

Ugh Timer: - container update directionality - talent update iterates over a non-volatile table to carry out updates - index management steps organized - talentRow status implemented, returns the spell associated with the talent chosen from that row CombatLog: - sort out font controls and unbork arguments
author Nenue
date Sun, 21 Feb 2016 13:08:30 -0500
parents a9b8b0866ece
children
comparison
equal deleted inserted replaced
8:7790dff0fe13 9:9400a0ff8540
19 local print = function(...) 19 local print = function(...)
20 if _G.Devian and _G.DevianDB.workspace ~= 1 then 20 if _G.Devian and _G.DevianDB.workspace ~= 1 then
21 _G.print('PowerBar', ...) 21 _G.print('PowerBar', ...)
22 end 22 end
23 end 23 end
24 print('Peep!', ...) 24 local uprint = function(...)
25 if _G.Devian and _G.DevianDB.workspace ~= 1 then
26 _G.print('Update', ...)
27 end
28 end
25 local addon, tg = ... 29 local addon, tg = ...
26 tg.what = tostring(tg.what)..'more' 30 tg.what = tostring(tg.what)..'more'
27 print(tg.what) 31 print(tg.what)
28 --@end-debug@ 32 --@end-debug@
29 mod.OnInitialize = function(self) 33 mod.OnInitialize = function(self)
497 end 501 end
498 502
499 -- we only want to update at specific points 503 -- we only want to update at specific points
500 mod.Bar_Event = function(self, event, ...) 504 mod.Bar_Event = function(self, event, ...)
501 local unit, token = ... 505 local unit, token = ...
502 _G.print('Update', event, unit, token) 506 uprint( event, unit, token)
503 if token and unit == 'player' then 507 if token and unit == 'player' then
504 mod.Bar_Power(self, token) 508 mod.Bar_Power(self, token)
505 end 509 end
506 --print(unit, token, ...) 510 --print(unit, token, ...)
507 mod.Bar_Aura(bar, event, unit, token, ...) 511 mod.Bar_Aura(bar, event, unit, token, ...)
508 end 512 end
509 513
510 mod.Bar_Aura = function (self, event, unit) 514 mod.Bar_Aura = function (self, event, unit)
511 _G.print('Update','bar updating function called', event, unit) 515 uprint('bar updating function called', event, unit)
512 516
513 517
514 if event == 'UNIT_AURA' or event == nil then 518 if event == 'UNIT_AURA' or event == nil then
515 for token, info in pairs(self.secondary) do 519 for token, info in pairs(self.secondary) do
516 local row = self.resources[info.order] 520 local row = self.resources[info.order]
535 539
536 local p = self.primary[token] 540 local p = self.primary[token]
537 -- 1=cur, 2=max, 3=type, 4=token 541 -- 1=cur, 2=max, 3=type, 4=token
538 p[1] = UnitPower('player', p[3]) 542 p[1] = UnitPower('player', p[3])
539 p[2] = UnitPowerMax('player', p[3]) 543 p[2] = UnitPowerMax('player', p[3])
540 _G.print('Update',' ', table.concat(self.primary[token],', ')) 544 uprint(' ', table.concat(self.primary[token],', '))
541 545
542 if p[4] == 1 then 546 if p[4] == 1 then
543 _G.print('Update', 'progress:', p[1]/p[2]) 547 uprint( 'progress:', p[1]/p[2])
544 --print(unpack(p)) 548 --print(unpack(p))
545 self.powerText:SetText(p[1]) 549 self.powerText:SetText(p[1])
546 self:SetProgress(p[1]/p[2]) 550 self:SetProgress(p[1]/p[2])
547 elseif p[4] == 2 then 551 elseif p[4] == 2 then
548 --print('update on', token, 'c:', p[1], 'm:', p[2]) 552 --print('update on', token, 'c:', p[1], 'm:', p[2])