View Single Post
05/26/14, 03:35 PM   #13
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by Xrystal View Post
As far as I know there is no prototyping requirement in lua. You simply set up the function you want to call or you call a function that already exists.
Now I get it. I thought we first had to "add" our custom event before others could register for it. But that was wrong.
Any handlers regsitered to the callback manager are raised by the call of:
Code:
CALLBACK_MANAGER:FireCallbacks("QuestTrackerTrackingStateChanged", self, true, TRACK_TYPE_QUEST, 0)
And this was registering one handler
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)
I think I am going to rework that FAQ part for better understandability, as I jsut rewrote the Saved Var part.
  Reply With Quote