mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Added checks for rune count changing mid-session
Right now most ClassPowerCounter child classes are doing this work themselves, but they don't need to be. Some cleanup could be done there if anyone ever felt like doing it. (I did a tiny bit with Shards and Chi, but there's more to be done)
This commit is contained in:
@ -17,6 +17,7 @@ IceClassPowerCounter.prototype.DesiredAnimPause = 0.5
|
||||
IceClassPowerCounter.prototype.requiredSpec = nil
|
||||
IceClassPowerCounter.prototype.shouldShowUnmodified = false
|
||||
IceClassPowerCounter.prototype.unmodifiedMaxPerRune = 10
|
||||
IceClassPowerCounter.prototype.unit = "player"
|
||||
|
||||
IceClassPowerCounter.prototype.growModes = { width = 1, height = 2 }
|
||||
IceClassPowerCounter.prototype.currentGrowMode = nil
|
||||
@ -418,6 +419,9 @@ end
|
||||
function IceClassPowerCounter.prototype:Enable(core)
|
||||
IceClassPowerCounter.super.prototype.Enable(self, core)
|
||||
|
||||
self.numRunes = UnitPowerMax(self.unit, self.unitPower)
|
||||
self:CreateFrame()
|
||||
|
||||
self:CheckValidLevel(nil, UnitLevel("player"))
|
||||
end
|
||||
|
||||
@ -483,6 +487,12 @@ function IceClassPowerCounter.prototype:UpdateRunePower(event, arg1, arg2)
|
||||
return
|
||||
end
|
||||
|
||||
local numMax = UnitPowerMax(self.unit, self.unitPower)
|
||||
if numMax ~= self.numRunes then
|
||||
self.numRunes = numMax
|
||||
CreateFrame()
|
||||
end
|
||||
|
||||
local numReady = UnitPower("player", self.unitPower)
|
||||
local percentReady = self.shouldShowUnmodified and (UnitPower("player", self.unitPower, true) / self.unmodifiedMaxPerRune) or numReady
|
||||
|
||||
|
Reference in New Issue
Block a user