flickerstreak@7: -- Ace2 global options tables for ReAction flickerstreak@7: flickerstreak@7: flickerstreak@7: -- autogenerate the NewBar sub-types table flickerstreak@7: local function GenerateNewBarArgs() flickerstreak@7: local args = { } flickerstreak@7: for _, name in pairs(ReAction:GetButtonTypeList() ) do flickerstreak@7: args[name] = { flickerstreak@7: type="execute", flickerstreak@7: name=name, flickerstreak@7: desc=name, flickerstreak@7: } flickerstreak@7: end flickerstreak@7: return args flickerstreak@7: end flickerstreak@7: flickerstreak@1: flickerstreak@1: ReActionConsoleOptions = { flickerstreak@1: type="group", flickerstreak@1: args={ flickerstreak@1: lock = { flickerstreak@1: type = "execute", flickerstreak@1: name = "lock", flickerstreak@1: desc = "Locks action bars and disables rearrangement", flickerstreak@1: func = "Lock", flickerstreak@1: }, flickerstreak@1: flickerstreak@1: unlock = { flickerstreak@1: type = "execute", flickerstreak@1: name = "unlock", flickerstreak@1: desc = "Unlocks action bars and enables rearrangement", flickerstreak@1: func = "Unlock", flickerstreak@1: }, flickerstreak@1: flickerstreak@2: bindings = { flickerstreak@2: type = "execute", flickerstreak@2: name = "bindings", flickerstreak@2: desc = "Launches keybinding setup mode", flickerstreak@7: func = function() ReBound:Enable() end, flickerstreak@2: }, flickerstreak@2: flickerstreak@1: hideart = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "hideart", flickerstreak@1: desc = "Hide default Blizzard action bar artwork and XP bar", flickerstreak@1: get = "IsArtHidden", flickerstreak@1: set = "ToggleHideArt", flickerstreak@1: }, flickerstreak@7: flickerstreak@1: showid = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "showid", flickerstreak@1: desc = "Show ActionIDs on buttons", flickerstreak@7: get = "AreIdsVisible", flickerstreak@7: set = "ToggleIds", flickerstreak@7: }, flickerstreak@7: flickerstreak@7: create = { flickerstreak@7: type = "group", flickerstreak@7: name = "create", flickerstreak@7: pass = true, flickerstreak@7: func = "NewBar", flickerstreak@7: args = GenerateNewBarArgs(), flickerstreak@7: desc = "Create a new bar", flickerstreak@1: }, flickerstreak@1: flickerstreak@2: resetall = { flickerstreak@1: type = "execute", flickerstreak@2: name = "resetall", flickerstreak@1: desc = "Resets to single bar in the default position", flickerstreak@7: func = "ResetBars", flickerstreak@1: }, flickerstreak@1: flickerstreak@1: --[[ flickerstreak@1: resync = { flickerstreak@1: type = "execute", flickerstreak@1: name = "resync", flickerstreak@1: desc = "Re-orders action IDs sequentially amongst bars", flickerstreak@7: func = "ResyncActionIDs", flickerstreak@7: disabled = true -- not yet implemented flickerstreak@1: }, flickerstreak@1: ]] flickerstreak@1: } flickerstreak@1: } flickerstreak@1: flickerstreak@1: flickerstreak@1: ReActionGlobalMenuOptions = { flickerstreak@7: type = "group", flickerstreak@7: -- handler = nil, -- NOTE: this variable isn't defined yet, must be added later flickerstreak@1: args={ flickerstreak@2: lockbars = { flickerstreak@1: type = "toggle", flickerstreak@2: name = "Lock Bars", flickerstreak@1: desc = "Locks action bars and disables rearrangement", flickerstreak@7: get = "IsLocked", flickerstreak@7: set = "ToggleLocked", flickerstreak@2: order = 1, flickerstreak@2: }, flickerstreak@2: flickerstreak@2: lockbtns = { flickerstreak@2: type = "toggle", flickerstreak@2: name = "Lock Buttons", flickerstreak@7: desc = "Prevents buttons from being dragged off accidentally. Shift-drag instead.", flickerstreak@2: get = function() return LOCK_ACTIONBAR == "1" end, flickerstreak@2: set = function() LOCK_ACTIONBAR = (LOCK_ACTIONBAR == "1" and "0" or "1") end, flickerstreak@1: order = 2, flickerstreak@1: }, flickerstreak@1: flickerstreak@7: new = { flickerstreak@7: type = "group", flickerstreak@7: name = "New bar", flickerstreak@7: pass = true, flickerstreak@7: func = "NewBar", flickerstreak@7: args = GenerateNewBarArgs(), flickerstreak@7: desc = "Create a new bar", flickerstreak@7: order = 3, flickerstreak@7: }, flickerstreak@7: flickerstreak@2: bindings = { flickerstreak@2: type = "execute", flickerstreak@2: name = "Set Key Bindings", flickerstreak@2: desc = "Launches keybinding setup mode", flickerstreak@7: func = function() ReBound:Enable() end, flickerstreak@7: order = 4, flickerstreak@2: }, flickerstreak@2: flickerstreak@1: showid = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "Show Action IDs", flickerstreak@1: desc = "Show ActionIDs on buttons", flickerstreak@7: get = "AreIdsVisible", flickerstreak@7: set = "ToggleIds", flickerstreak@2: order = 5, flickerstreak@1: }, flickerstreak@1: flickerstreak@7: hidedefault = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Hide Default Main Menu Bar", flickerstreak@7: desc = "Hides default Blizzard main menu bar, including bag bar, micro menu bar, shapeshift bar, lag meter, and XP bar", flickerstreak@7: get = "IsArtHidden", flickerstreak@7: set = "ToggleHideArt", flickerstreak@7: order = 6, flickerstreak@7: }, flickerstreak@7: flickerstreak@1: --[[ flickerstreak@1: resync = { flickerstreak@1: type = "execute", flickerstreak@1: name = "Re-sync Action IDs", flickerstreak@1: desc = "Re-orders action IDs sequentially amongst bars", flickerstreak@7: func = "ResyncActionIDs", flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@1: }, flickerstreak@1: ]] flickerstreak@1: flickerstreak@1: } flickerstreak@1: } flickerstreak@1: flickerstreak@7: flickerstreak@7: flickerstreak@7: flickerstreak@7: flickerstreak@7: function GenerateReActionBarOptions( bar, main ) flickerstreak@7: local opts = { flickerstreak@1: type = "group", flickerstreak@7: handler = bar, flickerstreak@1: args = { flickerstreak@1: flickerstreak@1: sep1 = { flickerstreak@1: type = "header", flickerstreak@1: name = " ", flickerstreak@1: desc = " ", flickerstreak@7: order = 1, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: hdr1 = { flickerstreak@1: type = "header", flickerstreak@7: name = "Options for Bar #"..bar.barID, flickerstreak@7: desc = "Options for Bar #"..bar.barID, flickerstreak@7: order = 2, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: layout = { flickerstreak@7: type = "group", flickerstreak@7: name = "Layout", flickerstreak@7: desc = "Button ordering options", flickerstreak@7: order = 3, flickerstreak@7: args = { flickerstreak@7: growLeft = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Right to Left", flickerstreak@7: desc = "Lay out buttons right-to-left rather than left-to-right", flickerstreak@7: get = "GetGrowLeft", flickerstreak@7: set = "SetGrowLeft", flickerstreak@7: order = 3, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: growUp = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Bottom to Top", flickerstreak@7: desc = "Lay out buttons bottom-to-top rather than top-to-bottom", flickerstreak@7: get = "GetGrowUp", flickerstreak@7: set = "SetGrowUp", flickerstreak@7: order = 4, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: columnMajor = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Arrange in Columns", flickerstreak@7: desc = "Lay out buttons sequentially in columns, rather than in rows", flickerstreak@7: get = "GetColumnMajor", flickerstreak@7: set = "SetColumnMajor", flickerstreak@7: order = 5, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: flip = { flickerstreak@7: type = "execute", flickerstreak@7: name = "Flip rows/columns", flickerstreak@7: desc = "Swaps the number of rows and columns, and inverts the button numbering", flickerstreak@7: func = "FlipRowsColumns", flickerstreak@7: order = 6, flickerstreak@7: }, flickerstreak@7: }, flickerstreak@1: }, flickerstreak@1: flickerstreak@7: paging = { flickerstreak@7: type = "group", flickerstreak@7: name = "Paging", flickerstreak@7: desc = "Multi-page options", flickerstreak@7: order = 4, flickerstreak@7: args = { flickerstreak@7: pages = { flickerstreak@7: type = "range", flickerstreak@7: name = "Number of Pages", flickerstreak@7: desc = "Sets the number of pages", flickerstreak@7: get = "GetPages", flickerstreak@7: set = "SetPages", flickerstreak@7: min = 1, flickerstreak@7: max = 10, flickerstreak@7: step = 1, flickerstreak@7: order = 1, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: autostance = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Auto Stance Switch", flickerstreak@7: desc = "Automatically switch pages when changing stance or shapeshift form.", flickerstreak@7: get = "GetAutoStanceSwitch", flickerstreak@7: set = "ToggleAutoStanceSwitch", flickerstreak@7: order = 2, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: autostealth = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Auto Stealth Switch", flickerstreak@7: desc = "Automatically switch pages when stealthing/unstealthing.", flickerstreak@7: get = "GetAutoStealthSwitch", flickerstreak@7: set = "ToggleAutoStealthSwitch", flickerstreak@7: order = 3, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: hidecontrols = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Hide Paging Controls", flickerstreak@7: desc = "Hide the page up/down controls", flickerstreak@7: get = "ArePageControlsHidden", flickerstreak@7: set = "TogglePageControlsHidden", flickerstreak@7: order = 4, flickerstreak@7: disabled = "IsPagingDisabled", flickerstreak@7: }, flickerstreak@7: flickerstreak@7: controlsloc = { flickerstreak@7: type = "text", flickerstreak@7: name = "Control location", flickerstreak@7: desc = "Location of the page up/down controls", flickerstreak@7: get = function() return bar:GetPageControlsLoc() or "Blizzard" end, flickerstreak@7: set = function(loc) bar:SetPageControlsLoc(loc) end, flickerstreak@7: order = 5, flickerstreak@7: disabled = function() return bar:IsPagingDisabled() or bar:ArePageControlsHidden() end, flickerstreak@7: validate = { "Blizzard", "LEFT", "RIGHT", "TOP", "BOTTOM" } flickerstreak@7: }, flickerstreak@7: }, flickerstreak@1: }, flickerstreak@7: flickerstreak@7: visibility = { flickerstreak@7: type = "group", flickerstreak@7: name = "Visibility", flickerstreak@7: desc = "Set bar visibility options", flickerstreak@7: order = 5, flickerstreak@7: args = { flickerstreak@7: visible = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Always Visible", flickerstreak@7: desc = "The bar will always be visible.|n This setting overrides conditional settings below.", flickerstreak@7: get = "GetVisibility", flickerstreak@7: set = function() bar:SetVisibility(true) end, flickerstreak@7: order = 1, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: hidden = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Always Hidden", flickerstreak@7: desc = "The bar will always be hidden, except when bars are unlocked.|n This setting overrides conditional settings below.", flickerstreak@7: get = function() return not bar:GetVisibility() end, flickerstreak@7: set = function() bar:SetVisibility(false) end, flickerstreak@7: order = 2, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: spring = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Spring Bar Mode", flickerstreak@7: 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: get = function() end, flickerstreak@7: set = function() end, flickerstreak@7: hidden = true, flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@7: order = 3, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: conditional = { flickerstreak@7: type = "group", flickerstreak@7: name = "Auto Show", flickerstreak@7: desc = "Dynamically hide and show the entire bar based on certain conditions.", flickerstreak@7: hidden = true, flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@7: order = 4, flickerstreak@7: args = { flickerstreak@7: flickerstreak@7: mouseover = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Show On Mouseover", flickerstreak@7: desc = "Show the bar only when the mouse is over it.", flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@7: get = function() end, flickerstreak@7: set = function() end, flickerstreak@7: order = 1, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: combat = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Show In Combat", flickerstreak@7: desc = "Show the bar only when in combat.", flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@7: get = function() end, flickerstreak@7: set = function() end, flickerstreak@7: order = 2, flickerstreak@7: }, flickerstreak@7: flickerstreak@7: nocombat = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Hide in Combat", flickerstreak@7: desc = "Show the bar only when not in combat.", flickerstreak@7: disabled = true, -- not yet implemented flickerstreak@7: get = function() end, flickerstreak@7: set = function() end, flickerstreak@7: order = 3, flickerstreak@7: } flickerstreak@7: } flickerstreak@7: }, flickerstreak@7: flickerstreak@7: } flickerstreak@7: }, flickerstreak@1: flickerstreak@1: opacity = { flickerstreak@1: type = "range", flickerstreak@1: name = "Opacity", flickerstreak@7: desc = "Set the bar alpha value, from fully transparent (0) to fully opaque (100).", flickerstreak@7: get = "GetOpacity", flickerstreak@7: set = "SetOpacity", flickerstreak@1: min = 0, flickerstreak@1: max = 100, flickerstreak@1: step = 1, flickerstreak@7: order = 6, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: delete = { flickerstreak@1: type = "execute", flickerstreak@7: name = "Delete Bar #"..bar.barID, flickerstreak@7: desc = "Deletes bar #"..bar.barID, flickerstreak@7: func = function() main:DeleteBar(bar.barID) end, flickerstreak@7: order = 7 flickerstreak@1: }, flickerstreak@1: } flickerstreak@1: } flickerstreak@7: flickerstreak@7: -- generate the auto-hide options for shapeshift forms. Note that this will flickerstreak@7: -- only show forms that the character has learned, and the ordering may (? did this get fixed?) flickerstreak@7: -- vary from character to character of the same class flickerstreak@7: local args = opts.args.visibility.args.conditional.args flickerstreak@7: for i = 1, GetNumShapeshiftForms() do flickerstreak@7: local _, name = GetShapeshiftFormInfo(i) flickerstreak@7: args["stance"..i] = { flickerstreak@7: type = "toggle", flickerstreak@7: name = "Show In "..name, flickerstreak@7: desc = "Show the bar when in "..name.."." , flickerstreak@7: get = function() end, flickerstreak@7: set = function() end, flickerstreak@7: order = #args + 1, flickerstreak@7: disabled = true, flickerstreak@7: } flickerstreak@7: end flickerstreak@7: flickerstreak@7: return opts flickerstreak@1: end flickerstreak@1: