annotate Options.lua @ 8:c05fd3e18b4f

Version 0.31
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:33:59 +0000
parents f920db5fc6b1
children f3a7bfebc283
rev   line source
flickerstreak@7 1 -- Ace2 global options tables for ReAction
flickerstreak@7 2
flickerstreak@7 3
flickerstreak@7 4 -- autogenerate the NewBar sub-types table
flickerstreak@7 5 local function GenerateNewBarArgs()
flickerstreak@7 6 local args = { }
flickerstreak@7 7 for _, name in pairs(ReAction:GetButtonTypeList() ) do
flickerstreak@7 8 args[name] = {
flickerstreak@7 9 type="execute",
flickerstreak@7 10 name=name,
flickerstreak@7 11 desc=name,
flickerstreak@7 12 }
flickerstreak@7 13 end
flickerstreak@7 14 return args
flickerstreak@7 15 end
flickerstreak@7 16
flickerstreak@1 17
flickerstreak@1 18 ReActionConsoleOptions = {
flickerstreak@1 19 type="group",
flickerstreak@1 20 args={
flickerstreak@1 21 lock = {
flickerstreak@1 22 type = "execute",
flickerstreak@1 23 name = "lock",
flickerstreak@1 24 desc = "Locks action bars and disables rearrangement",
flickerstreak@1 25 func = "Lock",
flickerstreak@1 26 },
flickerstreak@1 27
flickerstreak@1 28 unlock = {
flickerstreak@1 29 type = "execute",
flickerstreak@1 30 name = "unlock",
flickerstreak@1 31 desc = "Unlocks action bars and enables rearrangement",
flickerstreak@1 32 func = "Unlock",
flickerstreak@1 33 },
flickerstreak@1 34
flickerstreak@2 35 bindings = {
flickerstreak@2 36 type = "execute",
flickerstreak@2 37 name = "bindings",
flickerstreak@2 38 desc = "Launches keybinding setup mode",
flickerstreak@7 39 func = function() ReBound:Enable() end,
flickerstreak@2 40 },
flickerstreak@2 41
flickerstreak@1 42 hideart = {
flickerstreak@1 43 type = "toggle",
flickerstreak@1 44 name = "hideart",
flickerstreak@1 45 desc = "Hide default Blizzard action bar artwork and XP bar",
flickerstreak@1 46 get = "IsArtHidden",
flickerstreak@1 47 set = "ToggleHideArt",
flickerstreak@1 48 },
flickerstreak@7 49
flickerstreak@1 50 showid = {
flickerstreak@1 51 type = "toggle",
flickerstreak@1 52 name = "showid",
flickerstreak@1 53 desc = "Show ActionIDs on buttons",
flickerstreak@7 54 get = "AreIdsVisible",
flickerstreak@7 55 set = "ToggleIds",
flickerstreak@8 56 disabled = true,
flickerstreak@7 57 },
flickerstreak@7 58
flickerstreak@7 59 create = {
flickerstreak@7 60 type = "group",
flickerstreak@7 61 name = "create",
flickerstreak@7 62 pass = true,
flickerstreak@7 63 func = "NewBar",
flickerstreak@7 64 args = GenerateNewBarArgs(),
flickerstreak@7 65 desc = "Create a new bar",
flickerstreak@1 66 },
flickerstreak@1 67
flickerstreak@2 68 resetall = {
flickerstreak@1 69 type = "execute",
flickerstreak@2 70 name = "resetall",
flickerstreak@1 71 desc = "Resets to single bar in the default position",
flickerstreak@7 72 func = "ResetBars",
flickerstreak@1 73 },
flickerstreak@1 74
flickerstreak@1 75 --[[
flickerstreak@1 76 resync = {
flickerstreak@1 77 type = "execute",
flickerstreak@1 78 name = "resync",
flickerstreak@1 79 desc = "Re-orders action IDs sequentially amongst bars",
flickerstreak@7 80 func = "ResyncActionIDs",
flickerstreak@7 81 disabled = true -- not yet implemented
flickerstreak@1 82 },
flickerstreak@1 83 ]]
flickerstreak@1 84 }
flickerstreak@1 85 }
flickerstreak@1 86
flickerstreak@1 87
flickerstreak@1 88 ReActionGlobalMenuOptions = {
flickerstreak@7 89 type = "group",
flickerstreak@7 90 -- handler = nil, -- NOTE: this variable isn't defined yet, must be added later
flickerstreak@1 91 args={
flickerstreak@2 92 lockbars = {
flickerstreak@1 93 type = "toggle",
flickerstreak@2 94 name = "Lock Bars",
flickerstreak@1 95 desc = "Locks action bars and disables rearrangement",
flickerstreak@7 96 get = "IsLocked",
flickerstreak@7 97 set = "ToggleLocked",
flickerstreak@2 98 order = 1,
flickerstreak@2 99 },
flickerstreak@2 100
flickerstreak@2 101 lockbtns = {
flickerstreak@2 102 type = "toggle",
flickerstreak@2 103 name = "Lock Buttons",
flickerstreak@7 104 desc = "Prevents buttons from being dragged off accidentally. Shift-drag instead.",
flickerstreak@2 105 get = function() return LOCK_ACTIONBAR == "1" end,
flickerstreak@2 106 set = function() LOCK_ACTIONBAR = (LOCK_ACTIONBAR == "1" and "0" or "1") end,
flickerstreak@1 107 order = 2,
flickerstreak@1 108 },
flickerstreak@1 109
flickerstreak@7 110 new = {
flickerstreak@7 111 type = "group",
flickerstreak@7 112 name = "New bar",
flickerstreak@7 113 pass = true,
flickerstreak@7 114 func = "NewBar",
flickerstreak@7 115 args = GenerateNewBarArgs(),
flickerstreak@7 116 desc = "Create a new bar",
flickerstreak@7 117 order = 3,
flickerstreak@7 118 },
flickerstreak@7 119
flickerstreak@2 120 bindings = {
flickerstreak@2 121 type = "execute",
flickerstreak@2 122 name = "Set Key Bindings",
flickerstreak@2 123 desc = "Launches keybinding setup mode",
flickerstreak@7 124 func = function() ReBound:Enable() end,
flickerstreak@7 125 order = 4,
flickerstreak@2 126 },
flickerstreak@2 127
flickerstreak@7 128 hidedefault = {
flickerstreak@7 129 type = "toggle",
flickerstreak@7 130 name = "Hide Default Main Menu Bar",
flickerstreak@7 131 desc = "Hides default Blizzard main menu bar, including bag bar, micro menu bar, shapeshift bar, lag meter, and XP bar",
flickerstreak@7 132 get = "IsArtHidden",
flickerstreak@7 133 set = "ToggleHideArt",
flickerstreak@7 134 order = 6,
flickerstreak@7 135 },
flickerstreak@7 136
flickerstreak@1 137 --[[
flickerstreak@1 138 resync = {
flickerstreak@1 139 type = "execute",
flickerstreak@1 140 name = "Re-sync Action IDs",
flickerstreak@1 141 desc = "Re-orders action IDs sequentially amongst bars",
flickerstreak@7 142 func = "ResyncActionIDs",
flickerstreak@7 143 disabled = true, -- not yet implemented
flickerstreak@1 144 },
flickerstreak@1 145 ]]
flickerstreak@1 146
flickerstreak@1 147 }
flickerstreak@1 148 }
flickerstreak@1 149
flickerstreak@7 150
flickerstreak@7 151
flickerstreak@7 152
flickerstreak@7 153
flickerstreak@7 154 function GenerateReActionBarOptions( bar, main )
flickerstreak@7 155 local opts = {
flickerstreak@1 156 type = "group",
flickerstreak@7 157 handler = bar,
flickerstreak@1 158 args = {
flickerstreak@1 159
flickerstreak@1 160 sep1 = {
flickerstreak@1 161 type = "header",
flickerstreak@1 162 name = " ",
flickerstreak@1 163 desc = " ",
flickerstreak@7 164 order = 1,
flickerstreak@1 165 },
flickerstreak@1 166
flickerstreak@1 167 hdr1 = {
flickerstreak@1 168 type = "header",
flickerstreak@7 169 name = "Options for Bar #"..bar.barID,
flickerstreak@7 170 desc = "Options for Bar #"..bar.barID,
flickerstreak@7 171 order = 2,
flickerstreak@7 172 },
flickerstreak@7 173
flickerstreak@7 174 layout = {
flickerstreak@7 175 type = "group",
flickerstreak@7 176 name = "Layout",
flickerstreak@7 177 desc = "Button ordering options",
flickerstreak@7 178 order = 3,
flickerstreak@7 179 args = {
flickerstreak@7 180 growLeft = {
flickerstreak@7 181 type = "toggle",
flickerstreak@7 182 name = "Right to Left",
flickerstreak@7 183 desc = "Lay out buttons right-to-left rather than left-to-right",
flickerstreak@7 184 get = "GetGrowLeft",
flickerstreak@7 185 set = "SetGrowLeft",
flickerstreak@7 186 order = 3,
flickerstreak@7 187 },
flickerstreak@7 188
flickerstreak@7 189 growUp = {
flickerstreak@7 190 type = "toggle",
flickerstreak@7 191 name = "Bottom to Top",
flickerstreak@7 192 desc = "Lay out buttons bottom-to-top rather than top-to-bottom",
flickerstreak@7 193 get = "GetGrowUp",
flickerstreak@7 194 set = "SetGrowUp",
flickerstreak@7 195 order = 4,
flickerstreak@7 196 },
flickerstreak@7 197
flickerstreak@7 198 columnMajor = {
flickerstreak@7 199 type = "toggle",
flickerstreak@7 200 name = "Arrange in Columns",
flickerstreak@7 201 desc = "Lay out buttons sequentially in columns, rather than in rows",
flickerstreak@7 202 get = "GetColumnMajor",
flickerstreak@7 203 set = "SetColumnMajor",
flickerstreak@7 204 order = 5,
flickerstreak@7 205 },
flickerstreak@7 206
flickerstreak@7 207 flip = {
flickerstreak@7 208 type = "execute",
flickerstreak@7 209 name = "Flip rows/columns",
flickerstreak@7 210 desc = "Swaps the number of rows and columns, and inverts the button numbering",
flickerstreak@7 211 func = "FlipRowsColumns",
flickerstreak@7 212 order = 6,
flickerstreak@7 213 },
flickerstreak@7 214 },
flickerstreak@1 215 },
flickerstreak@1 216
flickerstreak@7 217 paging = {
flickerstreak@7 218 type = "group",
flickerstreak@7 219 name = "Paging",
flickerstreak@7 220 desc = "Multi-page options",
flickerstreak@7 221 order = 4,
flickerstreak@7 222 args = {
flickerstreak@7 223 pages = {
flickerstreak@7 224 type = "range",
flickerstreak@7 225 name = "Number of Pages",
flickerstreak@7 226 desc = "Sets the number of pages",
flickerstreak@7 227 get = "GetPages",
flickerstreak@7 228 set = "SetPages",
flickerstreak@7 229 min = 1,
flickerstreak@7 230 max = 10,
flickerstreak@7 231 step = 1,
flickerstreak@7 232 order = 1,
flickerstreak@7 233 },
flickerstreak@7 234
flickerstreak@7 235 autostance = {
flickerstreak@7 236 type = "toggle",
flickerstreak@7 237 name = "Auto Stance Switch",
flickerstreak@7 238 desc = "Automatically switch pages when changing stance or shapeshift form.",
flickerstreak@7 239 get = "GetAutoStanceSwitch",
flickerstreak@7 240 set = "ToggleAutoStanceSwitch",
flickerstreak@7 241 order = 2,
flickerstreak@7 242 },
flickerstreak@7 243
flickerstreak@7 244 autostealth = {
flickerstreak@7 245 type = "toggle",
flickerstreak@7 246 name = "Auto Stealth Switch",
flickerstreak@7 247 desc = "Automatically switch pages when stealthing/unstealthing.",
flickerstreak@7 248 get = "GetAutoStealthSwitch",
flickerstreak@7 249 set = "ToggleAutoStealthSwitch",
flickerstreak@7 250 order = 3,
flickerstreak@7 251 },
flickerstreak@7 252
flickerstreak@7 253 hidecontrols = {
flickerstreak@7 254 type = "toggle",
flickerstreak@7 255 name = "Hide Paging Controls",
flickerstreak@7 256 desc = "Hide the page up/down controls",
flickerstreak@7 257 get = "ArePageControlsHidden",
flickerstreak@7 258 set = "TogglePageControlsHidden",
flickerstreak@7 259 order = 4,
flickerstreak@7 260 disabled = "IsPagingDisabled",
flickerstreak@7 261 },
flickerstreak@7 262
flickerstreak@7 263 controlsloc = {
flickerstreak@7 264 type = "text",
flickerstreak@7 265 name = "Control location",
flickerstreak@7 266 desc = "Location of the page up/down controls",
flickerstreak@7 267 get = function() return bar:GetPageControlsLoc() or "Blizzard" end,
flickerstreak@7 268 set = function(loc) bar:SetPageControlsLoc(loc) end,
flickerstreak@7 269 order = 5,
flickerstreak@7 270 disabled = function() return bar:IsPagingDisabled() or bar:ArePageControlsHidden() end,
flickerstreak@7 271 validate = { "Blizzard", "LEFT", "RIGHT", "TOP", "BOTTOM" }
flickerstreak@7 272 },
flickerstreak@7 273 },
flickerstreak@1 274 },
flickerstreak@7 275
flickerstreak@7 276 visibility = {
flickerstreak@7 277 type = "group",
flickerstreak@7 278 name = "Visibility",
flickerstreak@7 279 desc = "Set bar visibility options",
flickerstreak@7 280 order = 5,
flickerstreak@7 281 args = {
flickerstreak@7 282 visible = {
flickerstreak@7 283 type = "toggle",
flickerstreak@7 284 name = "Always Visible",
flickerstreak@7 285 desc = "The bar will always be visible.|n This setting overrides conditional settings below.",
flickerstreak@7 286 get = "GetVisibility",
flickerstreak@7 287 set = function() bar:SetVisibility(true) end,
flickerstreak@7 288 order = 1,
flickerstreak@7 289 },
flickerstreak@7 290
flickerstreak@7 291 hidden = {
flickerstreak@7 292 type = "toggle",
flickerstreak@7 293 name = "Always Hidden",
flickerstreak@7 294 desc = "The bar will always be hidden, except when bars are unlocked.|n This setting overrides conditional settings below.",
flickerstreak@7 295 get = function() return not bar:GetVisibility() end,
flickerstreak@7 296 set = function() bar:SetVisibility(false) end,
flickerstreak@7 297 order = 2,
flickerstreak@7 298 },
flickerstreak@7 299
flickerstreak@7 300 spring = {
flickerstreak@7 301 type = "toggle",
flickerstreak@7 302 name = "Spring Bar Mode",
flickerstreak@7 303 desc = "The bar is collapsed to a single button, which displays the last action used. Mousing over the button shows the entire bar.|n This setting overrides conditional settings below.",
flickerstreak@7 304 get = function() end,
flickerstreak@7 305 set = function() end,
flickerstreak@7 306 hidden = true,
flickerstreak@7 307 disabled = true, -- not yet implemented
flickerstreak@7 308 order = 3,
flickerstreak@7 309 },
flickerstreak@7 310
flickerstreak@7 311 conditional = {
flickerstreak@7 312 type = "group",
flickerstreak@7 313 name = "Auto Show",
flickerstreak@7 314 desc = "Dynamically hide and show the entire bar based on certain conditions.",
flickerstreak@7 315 hidden = true,
flickerstreak@7 316 disabled = true, -- not yet implemented
flickerstreak@7 317 order = 4,
flickerstreak@7 318 args = {
flickerstreak@7 319
flickerstreak@7 320 mouseover = {
flickerstreak@7 321 type = "toggle",
flickerstreak@7 322 name = "Show On Mouseover",
flickerstreak@7 323 desc = "Show the bar only when the mouse is over it.",
flickerstreak@7 324 disabled = true, -- not yet implemented
flickerstreak@7 325 get = function() end,
flickerstreak@7 326 set = function() end,
flickerstreak@7 327 order = 1,
flickerstreak@7 328 },
flickerstreak@7 329
flickerstreak@7 330 combat = {
flickerstreak@7 331 type = "toggle",
flickerstreak@7 332 name = "Show In Combat",
flickerstreak@7 333 desc = "Show the bar only when in combat.",
flickerstreak@7 334 disabled = true, -- not yet implemented
flickerstreak@7 335 get = function() end,
flickerstreak@7 336 set = function() end,
flickerstreak@7 337 order = 2,
flickerstreak@7 338 },
flickerstreak@7 339
flickerstreak@7 340 nocombat = {
flickerstreak@7 341 type = "toggle",
flickerstreak@7 342 name = "Hide in Combat",
flickerstreak@7 343 desc = "Show the bar only when not in combat.",
flickerstreak@7 344 disabled = true, -- not yet implemented
flickerstreak@7 345 get = function() end,
flickerstreak@7 346 set = function() end,
flickerstreak@7 347 order = 3,
flickerstreak@7 348 }
flickerstreak@7 349 }
flickerstreak@7 350 },
flickerstreak@7 351
flickerstreak@7 352 }
flickerstreak@7 353 },
flickerstreak@1 354
flickerstreak@1 355 delete = {
flickerstreak@1 356 type = "execute",
flickerstreak@7 357 name = "Delete Bar #"..bar.barID,
flickerstreak@7 358 desc = "Deletes bar #"..bar.barID,
flickerstreak@7 359 func = function() main:DeleteBar(bar.barID) end,
flickerstreak@7 360 order = 7
flickerstreak@1 361 },
flickerstreak@1 362 }
flickerstreak@1 363 }
flickerstreak@7 364
flickerstreak@7 365 -- generate the auto-hide options for shapeshift forms. Note that this will
flickerstreak@7 366 -- only show forms that the character has learned, and the ordering may (? did this get fixed?)
flickerstreak@7 367 -- vary from character to character of the same class
flickerstreak@7 368 local args = opts.args.visibility.args.conditional.args
flickerstreak@7 369 for i = 1, GetNumShapeshiftForms() do
flickerstreak@7 370 local _, name = GetShapeshiftFormInfo(i)
flickerstreak@7 371 args["stance"..i] = {
flickerstreak@7 372 type = "toggle",
flickerstreak@7 373 name = "Show In "..name,
flickerstreak@7 374 desc = "Show the bar when in "..name.."." ,
flickerstreak@7 375 get = function() end,
flickerstreak@7 376 set = function() end,
flickerstreak@7 377 order = #args + 1,
flickerstreak@7 378 disabled = true,
flickerstreak@7 379 }
flickerstreak@7 380 end
flickerstreak@7 381
flickerstreak@7 382 return opts
flickerstreak@1 383 end
flickerstreak@1 384