Skip to content

Commit

Permalink
tick window only for energy
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Sep 10, 2019
1 parent f107d89 commit aacb1f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NugEnergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,12 @@ function NugEnergy.Initialize(self)
self.initialized = true
end

twEnabled = false

if class == "ROGUE" and NugEnergyDB.energy then
PowerFilter = "ENERGY"
PowerTypeIndex = Enum.PowerType.Energy
twEnabled = NugEnergyDB.twEnabled
shouldBeFull = true
self:RegisterEvent("UPDATE_STEALTH")
self:SetScript("OnUpdate",self.UpdateEnergy)
Expand Down Expand Up @@ -327,12 +329,14 @@ function NugEnergy.Initialize(self)
self.UNIT_DISPLAYPOWER = function(self)
local newPowerType = select(2,UnitPowerType("player"))
shouldBeFull = false
twEnabled = false

-- restore to original MAXPOWER in case it was switched for classic energy
NugEnergy.UNIT_MAXPOWER = NugEnergy.NORMAL_UNIT_MAXPOWER
if newPowerType == "ENERGY" and NugEnergyDB.energy then
PowerFilter = "ENERGY"
PowerTypeIndex = Enum.PowerType.Energy
twEnabled = NugEnergyDB.twEnabled
shouldBeFull = true
self:RegisterEvent("UNIT_POWER_UPDATE")
self:RegisterEvent("UNIT_MAXPOWER")
Expand Down

0 comments on commit aacb1f1

Please sign in to comment.