From d6506e79c2e3ae8bfcd06cf86177c09cc351e6b7 Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 9 Jul 2012 04:35:47 +0000 Subject: [PATCH] - Expanded holy power to account for the now-5 rune maximum. Not sure what I'm going to do about this layout just yet. The default frame has two below the primary 3, but my class power base class doesn't have support for this type of layout. Will see what the users say. - Fixed the old 3 runes to have appropriate texture coordinates. --- modules/ClassPowerCounter.lua | 5 +++-- modules/HolyPower.lua | 30 +++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/modules/ClassPowerCounter.lua b/modules/ClassPowerCounter.lua index eaff3e7..f06235e 100644 --- a/modules/ClassPowerCounter.lua +++ b/modules/ClassPowerCounter.lua @@ -6,6 +6,7 @@ local IceHUD = _G.IceHUD IceClassPowerCounter.prototype.runeHeight = 22 IceClassPowerCounter.prototype.runeWidth = 36 IceClassPowerCounter.prototype.numRunes = 3 +IceClassPowerCounter.prototype.numConsideredFull = 99 IceClassPowerCounter.prototype.lastNumReady = 0 IceClassPowerCounter.prototype.runeCoords = {} IceClassPowerCounter.prototype.runeShineFadeSpeed = 0.4 @@ -443,9 +444,9 @@ function IceClassPowerCounter.prototype:UpdateRunePower() end if self.moduleSettings.pulseWhenFull then - if numReady > self.lastNumReady and numReady == self.numRunes then + if numReady > self.lastNumReady and (numReady == self.numRunes or numReady >= self.numConsideredFull) then self:StartRunesFullAnimation() - elseif numReady < self.numRunes then + elseif numReady < self.numRunes and numReady < self.numConsideredFull then self:StopRunesFullAnimation() end end diff --git a/modules/HolyPower.lua b/modules/HolyPower.lua index 0e7e821..0231e46 100644 --- a/modules/HolyPower.lua +++ b/modules/HolyPower.lua @@ -9,14 +9,18 @@ function HolyPower.prototype:init() -- pulled from PaladinPowerBar.xml in Blizzard's UI source self.runeCoords = { - {0.00390625, 0.14453125, 0.64843750, 0.82031250}, - {0.00390625, 0.12500000, 0.83593750, 0.96875000}, - {0.15234375, 0.25781250, 0.64843750, 0.81250000}, + {0.00390625, 0.14453125, 0.78906250, 0.96093750}, + {0.15234375, 0.27343750, 0.78906250, 0.92187500}, + {0.28125000, 0.38671875, 0.64843750, 0.81250000}, + {0.28125000, 0.38671875, 0.82812500, 0.92187500}, + {0.39453125, 0.49609375, 0.64843750, 0.74218750}, } self.numericColor = "HolyPowerNumeric" self.unitPower = SPELL_POWER_HOLY_POWER self.minLevel = PALADINPOWERBAR_SHOW_LEVEL self.bTreatEmptyAsFull = true + self.unit = "player" + self.numConsideredFull = HOLY_POWER_FULL end function HolyPower.prototype:GetOptions() @@ -47,6 +51,26 @@ function HolyPower.prototype:HideBlizz() PaladinPowerBar:UnregisterAllEvents() end +function HolyPower.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 + HolyPower.super.prototype.UpdateRunePower(self) +end + -- Load us up local _, unitClass = UnitClass("player") if (unitClass == "PALADIN" and IceHUD.WowVer >= 40000) then