Mercurial > wow > reaction
annotate modules/ModuleTemplate.lua @ 193:576c50e51fc5
LibShowGrid-1.0 external library --> LibShowActionGrid-1.0 internal library
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Mon, 15 Nov 2010 10:22:45 -0800 |
parents | df68b5a40490 |
children |
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@175 | 7 local addonName, addonTable = ... |
flickerstreak@175 | 8 local ReAction = addonTable.ReAction |
flickerstreak@109 | 9 local L = ReAction.L |
flickerstreak@109 | 10 local _G = _G |
flickerstreak@109 | 11 |
flickerstreak@109 | 12 -- module declaration |
flickerstreak@109 | 13 local moduleID = "MyModuleName" |
flickerstreak@133 | 14 local module = ReAction:NewModule( moduleID |
flickerstreak@109 | 15 -- mixins go here |
flickerstreak@109 | 16 ) |
flickerstreak@109 | 17 |
flickerstreak@109 | 18 -- handlers |
flickerstreak@109 | 19 function module:OnInitialize() |
flickerstreak@133 | 20 self.db = ReAction.db:RegisterNamespace( moduleID, |
flickerstreak@109 | 21 { |
flickerstreak@109 | 22 profile = { |
flickerstreak@109 | 23 -- default profile goes here |
flickerstreak@109 | 24 } |
flickerstreak@109 | 25 } |
flickerstreak@109 | 26 ) |
flickerstreak@109 | 27 |
flickerstreak@109 | 28 -- register some common events |
flickerstreak@109 | 29 ReAction.RegisterCallback(self, "OnCreateBar") |
flickerstreak@109 | 30 ReAction.RegisterCallback(self, "OnDestroyBar") |
flickerstreak@109 | 31 ReAction.RegisterCallback(self, "OnRefreshBar") |
flickerstreak@109 | 32 ReAction.RegisterCallback(self, "OnEraseBar") |
flickerstreak@109 | 33 ReAction.RegisterCallback(self, "OnRenameBar") |
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 |