comparison Options.lua @ 1:c11ca1d8ed91

Version 0.1
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:03:57 +0000
parents
children 8e0ff8ae4c08
comparison
equal deleted inserted replaced
0:4e2ce2894c21 1:c11ca1d8ed91
1 -- Ace2 Options table for ReAction
2
3 ReActionConsoleOptions = {
4 type="group",
5 args={
6 lock = {
7 type = "execute",
8 name = "lock",
9 desc = "Locks action bars and disables rearrangement",
10 func = "Lock",
11 },
12
13 unlock = {
14 type = "execute",
15 name = "unlock",
16 desc = "Unlocks action bars and enables rearrangement",
17 func = "Unlock",
18 },
19
20 hideart = {
21 type = "toggle",
22 name = "hideart",
23 desc = "Hide default Blizzard action bar artwork and XP bar",
24 get = "IsArtHidden",
25 set = "ToggleHideArt",
26 },
27
28 new = {
29 type = "execute",
30 name = "new",
31 desc = "Create a new bar with default settings",
32 func = "NewBar"
33 },
34
35 showid = {
36 type = "toggle",
37 name = "showid",
38 desc = "Show ActionIDs on buttons",
39 get = "IsActionIDVisible",
40 set = "ToggleActionID",
41 },
42
43 reset = {
44 type = "execute",
45 name = "reset",
46 desc = "Resets to single bar in the default position",
47 func = "ResetBars"
48 },
49
50 --[[
51 resync = {
52 type = "execute",
53 name = "resync",
54 desc = "Re-orders action IDs sequentially amongst bars",
55 func = "ResyncActionIDs"
56 },
57 ]]
58 }
59 }
60
61
62 ReActionGlobalMenuOptions = {
63 type="group",
64 args={
65 lock = {
66 type = "toggle",
67 name = "Locked",
68 desc = "Locks action bars and disables rearrangement",
69 get = function() return ReAction:IsLocked() end,
70 set = function() ReAction:ToggleLocked() end,
71 order = 2,
72 },
73
74 new = {
75 type = "execute",
76 name = "New Bar",
77 desc = "Create a new bar with default settings",
78 func = function() ReAction:NewBar() end,
79 order = 3
80 },
81
82 showid = {
83 type = "toggle",
84 name = "Show Action IDs",
85 desc = "Show ActionIDs on buttons",
86 get = function() return ReAction:IsActionIDVisible() end,
87 set = function() ReAction:ToggleActionID() end,
88 order = 4
89 },
90
91 --[[
92 resync = {
93 type = "execute",
94 name = "Re-sync Action IDs",
95 desc = "Re-orders action IDs sequentially amongst bars",
96 func = function() ReAction:ResyncActionIDs() end,
97 order = 5,
98 },
99 ]]
100
101 hideart = {
102 type = "toggle",
103 name = "Hide Default Art",
104 desc = "Hide default Blizzard action bar artwork and XP bar",
105 get = function() return ReAction:IsArtHidden() end,
106 set = function() return ReAction:ToggleHideArt() end,
107 order = 6,
108 },
109
110 reset = {
111 type = "execute",
112 name = "Reset Bars",
113 desc = "Resets to single bar in the default position",
114 func = function() ReAction:ResetBars() end,
115 order = 7
116 },
117
118 }
119 }
120
121
122 function GenerateReActionBarOptions( bar )
123 return {
124 type = "group",
125 args = {
126
127 sep1 = {
128 type = "header",
129 name = " ",
130 desc = " ",
131 order = 8,
132 },
133
134 hdr1 = {
135 type = "header",
136 name = "Bar Options",
137 des = "Bar Options",
138 order = 9,
139 },
140
141 --[[
142 hidden = {
143 type = "toggle",
144 name = "Hidden",
145 desc = "Hides the bar except when rearranging bars",
146 get = function() return not bar:GetVisibility() end,
147 set = function() bar:ToggleVisibility() end,
148 order = 10,
149 },
150 ]]
151
152 opacity = {
153 type = "range",
154 name = "Opacity",
155 desc = "Set bar opacity",
156 get = function() return bar:GetOpacity() end,
157 set = function(o) bar:SetOpacity(o) end,
158 min = 0,
159 max = 100,
160 step = 1,
161 order = 11
162 },
163
164 delete = {
165 type = "execute",
166 name = "Delete Bar",
167 desc = "Deletes the bar",
168 func = function() ReAction:DeleteBar(bar.barID) end,
169 order = 12,
170 },
171 }
172 }
173 end
174
175
176 local function setButtonConfig( bar, field, value )
177 if bar and bar.config and bar.config.btnConfig then
178 bar.config.btnConfig[field] = value
179 for _, b in ipairs(bar.buttons) do
180 b:ApplyLayout()
181 b:UpdateDisplay()
182 end
183 end
184 end
185
186 local function getButtonConfig( bar, field )
187 if bar and config and btnConfig then
188 return bar.config.btnConfig[field]
189 end
190 end
191
192 local function toggleButtonConfig( bar, field )
193 if bar and bar.config and bar.config.btnConfig then
194 bar.config.btnConfig[field] = not bar.config.btnConfig[field]
195 for _, b in ipairs(bar.buttons) do
196 b:ApplyLayout()
197 b:UpdateDisplay()
198 end
199 end
200 end
201
202
203 function GenerateReActionButtonOptions( bar )
204 return {
205 type = "group",
206 args = {
207
208 sep2 = {
209 type = "header",
210 name = " ",
211 desc = " ",
212 order = 13,
213 },
214
215 hdr2 = {
216 type = "header",
217 name = "Button Options",
218 desc = "Button Options",
219 order = 14,
220 },
221
222 colorkeys = {
223 type = "toggle",
224 name = "Color Hotkeys",
225 desc = "Enables/disables colorizing hotkeys by key modifier",
226 get = function() return getButtonConfig(bar, "keyBindColorCode") end,
227 set = function() toggleButtonConfig(bar, "keyBindColorCode", c) end,
228 order = 15,
229 },
230
231 keyloc = {
232 type = "text",
233 name = "Hotkey Location",
234 desc = "Sets hotkey location",
235 get = function() return getButtonConfig(bar, "keyBindLoc") end,
236 set = function(loc) setButtonConfig(bar, "keyBindLoc", loc) end,
237 validate = { "TOP", "BOTTOM", "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT" },
238 order = 16,
239 },
240
241 sep3 = {
242 type = "header",
243 name = " ",
244 desc = " ",
245 order = 17
246 },
247 }
248 }
249 end
250
251
252 ReActionProfileMenuOptions = {
253 type = "group",
254 args = { }
255 }