From 76f4e1b020717d872f931e1ab7f5e94654221d4e Mon Sep 17 00:00:00 2001 From: Parnic Date: Sat, 26 Jul 2008 19:14:47 +0000 Subject: [PATCH] - added rune stuff for DK's in wotlk - fixed args returned from UnitBuff in wotlk - added default DK spell for gcd module --- IceHUD.lua | 2 ++ modules/GlobalCoolDown.lua | 42 ++++++++++++++++++++++++++++---------- modules/PlayerMana.lua | 9 +++++++- modules/TargetInfo.lua | 10 +++++++-- modules/TargetMana.lua | 7 +++++++ 5 files changed, 56 insertions(+), 14 deletions(-) diff --git a/IceHUD.lua b/IceHUD.lua index 2e74093..a8458b5 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -5,6 +5,8 @@ local SML = AceLibrary("LibSharedMedia-3.0") IceHUD.CurrTagVersion = 3 +IceHUD.WowVer = select(4, GetBuildInfo()) + IceHUD.Location = "Interface\\AddOns\\IceHUD" IceHUD.options = { diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index b01aa7c..e41951d 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -39,17 +39,33 @@ function GlobalCoolDown.prototype:Disable(core) end function GlobalCoolDown.prototype:GetSpellName() - local defaultSpells = { - ROGUE=GetSpellInfo(1833), -- cheap shot - PRIEST=GetSpellInfo(139), -- renew - DRUID=GetSpellInfo(774), -- rejuvenation - WARRIOR=GetSpellInfo(6673), -- battle shout - MAGE=GetSpellInfo(168), -- frost armor - WARLOCK=GetSpellInfo(1454), -- life tap - PALADIN=GetSpellInfo(1152), -- purify - SHAMAN=GetSpellInfo(324), -- lightning shield - HUNTER=GetSpellInfo(1978) -- serpent sting - } + local defaultSpells; + if (IceHUD.WowVer >= 30000) + defaultSpells = { + ROGUE=GetSpellInfo(1833), -- cheap shot + PRIEST=GetSpellInfo(139), -- renew + DRUID=GetSpellInfo(774), -- rejuvenation + WARRIOR=GetSpellInfo(6673), -- battle shout + MAGE=GetSpellInfo(168), -- frost armor + WARLOCK=GetSpellInfo(1454), -- life tap + PALADIN=GetSpellInfo(1152), -- purify + SHAMAN=GetSpellInfo(324), -- lightning shield + HUNTER=GetSpellInfo(1978), -- serpent sting + DEATHKNIGHT=GetSpellInfo(45462) -- plague strike + } + else + defaultSpells = { + ROGUE=GetSpellInfo(1833), -- cheap shot + PRIEST=GetSpellInfo(139), -- renew + DRUID=GetSpellInfo(774), -- rejuvenation + WARRIOR=GetSpellInfo(6673), -- battle shout + MAGE=GetSpellInfo(168), -- frost armor + WARLOCK=GetSpellInfo(1454), -- life tap + PALADIN=GetSpellInfo(1152), -- purify + SHAMAN=GetSpellInfo(324), -- lightning shield + HUNTER=GetSpellInfo(1978) -- serpent sting + } + end local _, unitClass = UnitClass("player") return defaultSpells[unitClass] end @@ -85,6 +101,10 @@ end -- 'Protected' methods -------------------------------------------------------- function _FindSpellId(spellName) + if not spellName then + return nil + end + for tab = 1, 4 do local _, _, offset, numSpells = GetSpellTabInfo(tab) diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index 250da5a..d9b248b 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -105,6 +105,13 @@ function PlayerMana.prototype:Enable(core) self:RegisterEvent("UNIT_MAXRAGE", "Update") self:RegisterEvent("UNIT_ENERGY", "UpdateEnergy") self:RegisterEvent("UNIT_MAXENERGY", "Update") + -- DK rune stuff + if IceHUD.WowVer >= 30000 then + self:RegisterEvent("UNIT_RUNIC_POWER", "Update") + self:RegisterEvent("RUNE_TYPE_UPDATE", "Update") + self:RegisterEvent("RUNE_POWER_UPDATE", "Update") + self:RegisterEvent("RUNE_REGEN_UPDATE", "Update") + end self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType") @@ -209,7 +216,7 @@ end -- OVERRIDE function PlayerMana.prototype:UpdateBar(scale, color, alpha) - self.noFlash = (self.manaType ~= 0) + self.noFlash = (self.manaType ~= 0 and self.manaType ~= 6) PlayerMana.super.prototype.UpdateBar(self, scale, color, alpha) end diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua index 2319655..e19429a 100644 --- a/modules/TargetInfo.lua +++ b/modules/TargetInfo.lua @@ -739,8 +739,14 @@ function TargetInfo.prototype:UpdateBuffs() for i = 1, IceCore.BuffLimit do - local buffName, buffRank, buffTexture, buffApplications, - buffDuration, buffTimeLeft = UnitBuff("target", i, filter and not hostile) + local buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft; + if IceHUD.WowVer >= 30000 then + buffName, buffRank, buffTexture, buffApplications, buffType, buffDuration, buffTimeLeft + = UnitBuff("target", i, filter and not hostile) + else + buffName, buffRank, buffTexture, buffApplications, buffDuration, buffTimeLeft + = UnitBuff("target", i, filter and not hostile) + end if (buffTexture) then self.frame.buffFrame.buffs[i].icon.texture:SetTexture(buffTexture) diff --git a/modules/TargetMana.lua b/modules/TargetMana.lua index 94221b2..52fe9b4 100644 --- a/modules/TargetMana.lua +++ b/modules/TargetMana.lua @@ -39,6 +39,13 @@ function TargetMana.prototype:Enable(core) self:RegisterEvent("UNIT_MAXFOCUS", "Update") self:RegisterEvent("UNIT_AURA", "Update") self:RegisterEvent("UNIT_FLAGS", "Update") + -- DK rune stuff + if IceHUD.WowVer >= 30000 then + self:RegisterEvent("UNIT_RUNIC_POWER", "Update") + self:RegisterEvent("RUNE_TYPE_UPDATE", "Update") + self:RegisterEvent("RUNE_POWER_UPDATE", "Update") + self:RegisterEvent("RUNE_REGEN_UPDATE", "Update") + end self:Update("target") end