mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- 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:
@ -9,6 +9,7 @@ IceClassPowerCounter.prototype.numRunes = 3
|
|||||||
IceClassPowerCounter.prototype.lastNumReady = 0
|
IceClassPowerCounter.prototype.lastNumReady = 0
|
||||||
IceClassPowerCounter.prototype.runeCoords = {}
|
IceClassPowerCounter.prototype.runeCoords = {}
|
||||||
IceClassPowerCounter.prototype.runeShineFadeSpeed = 0.4
|
IceClassPowerCounter.prototype.runeShineFadeSpeed = 0.4
|
||||||
|
IceClassPowerCounter.prototype.minLevel = 9
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function IceClassPowerCounter.prototype:init(name)
|
function IceClassPowerCounter.prototype:init(name)
|
||||||
@ -342,6 +343,26 @@ end
|
|||||||
function IceClassPowerCounter.prototype:Enable(core)
|
function IceClassPowerCounter.prototype:Enable(core)
|
||||||
IceClassPowerCounter.super.prototype.Enable(self, 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_POWER", "UpdateRunePower")
|
||||||
self:RegisterEvent("UNIT_DISPLAYPOWER", "UpdateRunePower")
|
self:RegisterEvent("UNIT_DISPLAYPOWER", "UpdateRunePower")
|
||||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateRunePower")
|
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateRunePower")
|
||||||
|
@ -15,6 +15,7 @@ function HolyPower.prototype:init()
|
|||||||
}
|
}
|
||||||
self.numericColor = "HolyPowerNumeric"
|
self.numericColor = "HolyPowerNumeric"
|
||||||
self.unitPower = SPELL_POWER_HOLY_POWER
|
self.unitPower = SPELL_POWER_HOLY_POWER
|
||||||
|
self.minLevel = PALADINPOWERBAR_SHOW_LEVEL
|
||||||
end
|
end
|
||||||
|
|
||||||
function HolyPower.prototype:GetOptions()
|
function HolyPower.prototype:GetOptions()
|
||||||
|
@ -15,6 +15,7 @@ function ShardCounter.prototype:init()
|
|||||||
}
|
}
|
||||||
self.numericColor = "ShardCounterNumeric"
|
self.numericColor = "ShardCounterNumeric"
|
||||||
self.unitPower = SPELL_POWER_SOUL_SHARDS
|
self.unitPower = SPELL_POWER_SOUL_SHARDS
|
||||||
|
self.minLevel = SHARDBAR_SHOW_LEVEL
|
||||||
self.runeHeight = 23
|
self.runeHeight = 23
|
||||||
self.runeWidth = 26
|
self.runeWidth = 26
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user