view modules/ReAction_State/ReAction_State.lua @ 52:c9df7866ff31

Added anchor snapping
author Flick <flickerstreak@gmail.com>
date Thu, 24 Apr 2008 19:19:42 +0000
parents 21bcaf8215ff
children f9cdb920470a
line wrap: on
line source
--[[
  ReAction bar state machine

--]]

-- local imports
local ReAction = ReAction
local L = ReAction.L
local _G = _G
local InCombatLockdown = InCombatLockdown

-- module declaration
local moduleID = "State"
local module = ReAction:NewModule( moduleID )

-- module methods
function module:OnInitialize()
  self.db = ReAction:RegisterNamespace( moduleID, 
    {
      profile = { }
    }
  )
end

function module:OnEnable()

end

function module:OnDisable()

end

--function module:GetGlobalOptions( configModule )
--  return {}
--end

--function module:GetGlobalBarOptions( configModule )
--
--end

--function module:GetModuleOptions( configModule )
--
--end

function module:GetBarConfigOptions( bar, configModule )
  if not bar.modConfigOpts[moduleID] then
    local IsEnabled = function() 
      return false
    end

    bar.modConfigOpts[moduleID] = {
      state = {
        type = "group",
        name = L["Dynamic Behavior"],
        desc = L["Dynamic Behavior"],
        args = {
          enable = {
            type = "toggle",
            name = L["Enable dynamic behavior"],
            desc = L["Toggles dynamic behavior for this bar"],
            get  = function() return false end,
            set  = function(x) end,
            disabled = InCombatLockdown,
            order = 1
          },

          default = {
            type = "text",
            name = L["Default State"],
            desc = L["State when no conditions apply"],
            get  = function() return false end,
            set  = function(x) end,
            disabled = IsEnabled,
            order = 2
          },

          stealth = {
            type = "text",
            name = L["Behavior when Stealthed"],
            desc = L["Change bar state when stealthed"],
            get  = function() return false end,
            set  = function(x) end,
            disabled = IsEnabled,
            validate = { },
          },

        }
      }
    }
  end
  return bar.modConfigOpts[moduleID]
end

function module:GetBarMenuOptions( bar, configModule )

end