Mercurial > wow > reaction
annotate modules/ModuleTemplate.lua @ 165:5257073138e8
Updates for WoW 3.3
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Sat, 12 Dec 2009 21:56:32 +0000 |
parents | 901c91dc1bf2 |
children | df68b5a40490 |
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 end |
flickerstreak@109 | 34 |
flickerstreak@109 | 35 function module:OnEnable() |
flickerstreak@109 | 36 |
flickerstreak@109 | 37 end |
flickerstreak@109 | 38 |
flickerstreak@109 | 39 function module:OnDisable() |
flickerstreak@109 | 40 |
flickerstreak@109 | 41 end |
flickerstreak@109 | 42 |
flickerstreak@109 | 43 -- apply module features and settings to a bar object (see Bar.lua for Bar API) |
flickerstreak@109 | 44 function module:OnCreateBar(event, bar, name) |
flickerstreak@109 | 45 |
flickerstreak@109 | 46 end |
flickerstreak@109 | 47 |
flickerstreak@109 | 48 -- remove module features and settings from a bar object |
flickerstreak@109 | 49 function module:OnDestroyBar(event, bar, name) |
flickerstreak@109 | 50 |
flickerstreak@109 | 51 end |
flickerstreak@109 | 52 |
flickerstreak@109 | 53 -- refresh module features and settings on a bar object |
flickerstreak@109 | 54 function module:OnRefreshBar(event, bar, name) |
flickerstreak@109 | 55 |
flickerstreak@109 | 56 end |
flickerstreak@109 | 57 |
flickerstreak@109 | 58 -- erase any local configuration entries for the supplied bar name |
flickerstreak@109 | 59 function module:OnEraseBar(event, bar, name) |
flickerstreak@109 | 60 |
flickerstreak@109 | 61 end |
flickerstreak@109 | 62 |
flickerstreak@109 | 63 -- update any local configuration/option entries with the new bar name index |
flickerstreak@109 | 64 function module:OnRenameBar(event, bar, oldName, newName) |
flickerstreak@109 | 65 |
flickerstreak@109 | 66 end |
flickerstreak@109 | 67 |
flickerstreak@109 | 68 |