- added level restrictions to shard and holy power class counters since players under 9/10 (different per bar, using constants provided by Blizzard) don't have those resources available yet

This commit is contained in:
Parnic
2010-10-24 03:19:58 +00:00
parent 34549b5971
commit 08d6c6ead4
3 changed files with 23 additions and 0 deletions

View File

@ -9,6 +9,7 @@ IceClassPowerCounter.prototype.numRunes = 3
IceClassPowerCounter.prototype.lastNumReady = 0
IceClassPowerCounter.prototype.runeCoords = {}
IceClassPowerCounter.prototype.runeShineFadeSpeed = 0.4
IceClassPowerCounter.prototype.minLevel = 9
-- Constructor --
function IceClassPowerCounter.prototype:init(name)
@ -342,6 +343,26 @@ end
function IceClassPowerCounter.prototype:Enable(core)
IceClassPowerCounter.super.prototype.Enable(self, core)
self:CheckValidLevel(nil, UnitLevel("player"))
end
function IceClassPowerCounter.prototype:CheckValidLevel(event, level)
if not level then
return
end
if level < self.minLevel then
self:RegisterEvent("PLAYER_LEVEL_UP", "CheckValidLevel")
self:Show(false)
else
self:DisplayCounter()
self:Show(true)
end
end
function IceClassPowerCounter.prototype:DisplayCounter()
self:UnregisterEvent("PLAYER_LEVEL_UP")
self:RegisterEvent("UNIT_POWER", "UpdateRunePower")
self:RegisterEvent("UNIT_DISPLAYPOWER", "UpdateRunePower")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateRunePower")