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