# HG changeset patch # User Nenue # Date 1450192222 18000 # Node ID 8a9a6637f082072ed720509197ca99b2ca988013 # Parent 8ace773d6bfc150e25df5ffaff64005b4e95bf24 focusbar data collection tracking db info declarations to main chunk diff -r 8ace773d6bfc -r 8a9a6637f082 Turok.lua --- a/Turok.lua Tue Dec 15 10:09:20 2015 -0500 +++ b/Turok.lua Tue Dec 15 10:10:22 2015 -0500 @@ -138,7 +138,9 @@ print('I... am Turok') - self.stats = {} + self.stats = { + maxpower = UnitPowerMax('player') + } T.focusbar = T:CreateBar('TkFocusBar', db.focusbar) @@ -146,6 +148,12 @@ T:AddLabel(fb, db.focusbar) fb:Update(UnitPower("player"), 0, UnitPowerMax("player")) T:Bar_SetUpdateHandler(fb, function(self) - T.Bar_Update(fb, UnitPower("player")) + local pp = UnitPower("player") + if pp == T.stats.maxpower and not T.stats.capped then + T.stats.capped = true + elseif T.stats.capped then + T.stats.capped = false + end + T.Bar_Update(fb, pp) end) end