- added a workaround for DK runic power (and probably all power types) not updating after the new "predicted power" stuff that was added in the beta. specifically, UNIT_RUNIC_POWER doesn't fire any more with the predicted power system since it's supposed to build up slowly. this caused the runic power bar to never get updated as it degenerated. copied the "working" version from blizzard's UnitFrame.lua code (see UnitFrameManaBar_Initialize)

- fixed a lua error that was popping up every time the player mounted as a DK (why the crap do rune events fire for the non-existent rune 7 and 8 when you mount?!)
This commit is contained in:
Parnic
2008-08-03 05:30:32 +00:00
parent d1c1d7d7e5
commit 0b25b48304
3 changed files with 22 additions and 8 deletions

View File

@ -96,7 +96,7 @@ end
function PlayerMana.prototype:Enable(core)
PlayerMana.super.prototype.Enable(self, core)
self:CreateTickerFrame()
self:RegisterEvent("UNIT_MANA", "Update")
@ -107,9 +107,14 @@ function PlayerMana.prototype:Enable(core)
self:RegisterEvent("UNIT_MAXENERGY", "Update")
-- DK rune stuff
if IceHUD.WowVer >= 30000 then
self:RegisterEvent("UNIT_RUNIC_POWER", "Update")
if GetCVarBool("predictedPower") and self.frame then
self.frame:SetScript("OnUpdate", function() self:Update(self.unit) end)
else
self:RegisterEvent("UNIT_RUNIC_POWER", "Update")
end
self:RegisterEvent("UNIT_MAXRUNIC_POWER", "Update")
end
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
self:ManaType(self.unit)
@ -140,9 +145,9 @@ function PlayerMana.prototype:ManaType(unit)
if (unit ~= self.unit) then
return
end
self.manaType = UnitPowerType(self.unit)
-- register ticker for rogue energy
if (self.moduleSettings.tickerEnabled and (self.manaType == 3) and self.alive) then
self.tickerFrame:Show()