annotate modules/ReAction_State/ReAction_State.lua @ 58:20003239af0b

changed "layout editor" to "bar editor"
author Flick <flickerstreak@gmail.com>
date Mon, 28 Apr 2008 21:08:35 +0000
parents 21bcaf8215ff
children f9cdb920470a
rev   line source
flickerstreak@25 1 --[[
flickerstreak@25 2 ReAction bar state machine
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 local InCombatLockdown = InCombatLockdown
flickerstreak@25 11
flickerstreak@25 12 -- module declaration
flickerstreak@25 13 local moduleID = "State"
flickerstreak@25 14 local module = ReAction:NewModule( moduleID )
flickerstreak@25 15
flickerstreak@25 16 -- module methods
flickerstreak@25 17 function module:OnInitialize()
flickerstreak@28 18 self.db = ReAction:RegisterNamespace( moduleID,
flickerstreak@25 19 {
flickerstreak@28 20 profile = { }
flickerstreak@25 21 }
flickerstreak@25 22 )
flickerstreak@25 23 end
flickerstreak@25 24
flickerstreak@25 25 function module:OnEnable()
flickerstreak@25 26
flickerstreak@25 27 end
flickerstreak@25 28
flickerstreak@25 29 function module:OnDisable()
flickerstreak@25 30
flickerstreak@25 31 end
flickerstreak@25 32
flickerstreak@27 33 --function module:GetGlobalOptions( configModule )
flickerstreak@27 34 -- return {}
flickerstreak@27 35 --end
flickerstreak@25 36
flickerstreak@27 37 --function module:GetGlobalBarOptions( configModule )
flickerstreak@27 38 --
flickerstreak@27 39 --end
flickerstreak@25 40
flickerstreak@27 41 --function module:GetModuleOptions( configModule )
flickerstreak@27 42 --
flickerstreak@27 43 --end
flickerstreak@25 44
flickerstreak@25 45 function module:GetBarConfigOptions( bar, configModule )
flickerstreak@25 46 if not bar.modConfigOpts[moduleID] then
flickerstreak@25 47 local IsEnabled = function()
flickerstreak@25 48 return false
flickerstreak@25 49 end
flickerstreak@25 50
flickerstreak@25 51 bar.modConfigOpts[moduleID] = {
flickerstreak@25 52 state = {
flickerstreak@25 53 type = "group",
flickerstreak@25 54 name = L["Dynamic Behavior"],
flickerstreak@25 55 desc = L["Dynamic Behavior"],
flickerstreak@25 56 args = {
flickerstreak@25 57 enable = {
flickerstreak@25 58 type = "toggle",
flickerstreak@25 59 name = L["Enable dynamic behavior"],
flickerstreak@25 60 desc = L["Toggles dynamic behavior for this bar"],
flickerstreak@25 61 get = function() return false end,
flickerstreak@25 62 set = function(x) end,
flickerstreak@25 63 disabled = InCombatLockdown,
flickerstreak@25 64 order = 1
flickerstreak@25 65 },
flickerstreak@25 66
flickerstreak@25 67 default = {
flickerstreak@25 68 type = "text",
flickerstreak@25 69 name = L["Default State"],
flickerstreak@25 70 desc = L["State when no conditions apply"],
flickerstreak@25 71 get = function() return false end,
flickerstreak@25 72 set = function(x) end,
flickerstreak@25 73 disabled = IsEnabled,
flickerstreak@25 74 order = 2
flickerstreak@25 75 },
flickerstreak@25 76
flickerstreak@25 77 stealth = {
flickerstreak@25 78 type = "text",
flickerstreak@25 79 name = L["Behavior when Stealthed"],
flickerstreak@25 80 desc = L["Change bar state when stealthed"],
flickerstreak@25 81 get = function() return false end,
flickerstreak@25 82 set = function(x) end,
flickerstreak@25 83 disabled = IsEnabled,
flickerstreak@25 84 validate = { },
flickerstreak@25 85 },
flickerstreak@25 86
flickerstreak@25 87 }
flickerstreak@25 88 }
flickerstreak@25 89 }
flickerstreak@25 90 end
flickerstreak@25 91 return bar.modConfigOpts[moduleID]
flickerstreak@25 92 end
flickerstreak@25 93
flickerstreak@25 94 function module:GetBarMenuOptions( bar, configModule )
flickerstreak@25 95
flickerstreak@25 96 end
flickerstreak@25 97