- Added support for ClassPowerCounters to only show up for specific talent specs.

- Added Priest Shadow Orbs module.
This commit is contained in:
Parnic
2012-08-25 20:07:32 +00:00
parent 66103c0a2b
commit 3e32e4a481
3 changed files with 103 additions and 1 deletions

View File

@ -81,6 +81,7 @@ modules\Vengeance.lua
modules\PlayerAlternatePower.lua
modules\HarmonyPower.lua
modules\MonkManaBar.lua
modules\ShadowOrbs.lua
#@do-not-package@
IceHUD_Options\Options.lua

View File

@ -14,6 +14,7 @@ IceClassPowerCounter.prototype.minLevel = 9
IceClassPowerCounter.prototype.DesiredAnimDuration = 0.6
IceClassPowerCounter.prototype.DesiredScaleMod = .4
IceClassPowerCounter.prototype.DesiredAnimPause = 0.5
IceClassPowerCounter.prototype.requiredSpec = nil
-- Constructor --
function IceClassPowerCounter.prototype:init(name)
@ -371,15 +372,36 @@ end
function IceClassPowerCounter.prototype:CheckValidLevel(event, level)
if not level then
return
if event == "PLAYER_TALENT_UPDATE" then
level = UnitLevel("player")
else
return
end
end
if level < self.minLevel then
self:RegisterEvent("PLAYER_LEVEL_UP", "CheckValidLevel")
self:Show(false)
else
self:CheckValidSpec()
end
end
function IceClassPowerCounter.prototype:CheckValidSpec()
if self.requiredSpec == nil then
self:DisplayCounter()
self:Show(true)
return
end
self:RegisterEvent("PLAYER_TALENT_UPDATE", "CheckValidLevel")
local spec = GetSpecialization()
if spec == self.requiredSpec then
self:DisplayCounter()
self:Show(true)
else
self:Show(false)
end
end

79
modules/ShadowOrbs.lua Normal file
View File

@ -0,0 +1,79 @@
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
local ShadowOrbs = IceCore_CreateClass(IceClassPowerCounter)
function ShadowOrbs.prototype:init()
ShadowOrbs.super.prototype.init(self, "ShadowOrbs")
self:SetDefaultColor("ShadowOrbsNumeric", 218, 231, 31)
-- pulled from PriestBar.xml in Blizzard's UI source
self.runeCoords =
{
{0.45703125, 0.60546875, 0.44531250, 0.73437500},
{0.45703125, 0.60546875, 0.44531250, 0.73437500},
{0.45703125, 0.60546875, 0.44531250, 0.73437500},
}
self.numericColor = "ShadowOrbsNumeric"
self.unitPower = SPELL_POWER_SHADOW_ORBS
self.minLevel = SHADOW_ORBS_SHOW_LEVEL
self.bTreatEmptyAsFull = true
self.unit = "player"
self.numConsideredFull = PRIEST_BAR_NUM_ORBS
self.runeHeight = 36
self.runeWidth = 36
self.requiredSpec = SPEC_PRIEST_SHADOW
end
function ShadowOrbs.prototype:GetOptions()
local opts = ShadowOrbs.super.prototype.GetOptions(self)
opts.hideBlizz.desc = L["Hides Blizzard Shadow Orb frame and disables all events related to it.\n\nNOTE: Blizzard attaches the shadow orb UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."]
return opts
end
function ShadowOrbs.prototype:GetRuneTexture(rune)
if not rune or rune ~= tonumber(rune) then
return
end
return "Interface\\PlayerFrame\\Priest-ShadowUI"
end
function ShadowOrbs.prototype:ShowBlizz()
PriestBarFrame:Show()
PriestBarFrame:GetScript("OnLoad")(PriestBarFrame)
end
function ShadowOrbs.prototype:HideBlizz()
PriestBarFrame:Hide()
PriestBarFrame:UnregisterAllEvents()
end
function ShadowOrbs.prototype:UpdateRunePower()
local numRunes = UnitPowerMax(self.unit, self.unitPower)
if self.fakeNumRunes ~= nil and self.fakeNumRunes > 0 then
numRunes = self.fakeNumRunes
end
if numRunes ~= self.numRunes then
if numRunes < self.numRunes and #self.frame.graphical >= numRunes then
for i=numRunes + 1, #self.frame.graphical do
self.frame.graphical[i]:Hide()
end
end
self.numRunes = numRunes
self:CreateRuneFrame()
end
ShadowOrbs.super.prototype.UpdateRunePower(self)
end
-- Load us up
local _, unitClass = UnitClass("player")
if (unitClass == "PRIEST" and IceHUD.WowVer >= 50000) then
IceHUD.ShadowOrbs = ShadowOrbs:new()
end