mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- added shard bar inheriting from ClassPowerCounter. same basic functionality as the holy power module: graphical mode that shows the default shards and numeric mode that just displays a count of active shards
57 lines
1.6 KiB
Lua
57 lines
1.6 KiB
Lua
local AceOO = AceLibrary("AceOO-2.0")
|
|
|
|
local HolyPower = AceOO.Class(IceClassPowerCounter)
|
|
|
|
function HolyPower.prototype:init()
|
|
HolyPower.super.prototype.init(self, "HolyPower")
|
|
|
|
self:SetDefaultColor("HolyPowerNumeric", 218, 231, 31)
|
|
|
|
-- 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},
|
|
}
|
|
self.numericColor = "HolyPowerNumeric"
|
|
self.unitPower = SPELL_POWER_HOLY_POWER
|
|
end
|
|
|
|
function HolyPower.prototype:GetOptions()
|
|
local opts = HolyPower.super.prototype.GetOptions(self)
|
|
|
|
opts.hideBlizz.desc = "Hides Blizzard Holy Power frame and disables all events related to it.\n\nNOTE: Blizzard attaches the holy power UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."
|
|
|
|
return opts
|
|
end
|
|
|
|
function HolyPower.prototype:GetRuneTexture(rune)
|
|
if not rune or rune ~= tonumber(rune) then
|
|
return
|
|
end
|
|
--return "Paladin-Rune0"..rune..".png"
|
|
return "Interface\\PlayerFrame\\PaladinPowerTextures"
|
|
end
|
|
|
|
function HolyPower.prototype:ShowBlizz()
|
|
PaladinPowerBar:Show()
|
|
|
|
PaladinPowerBar:RegisterEvent("UNIT_POWER");
|
|
PaladinPowerBar:RegisterEvent("PLAYER_ENTERING_WORLD");
|
|
PaladinPowerBar:RegisterEvent("UNIT_DISPLAYPOWER");
|
|
PaladinPowerBar:RegisterEvent("UNIT_AURA");
|
|
end
|
|
|
|
function HolyPower.prototype:HideBlizz()
|
|
PaladinPowerBar:Hide()
|
|
|
|
PaladinPowerBar:UnregisterAllEvents()
|
|
end
|
|
|
|
-- Load us up
|
|
local _, unitClass = UnitClass("player")
|
|
if (unitClass == "PALADIN" and IceHUD.WowVer >= 40000) then
|
|
IceHUD.HolyPower = HolyPower:new()
|
|
end
|