flickerstreak@109: --[[ flickerstreak@109: ReAction module template flickerstreak@109: flickerstreak@109: --]] flickerstreak@109: flickerstreak@109: -- local imports flickerstreak@175: local addonName, addonTable = ... flickerstreak@175: local ReAction = addonTable.ReAction flickerstreak@109: local L = ReAction.L flickerstreak@109: local _G = _G flickerstreak@109: flickerstreak@109: -- module declaration flickerstreak@109: local moduleID = "MyModuleName" flickerstreak@133: local module = ReAction:NewModule( moduleID flickerstreak@109: -- mixins go here flickerstreak@109: ) flickerstreak@109: flickerstreak@109: -- handlers flickerstreak@109: function module:OnInitialize() flickerstreak@133: self.db = ReAction.db:RegisterNamespace( moduleID, flickerstreak@109: { flickerstreak@109: profile = { flickerstreak@109: -- default profile goes here flickerstreak@109: } flickerstreak@109: } flickerstreak@109: ) flickerstreak@109: flickerstreak@109: -- register some common events flickerstreak@109: ReAction.RegisterCallback(self, "OnCreateBar") flickerstreak@109: ReAction.RegisterCallback(self, "OnDestroyBar") flickerstreak@109: ReAction.RegisterCallback(self, "OnRefreshBar") flickerstreak@109: ReAction.RegisterCallback(self, "OnEraseBar") flickerstreak@109: ReAction.RegisterCallback(self, "OnRenameBar") flickerstreak@109: end flickerstreak@109: flickerstreak@109: function module:OnEnable() flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: function module:OnDisable() flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: -- apply module features and settings to a bar object (see Bar.lua for Bar API) flickerstreak@109: function module:OnCreateBar(event, bar, name) flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: -- remove module features and settings from a bar object flickerstreak@109: function module:OnDestroyBar(event, bar, name) flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: -- refresh module features and settings on a bar object flickerstreak@109: function module:OnRefreshBar(event, bar, name) flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: -- erase any local configuration entries for the supplied bar name flickerstreak@109: function module:OnEraseBar(event, bar, name) flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: -- update any local configuration/option entries with the new bar name index flickerstreak@109: function module:OnRenameBar(event, bar, oldName, newName) flickerstreak@109: flickerstreak@109: end flickerstreak@109: flickerstreak@109: