- Removed level restriction on harmony power since apparently that's not a thing any more.

- Fixed the fifth chi not always drawing immediately when changing specs to one that grants an additional chi.
- Registered harmony power for the UNIT_POWER_FREQUENT event since that's what Blizzard's version does.
This commit is contained in:
Parnic
2012-09-02 04:29:41 +00:00
parent 08de61d849
commit a4390cf0cd
2 changed files with 20 additions and 3 deletions

View File

@ -430,7 +430,7 @@ function IceClassPowerCounter.prototype:CheckValidLevel(event, level)
end
end
if level < self.minLevel then
if self.minLevel and level < self.minLevel then
self:RegisterEvent("PLAYER_LEVEL_UP", "CheckValidLevel")
self:Show(false)
else

View File

@ -18,13 +18,23 @@ function HarmonyPower.prototype:init()
self.numRunes = 4
self.numericColor = "HarmonyPowerNumeric"
self.unitPower = SPELL_POWER_LIGHT_FORCE
self.minLevel = MONKHARMONYBAR_SHOW_LEVEL
self.minLevel = 0
self.bTreatEmptyAsFull = true
self.unit = "player"
self.runeWidth = self.runeHeight
end
function HarmonyPower.prototype:UpdateRunePower()
function HarmonyPower.prototype:Enable(core)
HarmonyPower.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_POWER_FREQUENT", "UpdateRunePower")
end
function HarmonyPower.prototype:UpdateRunePower(event, arg1, arg2)
if event == "UNIT_POWER_FREQUENT" and (arg1 ~= self.unit or (arg2 ~= "LIGHT_FORCE" and arg2 ~= "DARK_FORCE")) then
return
end
local numRunes = UnitPowerMax(self.unit, self.unitPower)
if self.fakeNumRunes ~= nil and self.fakeNumRunes > 0 then
@ -37,10 +47,17 @@ function HarmonyPower.prototype:UpdateRunePower()
self.frame.graphical[i]:Hide()
end
end
local oldNumRunes = self.numRunes
self.numRunes = numRunes
self:CreateRuneFrame()
if oldNumRunes < self.numRunes and #self.frame.graphical >= self.numRunes then
for i=oldNumRunes, self.numRunes do
self.frame.graphical[i]:Show()
end
end
local width = self.runeHeight
if self.moduleSettings.runeMode == "Graphical" then
width = self.runeWidth