WoW:Saving variables between game sessions (source)
Revision as of 17:58, 2 October 2010
, 2 October 2010Undo revision 2399176: avoid linking API pages in code blocks -- linking every function call would be annoying, and this one was of no particular importance to the block.
m (→HaveWeMet\HaveWeMet.lua: added a link to API CreateFrame) |
(Undo revision 2399176: avoid linking API pages in code blocks -- linking every function call would be annoying, and this one was of no particular importance to the block.) |
||
| Line 36: | Line 36: | ||
=== HaveWeMet\HaveWeMet.lua === | === HaveWeMet\HaveWeMet.lua === | ||
<code> | <code> | ||
local frame = | local frame = CreateFrame("FRAME"); -- Need a frame to respond to events | ||
frame:RegisterEvent("ADDON_LOADED"); -- Fired when saved variables are loaded | frame:RegisterEvent("ADDON_LOADED"); -- Fired when saved variables are loaded | ||
frame:RegisterEvent("PLAYER_LOGOUT"); -- Fired when about to log out | frame:RegisterEvent("PLAYER_LOGOUT"); -- Fired when about to log out | ||