flickerstreak@25: --[[ flickerstreak@25: ReAction bar state machine flickerstreak@25: flickerstreak@25: --]] flickerstreak@25: flickerstreak@25: -- local imports flickerstreak@25: local ReAction = ReAction flickerstreak@25: local L = ReAction.L flickerstreak@25: local _G = _G flickerstreak@25: local InCombatLockdown = InCombatLockdown flickerstreak@25: flickerstreak@25: -- module declaration flickerstreak@25: local moduleID = "State" flickerstreak@25: local module = ReAction:NewModule( moduleID ) flickerstreak@25: flickerstreak@25: -- module methods flickerstreak@25: function module:OnInitialize() flickerstreak@25: self.db = ReAction:AcquireDBNamespace(moduleID) flickerstreak@25: ReAction:RegisterDefaults(moduleID,"profile", flickerstreak@25: { flickerstreak@25: flickerstreak@25: } flickerstreak@25: ) flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:OnEnable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:OnDisable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:OnProfileEnable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:OnProfileDisable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@27: --function module:GetGlobalOptions( configModule ) flickerstreak@27: -- return {} flickerstreak@27: --end flickerstreak@25: flickerstreak@27: --function module:GetGlobalBarOptions( configModule ) flickerstreak@27: -- flickerstreak@27: --end flickerstreak@25: flickerstreak@27: --function module:GetModuleOptions( configModule ) flickerstreak@27: -- flickerstreak@27: --end flickerstreak@25: flickerstreak@25: function module:GetBarConfigOptions( bar, configModule ) flickerstreak@25: if not bar.modConfigOpts[moduleID] then flickerstreak@25: local IsEnabled = function() flickerstreak@25: return false flickerstreak@25: end flickerstreak@25: flickerstreak@25: bar.modConfigOpts[moduleID] = { flickerstreak@25: state = { flickerstreak@25: type = "group", flickerstreak@25: name = L["Dynamic Behavior"], flickerstreak@25: desc = L["Dynamic Behavior"], flickerstreak@25: args = { flickerstreak@25: enable = { flickerstreak@25: type = "toggle", flickerstreak@25: name = L["Enable dynamic behavior"], flickerstreak@25: desc = L["Toggles dynamic behavior for this bar"], flickerstreak@25: get = function() return false end, flickerstreak@25: set = function(x) end, flickerstreak@25: disabled = InCombatLockdown, flickerstreak@25: order = 1 flickerstreak@25: }, flickerstreak@25: flickerstreak@25: default = { flickerstreak@25: type = "text", flickerstreak@25: name = L["Default State"], flickerstreak@25: desc = L["State when no conditions apply"], flickerstreak@25: get = function() return false end, flickerstreak@25: set = function(x) end, flickerstreak@25: disabled = IsEnabled, flickerstreak@25: order = 2 flickerstreak@25: }, flickerstreak@25: flickerstreak@25: stealth = { flickerstreak@25: type = "text", flickerstreak@25: name = L["Behavior when Stealthed"], flickerstreak@25: desc = L["Change bar state when stealthed"], flickerstreak@25: get = function() return false end, flickerstreak@25: set = function(x) end, flickerstreak@25: disabled = IsEnabled, flickerstreak@25: validate = { }, flickerstreak@25: }, flickerstreak@25: flickerstreak@25: } flickerstreak@25: } flickerstreak@25: } flickerstreak@25: end flickerstreak@25: return bar.modConfigOpts[moduleID] flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:GetBarMenuOptions( bar, configModule ) flickerstreak@25: flickerstreak@25: end flickerstreak@25: