From 2b47404bda83fa428819758d08c2bf4d1ee5aabb Mon Sep 17 00:00:00 2001 From: d87 Date: Thu, 19 Nov 2020 12:39:48 +0700 Subject: [PATCH] Added Arcane Mage's mana (#8) --- NugEnergy.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/NugEnergy.lua b/NugEnergy.lua index 5f4f7b3..482ecd5 100644 --- a/NugEnergy.lua +++ b/NugEnergy.lua @@ -336,6 +336,23 @@ function NugEnergy.Initialize(self) end self:UNIT_MAXPOWER() + elseif class == "MAGE" and NugEnergyDB.mana then + self:RegisterEvent("SPELLS_CHANGED") + self.SPELLS_CHANGED = function(self) + if GetSpecialization() == 1 and NugEnergyDB.mana then + PowerFilter = "MANA" + PowerTypeIndex = Enum.PowerType.Mana + GetPower = ManaBarGetPower() + self:SetNormalColor() + self:RegisterUnitEvent("UNIT_MAXPOWER", "player") + self:RegisterUnitEvent("UNIT_POWER_FREQUENT", "player") + else + self:Disable() + end + self:UPDATE_STEALTH() + end + self:SPELLS_CHANGED() + elseif class == "PALADIN" and NugEnergyDB.mana then self:RegisterEvent("SPELLS_CHANGED") self.SPELLS_CHANGED = function(self) @@ -349,6 +366,7 @@ function NugEnergy.Initialize(self) else self:Disable() end + self:UPDATE_STEALTH() end self:SPELLS_CHANGED() @@ -381,6 +399,7 @@ function NugEnergy.Initialize(self) else self:Disable() end + self:UPDATE_STEALTH() end self:SPELLS_CHANGED() elseif class == "DRUID" then @@ -640,8 +659,8 @@ function NugEnergy.Initialize(self) self:RegisterEvent("PLAYER_REGEN_DISABLED") else self:Disable() - self:UPDATE_STEALTH() end + self:UPDATE_STEALTH() end self:SPELLS_CHANGED() else