Mercurial > wow > turok
comparison Turok.lua @ 5:8a9a6637f082
focusbar data collection tracking
db info declarations to main chunk
| author | Nenue |
|---|---|
| date | Tue, 15 Dec 2015 10:10:22 -0500 |
| parents | 62f9b057c91b |
| children |
comparison
equal
deleted
inserted
replaced
| 4:8ace773d6bfc | 5:8a9a6637f082 |
|---|---|
| 136 function T:OnEnable() | 136 function T:OnEnable() |
| 137 local db = _G.TurokData | 137 local db = _G.TurokData |
| 138 | 138 |
| 139 print('I... am Turok') | 139 print('I... am Turok') |
| 140 | 140 |
| 141 self.stats = {} | 141 self.stats = { |
| 142 maxpower = UnitPowerMax('player') | |
| 143 } | |
| 142 | 144 |
| 143 | 145 |
| 144 T.focusbar = T:CreateBar('TkFocusBar', db.focusbar) | 146 T.focusbar = T:CreateBar('TkFocusBar', db.focusbar) |
| 145 local fb = T.focusbar | 147 local fb = T.focusbar |
| 146 T:AddLabel(fb, db.focusbar) | 148 T:AddLabel(fb, db.focusbar) |
| 147 fb:Update(UnitPower("player"), 0, UnitPowerMax("player")) | 149 fb:Update(UnitPower("player"), 0, UnitPowerMax("player")) |
| 148 T:Bar_SetUpdateHandler(fb, function(self) | 150 T:Bar_SetUpdateHandler(fb, function(self) |
| 149 T.Bar_Update(fb, UnitPower("player")) | 151 local pp = UnitPower("player") |
| 152 if pp == T.stats.maxpower and not T.stats.capped then | |
| 153 T.stats.capped = true | |
| 154 elseif T.stats.capped then | |
| 155 T.stats.capped = false | |
| 156 end | |
| 157 T.Bar_Update(fb, pp) | |
| 150 end) | 158 end) |
| 151 end | 159 end |
