Addon Info.
Optional Files (0)
Archived (4)
Comments (0)
  Category: Libraries
Addon Information
Download Latest Version.
To add favorites please register for a free account. If you already have one you need to login. How do I install this? (FAQ)
ganders's Portal Bug Reports Feature Requests
Author:
Version:
r59
Date:
05-08-2008 07:47 AM
Size:
2.23 Kb
Downloads:
261
Views:
1,440
Favorites:
2
MD5:
RCE
RCE
Using RCE

Introduction
RegisterCombatEvent

Details
The point of this library is to instead of having one large COMBAT_LOG_EVENT_UNFILTERED function with if-else checks for the event type, you can "register" the event types and set a function for each one.

Where as before you might have:

Code:
function CLEU(...)
    if arg2 == "SPELL_AURA_APPLIED" then
        do stuff
    elseif arg2 == "SPELL_AURA_REMOVED" then
        do other stuff
    end
end
Now you can do:

Code:
RCE:Embed(MyFrame)

function Applied(self, ...)
    do stuff
end

function Removed(self, ...)
    do other stuff
end

function Missed(self, ...)
    do some more stuff
end

MyFrame:RegisterCombatEvent("SPELL_AURA_APPLIED", Applied)
MyFrame:RegisterCombatEvent("SPELL_AURA_REMOVED", Removed)
MyFrame:RegisterCombatEvents("SPELL_MISSED", "SPELL_CAST_FAILED", Missed)
The self in the above functions will return as the frame registered with the combat event, in this case MyFrame.

There is also no need to register the event COMBAT_LOG_EVENT_UNFILTERED to your addon, as RegisterCombatEvent will do it for you.

It is important to note that the first 2 arguments normally returned by COMBAT_LOG_EVENT_UNFILTERED (timestamp and eventType) are NOT returned using RCE. In the above functions, ... will start at the 3rd argument (source name) and carry on from there.

API
RCE:Embed(frame)
- Hook RCE's functions into your frame

:RegisterCombatEvent("event", function)
- Where "event" is any event found on http://www.wowwiki.com/API_COMBAT_LOG_EVENT

:RegisterCombatEvents("event1", "event2", "event3", function)
- Where "event" is any event found on http://www.wowwiki.com/API_COMBAT_LOG_EVENT
- :RegisterCombatEvents() will take as many events as you'd like, but only one function.

:IsCombatEventRegistered("event")
- Returns true if "event" is registered to your frame, false otherwise
  Optional Files - RCE
Sorry, there are currently no optional files available.
  Archived Versions - RCE
File Name
Version
Size
Author
Date
 RCE
r54
2.18 Kb
ganders
05-07-2008 07:15 PM
 RCE
r50
2.16 Kb
ganders
05-07-2008 06:16 PM
 RCE
r44
1.88 Kb
ganders
05-06-2008 07:21 PM
 RCE
1.0
1.88 Kb
ganders
05-06-2008 07:04 PM
  Comments - RCE
There have been no comments posted to this file.
Be the first to add one.



Category Jump:



The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOInterface | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


MMOInterface.com Copyright ©2008
World of Warcraft is a registered Trademark of Blizzard Entertainment.
vBulletin - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.