- 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()

View File

@ -154,8 +154,6 @@ function Runes.prototype:Enable(core)
self:RegisterEvent("RUNE_POWER_UPDATE", "UpdateRunePower");
self:RegisterEvent("RUNE_TYPE_UPDATE", "UpdateRuneType");
-- not sure what rune_regen_update is for just yet...UpdateRuneRegen doesn't exist as of yet
-- self:RegisterEvent("RUNE_REGEN_UPDATE", "UpdateRuneRegen");
if (self.moduleSettings.hideBlizz) then
self:HideBlizz()
@ -164,7 +162,13 @@ end
-- simply shows/hides the foreground rune when it becomes usable/unusable. this allows the background transparent rune to show only
function Runes.prototype:UpdateRunePower(rune, usable)
DEFAULT_CHAT_FRAME:AddMessage("Runes.prototype:UpdateRunePower: rune="..rune.." usable="..(usable and "yes" or "no"));
if not rune or not self.frame.graphical or #self.frame.graphical <= rune then
return
end
-- DEFAULT_CHAT_FRAME:AddMessage("Runes.prototype:UpdateRunePower: rune="..rune.." usable="..(usable and "yes" or "no").." GetRuneType(rune)="..GetRuneType(rune));
if usable then
self.frame.graphical[rune]:Show()
else

View File

@ -41,7 +41,12 @@ function TargetMana.prototype:Enable(core)
self:RegisterEvent("UNIT_FLAGS", "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:Update("target")