mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
This has been tested on Classic with a Rogue up to level 5 using various modules and casually checked against a few level 1 classes. I'm sure there's a lot more to do here. I also made sure to test on Live. Where possible I tried to check for API availability rather than specific client versions or program IDs. There are many cases where that's impractical, however, so version/program ID checks were used. This was tested with: * Ace3 @r1225 * AceGUI-3.0-SharedMediaWidgets @r61 * LibDBIcon-1.0 @v8.2.0 * LibDogTag-3.0 @v80200.1 * LibDogTag-Unit-3.0 @v80200.1-2-g93a898d-alpha * LibRangeCheck-2.0 @v4.2.3 (with a couple of local changes) * LibSharedMedia-3.0 @r113-alpha
67 lines
1.9 KiB
Lua
67 lines
1.9 KiB
Lua
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
|
local ArcaneCharges = IceCore_CreateClass(IceClassPowerCounter)
|
|
|
|
local SPELL_POWER_ARCANE_CHARGES = SPELL_POWER_ARCANE_CHARGES
|
|
if IceHUD.WowVer >= 80000 or IceHUD.WowClassic then
|
|
SPELL_POWER_ARCANE_CHARGES = Enum.PowerType.ArcaneCharges
|
|
end
|
|
|
|
function ArcaneCharges.prototype:init()
|
|
ArcaneCharges.super.prototype.init(self, "ArcaneCharges")
|
|
|
|
self:SetDefaultColor("ArcaneChargesNumeric", 150, 150, 255)
|
|
|
|
self.unit = "player"
|
|
self.numericColor = "ArcaneChargesNumeric"
|
|
self.unitPower = SPELL_POWER_ARCANE_CHARGES
|
|
self.minLevel = 0
|
|
self.bTreatEmptyAsFull = true
|
|
self.runeWidth = self.runeHeight
|
|
self.requiredSpec = SPEC_MAGE_ARCANE
|
|
end
|
|
|
|
function ArcaneCharges.prototype:Enable(core)
|
|
self.numRunes = UnitPowerMax(self.unit, SPELL_POWER_ARCANE_CHARGES)
|
|
self.runeCoords = { }
|
|
for i = 1, self.numRunes do
|
|
self.runeCoords[#self.runeCoords + 1] = {0, 1, 0, 1}
|
|
end
|
|
|
|
ArcaneCharges.super.prototype.Enable(self, core)
|
|
|
|
end
|
|
|
|
function ArcaneCharges.prototype:GetOptions()
|
|
local opts = ArcaneCharges.super.prototype.GetOptions(self)
|
|
|
|
opts.hideBlizz.desc = L["Hides Blizzard Arcane Charges frame and disables all events related to it.\n\nNOTE: Blizzard attaches the arcane charges UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."]
|
|
|
|
return opts
|
|
end
|
|
|
|
function ArcaneCharges.prototype:GetRuneAtlas(rune)
|
|
return "Mage-ArcaneCharge"
|
|
end
|
|
|
|
function ArcaneCharges.prototype:GetShineAtlas(rune)
|
|
return "Mage-ArcaneCharge-SmallSpark"
|
|
end
|
|
|
|
function ArcaneCharges.prototype:ShowBlizz()
|
|
MageArcaneChargesFrame:Show()
|
|
|
|
MageArcaneChargesFrame:GetScript("OnLoad")(MageArcaneChargesFrame)
|
|
end
|
|
|
|
function ArcaneCharges.prototype:HideBlizz()
|
|
MageArcaneChargesFrame:Hide()
|
|
|
|
MageArcaneChargesFrame:UnregisterAllEvents()
|
|
end
|
|
|
|
-- Load us up
|
|
local _, unitClass = UnitClass("player")
|
|
if (unitClass == "MAGE" and IceHUD.WowVer >= 70000) then
|
|
IceHUD.ArcaneCharges = ArcaneCharges:new()
|
|
end
|