Mercurial > wow > reaction
view modules/ReAction_ModuleTemplate/ReAction_ModuleName.lua @ 77:da8ba8783924
- added revision updater to each code file
- Changed button/bar class mechanic to metatable-based
- Changed buttons to live within a sub-frame, to play nicely between show-empty-buttons and hidestates
- bar frame is now available only via accessor
- Changed some semantics with AddButton/PlaceButton
- Cleaned up action buttons options, fixed hide-when-empty option
- moved show-action-ID-label as a button method
- converted drag overlay from nested-frame to :Raise()
- fixed ReAction:SetConfigMode() to not call event when mode doesn't change
- Fixed ordering for dynamic state tab (always last)
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Mon, 23 Jun 2008 22:27:50 +0000 |
parents | 768be7eb22a0 |
children | 42ec2938d65a |
line wrap: on
line source
--[[ ReAction module template --]] -- local imports local ReAction = ReAction local L = ReAction.L local _G = _G ReAction:UpdateRevision("$Revision: 103 $") -- module declaration local moduleID = "MyModuleName" local module = ReAction:NewModule( moduleID, -- mixins go here ) -- handlers function module:OnInitialize() self.db = ReAction.db:RegisterNamespace( moduleID { profile = { -- default profile goes here } } ) -- register some common events ReAction.RegisterCallback(self, "OnCreateBar") ReAction.RegisterCallback(self, "OnDestroyBar") ReAction.RegisterCallback(self, "OnRefreshBar") ReAction.RegisterCallback(self, "OnEraseBar") ReAction.RegisterCallback(self, "OnRenameBar") ReAction.RegisterCallback(self, "OnConfigModeChanged") end function module:OnEnable() end function module:OnDisable() end -- apply module features and settings to a bar object (see Bar.lua for Bar API) function module:OnCreateBar(event, bar, name) end -- remove module features and settings from a bar object function module:OnDestroyBar(event, bar, name) end -- refresh module features and settings on a bar object function module:OnRefreshBar(event, bar, name) end -- erase any local configuration entries for the supplied bar name function module:OnEraseBar(event, bar, name) end -- update any local configuration/option entries with the new bar name index function module:OnRenameBar(event, bar, oldName, newName) end -- update any local display/options based on config mode (true/false) function module:OnConfigModeChanged(event, mode) end