Quantcast

Forgot they changed everything to UNIT_POWER instead of UNIT_MANA... lol

Xruptor [07-30-16 - 14:59]
Forgot they changed everything to UNIT_POWER instead of UNIT_MANA... lol
Filename
xanSoundAlerts.lua
diff --git a/xanSoundAlerts.lua b/xanSoundAlerts.lua
index 742edd8..49e78d6 100644
--- a/xanSoundAlerts.lua
+++ b/xanSoundAlerts.lua
@@ -26,10 +26,11 @@ function f:PLAYER_LOGIN()
 	f.PLAYER_LOGIN = nil

 	f:RegisterEvent("UNIT_HEALTH")
-	f:RegisterEvent("UNIT_MANA")
-
+	f:RegisterEvent("UNIT_POWER")
+
 	local ver = tonumber(GetAddOnMetadata("xanSoundAlerts","Version")) or 'Unknown'
-	DEFAULT_CHAT_FRAME:AddMessage("|xanSoundAlerts|r [v|cFFDF2B2B"..ver.."|r] loaded.")
+	DEFAULT_CHAT_FRAME:AddMessage("|cFF99CC33xanSoundAlerts|r [v|cFFDF2B2B"..ver.."|r] loaded.")
+
 end

 function f:UNIT_HEALTH()
@@ -43,7 +44,7 @@ function f:UNIT_HEALTH()
 	end
 end

-function f:UNIT_MANA()
+function f:UNIT_POWER()
 	if ((UnitPower("player") / UnitPowerMax("player")) <= lowManaThreshold) then
 		if (not lowMana) then
 			PlaySoundFile("Interface\\AddOns\\xanSoundAlerts\\sounds\\LowMana.ogg", "Master")