Add Profiles.lua file that supplies profile management functions and callbacks.
[Rifter.git] / Core.lua
blob2b769ef4fa909116928b46f9e8bc3ae7a3fd89be
1 CreateFrame("Frame", "Rifter");
3 -- Initialize CallbackHandler-1.0 and tell it to name the functions RegisterCallback, UnregisterCallback and UnregisterAllCallbacks
4 Rifter.events = LibStub("CallbackHandler-1.0"):New(Rifter, "RegisterCallback", "UnregisterCallback", "UnregisterAllCallbacks");
6 -- Register the PLAYER_LOGIN event and trigger and start our loading process there
7 Rifter:RegisterEvent("PLAYER_LOGIN");
9 -- Declare a basic script that gets triggered OnEvent (when any event is triggered), if the event is PLAYER_LOGIN we're going to start initializing
10 Rifter:SetScript("OnEvent", function(self, event)
11 if(event == "PLAYER_LOGIN") then
12 --Trigger the callback that tells the rest of the core to initialize
13 Rifter.events:Fire("InitializeCore");
14 -- Trigger the callback that tells our modules to initialize
15 Rifter.events:Fire("InitializeModules");
16 end
17 end);