diff --git a/modules/ClassPowerCounter.lua b/modules/ClassPowerCounter.lua index 99e404e..12f9b64 100644 --- a/modules/ClassPowerCounter.lua +++ b/modules/ClassPowerCounter.lua @@ -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") diff --git a/modules/HolyPower.lua b/modules/HolyPower.lua index 0a24cdc..6967661 100644 --- a/modules/HolyPower.lua +++ b/modules/HolyPower.lua @@ -15,6 +15,7 @@ function HolyPower.prototype:init() } self.numericColor = "HolyPowerNumeric" self.unitPower = SPELL_POWER_HOLY_POWER + self.minLevel = PALADINPOWERBAR_SHOW_LEVEL end function HolyPower.prototype:GetOptions() diff --git a/modules/Shards.lua b/modules/Shards.lua index dd21ef8..9719626 100644 --- a/modules/Shards.lua +++ b/modules/Shards.lua @@ -15,6 +15,7 @@ function ShardCounter.prototype:init() } self.numericColor = "ShardCounterNumeric" self.unitPower = SPELL_POWER_SOUL_SHARDS + self.minLevel = SHARDBAR_SHOW_LEVEL self.runeHeight = 23 self.runeWidth = 26 end