annotate 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
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@77 11 ReAction:UpdateRevision("$Revision: 103 $")
flickerstreak@77 12
flickerstreak@25 13 -- module declaration
flickerstreak@25 14 local moduleID = "MyModuleName"
flickerstreak@25 15 local module = ReAction:NewModule( moduleID,
flickerstreak@25 16 -- mixins go here
flickerstreak@25 17 )
flickerstreak@25 18
flickerstreak@63 19 -- handlers
flickerstreak@25 20 function module:OnInitialize()
flickerstreak@28 21 self.db = ReAction.db:RegisterNamespace( moduleID
flickerstreak@25 22 {
flickerstreak@28 23 profile = {
flickerstreak@28 24 -- default profile goes here
flickerstreak@28 25 }
flickerstreak@25 26 }
flickerstreak@25 27 )
flickerstreak@28 28
flickerstreak@63 29 -- register some common events
flickerstreak@63 30 ReAction.RegisterCallback(self, "OnCreateBar")
flickerstreak@63 31 ReAction.RegisterCallback(self, "OnDestroyBar")
flickerstreak@63 32 ReAction.RegisterCallback(self, "OnRefreshBar")
flickerstreak@63 33 ReAction.RegisterCallback(self, "OnEraseBar")
flickerstreak@63 34 ReAction.RegisterCallback(self, "OnRenameBar")
flickerstreak@63 35 ReAction.RegisterCallback(self, "OnConfigModeChanged")
flickerstreak@25 36 end
flickerstreak@25 37
flickerstreak@25 38 function module:OnEnable()
flickerstreak@25 39
flickerstreak@25 40 end
flickerstreak@25 41
flickerstreak@25 42 function module:OnDisable()
flickerstreak@25 43
flickerstreak@25 44 end
flickerstreak@25 45
flickerstreak@28 46 -- apply module features and settings to a bar object (see Bar.lua for Bar API)
flickerstreak@63 47 function module:OnCreateBar(event, bar, name)
flickerstreak@25 48
flickerstreak@25 49 end
flickerstreak@25 50
flickerstreak@28 51 -- remove module features and settings from a bar object
flickerstreak@63 52 function module:OnDestroyBar(event, bar, name)
flickerstreak@25 53
flickerstreak@25 54 end
flickerstreak@25 55
flickerstreak@28 56 -- refresh module features and settings on a bar object
flickerstreak@63 57 function module:OnRefreshBar(event, bar, name)
flickerstreak@28 58
flickerstreak@28 59 end
flickerstreak@28 60
flickerstreak@63 61 -- erase any local configuration entries for the supplied bar name
flickerstreak@63 62 function module:OnEraseBar(event, bar, name)
flickerstreak@28 63
flickerstreak@28 64 end
flickerstreak@28 65
flickerstreak@63 66 -- update any local configuration/option entries with the new bar name index
flickerstreak@63 67 function module:OnRenameBar(event, bar, oldName, newName)
flickerstreak@28 68
flickerstreak@28 69 end
flickerstreak@28 70
flickerstreak@63 71 -- update any local display/options based on config mode (true/false)
flickerstreak@63 72 function module:OnConfigModeChanged(event, mode)
flickerstreak@28 73
flickerstreak@28 74 end
flickerstreak@63 75