View Single Post
05/26/14, 01:46 PM   #9
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by Garkin View Post
I have some questions about that section actually. It seems counter intuitive:
Code:
local function OnTrackStateChanged(questTracker, tracked, trackType, arg1, arg2)
    if tracked then
        d("A quest was tracked")
    else
        d("A quest was untracked")
    end
end
 
CALLBACK_MANAGER:RegisterCallback("QuestTrackerTrackingStateChanged", OnTrackStateChanged)
Why do I write 'OnTrackStateChanged' before regsitering the Callback? Is it's parameter list supposed to be the "siganture" of the Event?
If it is only the protoype for the Events Signature, why does it also contain code? Was somebody just lazy and wanted to use the same function as Prototype for Registering the Event and as the Callback that is later registerd to the event?
  Reply With Quote