View Single Post
05/26/14, 02:36 PM   #11
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by stjobe View Post
http://www.luafaq.org/gotchas.html#T3.2

Edit: In Lua, you can't call a function before it's declared.
I know. But why is he writing:
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)
isntead of:
Code:
local function OnTrackStateChanged(questTracker, tracked, trackType, arg1, arg2)
end

CALLBACK_MANAGER:RegisterCallback("QuestTrackerTrackingStateChanged", OnTrackStateChanged)
  Reply With Quote