annotate modules/ModuleTemplate.lua @ 133:729e284b2576

fixed template typo
author Flick <flickerstreak@gmail.com>
date Tue, 17 Mar 2009 21:55:15 +0000
parents 410d036c43b2
children 901c91dc1bf2
rev   line source
flickerstreak@109 1 --[[
flickerstreak@109 2 ReAction module template
flickerstreak@109 3
flickerstreak@109 4 --]]
flickerstreak@109 5
flickerstreak@109 6 -- local imports
flickerstreak@109 7 local ReAction = ReAction
flickerstreak@109 8 local L = ReAction.L
flickerstreak@109 9 local _G = _G
flickerstreak@109 10
flickerstreak@109 11 -- module declaration
flickerstreak@109 12 local moduleID = "MyModuleName"
flickerstreak@133 13 local module = ReAction:NewModule( moduleID
flickerstreak@109 14 -- mixins go here
flickerstreak@109 15 )
flickerstreak@109 16
flickerstreak@109 17 -- handlers
flickerstreak@109 18 function module:OnInitialize()
flickerstreak@133 19 self.db = ReAction.db:RegisterNamespace( moduleID,
flickerstreak@109 20 {
flickerstreak@109 21 profile = {
flickerstreak@109 22 -- default profile goes here
flickerstreak@109 23 }
flickerstreak@109 24 }
flickerstreak@109 25 )
flickerstreak@109 26
flickerstreak@109 27 -- register some common events
flickerstreak@109 28 ReAction.RegisterCallback(self, "OnCreateBar")
flickerstreak@109 29 ReAction.RegisterCallback(self, "OnDestroyBar")
flickerstreak@109 30 ReAction.RegisterCallback(self, "OnRefreshBar")
flickerstreak@109 31 ReAction.RegisterCallback(self, "OnEraseBar")
flickerstreak@109 32 ReAction.RegisterCallback(self, "OnRenameBar")
flickerstreak@109 33 ReAction.RegisterCallback(self, "OnConfigModeChanged")
flickerstreak@109 34 end
flickerstreak@109 35
flickerstreak@109 36 function module:OnEnable()
flickerstreak@109 37
flickerstreak@109 38 end
flickerstreak@109 39
flickerstreak@109 40 function module:OnDisable()
flickerstreak@109 41
flickerstreak@109 42 end
flickerstreak@109 43
flickerstreak@109 44 -- apply module features and settings to a bar object (see Bar.lua for Bar API)
flickerstreak@109 45 function module:OnCreateBar(event, bar, name)
flickerstreak@109 46
flickerstreak@109 47 end
flickerstreak@109 48
flickerstreak@109 49 -- remove module features and settings from a bar object
flickerstreak@109 50 function module:OnDestroyBar(event, bar, name)
flickerstreak@109 51
flickerstreak@109 52 end
flickerstreak@109 53
flickerstreak@109 54 -- refresh module features and settings on a bar object
flickerstreak@109 55 function module:OnRefreshBar(event, bar, name)
flickerstreak@109 56
flickerstreak@109 57 end
flickerstreak@109 58
flickerstreak@109 59 -- erase any local configuration entries for the supplied bar name
flickerstreak@109 60 function module:OnEraseBar(event, bar, name)
flickerstreak@109 61
flickerstreak@109 62 end
flickerstreak@109 63
flickerstreak@109 64 -- update any local configuration/option entries with the new bar name index
flickerstreak@109 65 function module:OnRenameBar(event, bar, oldName, newName)
flickerstreak@109 66
flickerstreak@109 67 end
flickerstreak@109 68
flickerstreak@109 69 -- update any local display/options based on config mode (true/false)
flickerstreak@109 70 function module:OnConfigModeChanged(event, mode)
flickerstreak@109 71
flickerstreak@109 72 end
flickerstreak@109 73