Quantcast

Raise events in OvaleAura when auras are added, refreshed or deleted.

Johnny C. Lam [07-19-13 - 05:33]
Raise events in OvaleAura when auras are added, refreshed or deleted.

The events are:

    Ovale_AuraAdded
    Ovale_AuraRefreshed
    Ovale_AuraDeleted

and the arguments for these events are:

    unit GUID, aura spell ID, caster GUID

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@979 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleAura.lua
diff --git a/OvaleAura.lua b/OvaleAura.lua
index cd63543..61f0471 100644
--- a/OvaleAura.lua
+++ b/OvaleAura.lua
@@ -176,6 +176,11 @@ local function UnitGainedAura(event, guid, spellId, filter, casterGUID, icon, co
 			end
 		end
 	end
+	if not existingAura then
+		self:SendMessage("Ovale_AuraAdded", guid, spellId, casterGUID)
+	elseif not auraIsUnchanged then
+		self:SendMessage("Ovale_AuraRefreshed", guid, spellId, casterGUID)
+	end
 	return addAura
 end

@@ -183,6 +188,7 @@ local function RemoveAuraIfExpired(guid, spellId, filter, aura, serial)
 	if aura and serial and aura.serial ~= serial then
 		Ovale:DebugPrintf(OVALE_AURA_DEBUG, "Removing expired %s %s (%s) from %s, serial=%d aura.serial=%d",
 			filter, aura.name, spellId, guid, serial, aura.serial)
+		self:SendMessage("Ovale_AuraRemoved", guid, spellId, aura.source)
 		self_pool:Release(aura)
 		return true
 	end