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@25
|
18 self.db = ReAction:AcquireDBNamespace(moduleID)
|
flickerstreak@25
|
19 ReAction:RegisterDefaults(moduleID,"profile",
|
flickerstreak@25
|
20 {
|
flickerstreak@25
|
21
|
flickerstreak@25
|
22 }
|
flickerstreak@25
|
23 )
|
flickerstreak@25
|
24 end
|
flickerstreak@25
|
25
|
flickerstreak@25
|
26 function module:OnEnable()
|
flickerstreak@25
|
27
|
flickerstreak@25
|
28 end
|
flickerstreak@25
|
29
|
flickerstreak@25
|
30 function module:OnDisable()
|
flickerstreak@25
|
31
|
flickerstreak@25
|
32 end
|
flickerstreak@25
|
33
|
flickerstreak@25
|
34 function module:OnProfileEnable()
|
flickerstreak@25
|
35
|
flickerstreak@25
|
36 end
|
flickerstreak@25
|
37
|
flickerstreak@25
|
38 function module:OnProfileDisable()
|
flickerstreak@25
|
39
|
flickerstreak@25
|
40 end
|
flickerstreak@25
|
41
|
flickerstreak@25
|
42 function module:GetGlobalOptions( configModule )
|
flickerstreak@25
|
43
|
flickerstreak@25
|
44 end
|
flickerstreak@25
|
45
|
flickerstreak@25
|
46 function module:GetGlobalBarOptions( configModule )
|
flickerstreak@25
|
47
|
flickerstreak@25
|
48 end
|
flickerstreak@25
|
49
|
flickerstreak@25
|
50 function module:GetModuleOptions( configModule )
|
flickerstreak@25
|
51
|
flickerstreak@25
|
52 end
|
flickerstreak@25
|
53
|
flickerstreak@25
|
54 function module:GetBarConfigOptions( bar, configModule )
|
flickerstreak@25
|
55 if not bar.modConfigOpts[moduleID] then
|
flickerstreak@25
|
56 local IsEnabled = function()
|
flickerstreak@25
|
57 return false
|
flickerstreak@25
|
58 end
|
flickerstreak@25
|
59
|
flickerstreak@25
|
60 bar.modConfigOpts[moduleID] = {
|
flickerstreak@25
|
61 state = {
|
flickerstreak@25
|
62 type = "group",
|
flickerstreak@25
|
63 name = L["Dynamic Behavior"],
|
flickerstreak@25
|
64 desc = L["Dynamic Behavior"],
|
flickerstreak@25
|
65 args = {
|
flickerstreak@25
|
66 enable = {
|
flickerstreak@25
|
67 type = "toggle",
|
flickerstreak@25
|
68 name = L["Enable dynamic behavior"],
|
flickerstreak@25
|
69 desc = L["Toggles dynamic behavior for this bar"],
|
flickerstreak@25
|
70 get = function() return false end,
|
flickerstreak@25
|
71 set = function(x) end,
|
flickerstreak@25
|
72 disabled = InCombatLockdown,
|
flickerstreak@25
|
73 order = 1
|
flickerstreak@25
|
74 },
|
flickerstreak@25
|
75
|
flickerstreak@25
|
76 default = {
|
flickerstreak@25
|
77 type = "text",
|
flickerstreak@25
|
78 name = L["Default State"],
|
flickerstreak@25
|
79 desc = L["State when no conditions apply"],
|
flickerstreak@25
|
80 get = function() return false end,
|
flickerstreak@25
|
81 set = function(x) end,
|
flickerstreak@25
|
82 disabled = IsEnabled,
|
flickerstreak@25
|
83 order = 2
|
flickerstreak@25
|
84 },
|
flickerstreak@25
|
85
|
flickerstreak@25
|
86 stealth = {
|
flickerstreak@25
|
87 type = "text",
|
flickerstreak@25
|
88 name = L["Behavior when Stealthed"],
|
flickerstreak@25
|
89 desc = L["Change bar state when stealthed"],
|
flickerstreak@25
|
90 get = function() return false end,
|
flickerstreak@25
|
91 set = function(x) end,
|
flickerstreak@25
|
92 disabled = IsEnabled,
|
flickerstreak@25
|
93 validate = { },
|
flickerstreak@25
|
94 },
|
flickerstreak@25
|
95
|
flickerstreak@25
|
96 }
|
flickerstreak@25
|
97 }
|
flickerstreak@25
|
98 }
|
flickerstreak@25
|
99 end
|
flickerstreak@25
|
100 return bar.modConfigOpts[moduleID]
|
flickerstreak@25
|
101 end
|
flickerstreak@25
|
102
|
flickerstreak@25
|
103 function module:GetBarMenuOptions( bar, configModule )
|
flickerstreak@25
|
104
|
flickerstreak@25
|
105 end
|
flickerstreak@25
|
106
|