flickerstreak@1: -- Ace2 Options table for ReAction 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@2: func = function() ReBinder: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@1: flickerstreak@1: new = { flickerstreak@1: type = "execute", flickerstreak@1: name = "new", flickerstreak@1: desc = "Create a new bar with default settings", flickerstreak@1: func = "NewBar" flickerstreak@1: }, flickerstreak@1: flickerstreak@1: showid = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "showid", flickerstreak@1: desc = "Show ActionIDs on buttons", flickerstreak@1: get = "IsActionIDVisible", flickerstreak@1: set = "ToggleActionID", 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@1: 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@1: func = "ResyncActionIDs" flickerstreak@1: }, flickerstreak@1: ]] flickerstreak@1: } flickerstreak@1: } flickerstreak@1: flickerstreak@1: flickerstreak@1: ReActionGlobalMenuOptions = { flickerstreak@1: type="group", 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@1: get = function() return ReAction:IsLocked() end, flickerstreak@1: set = function() ReAction:ToggleLocked() end, flickerstreak@2: order = 1, flickerstreak@2: }, flickerstreak@2: flickerstreak@2: lockbtns = { flickerstreak@2: type = "toggle", flickerstreak@2: name = "Lock Buttons", flickerstreak@2: desc = "Locks action bars and disables rearrangement", 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@2: bindings = { flickerstreak@2: type = "execute", flickerstreak@2: name = "Set Key Bindings", flickerstreak@2: desc = "Launches keybinding setup mode", flickerstreak@2: func = function() ReBinder:Enable() end, flickerstreak@2: order = 3, flickerstreak@2: }, flickerstreak@2: flickerstreak@1: new = { flickerstreak@1: type = "execute", flickerstreak@1: name = "New Bar", flickerstreak@1: desc = "Create a new bar with default settings", flickerstreak@1: func = function() ReAction:NewBar() end, flickerstreak@2: order = 4, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: showid = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "Show Action IDs", flickerstreak@1: desc = "Show ActionIDs on buttons", flickerstreak@1: get = function() return ReAction:IsActionIDVisible() end, flickerstreak@1: set = function() ReAction:ToggleActionID() end, flickerstreak@2: order = 5, flickerstreak@1: }, flickerstreak@1: 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@1: func = function() ReAction:ResyncActionIDs() end, flickerstreak@2: order = 6, flickerstreak@1: }, flickerstreak@1: ]] flickerstreak@1: flickerstreak@1: hideart = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "Hide Default Art", flickerstreak@1: desc = "Hide default Blizzard action bar artwork and XP bar", flickerstreak@1: get = function() return ReAction:IsArtHidden() end, flickerstreak@1: set = function() return ReAction:ToggleHideArt() end, flickerstreak@2: order = 7, flickerstreak@1: }, flickerstreak@1: flickerstreak@2: --[[ flickerstreak@1: reset = { flickerstreak@1: type = "execute", flickerstreak@1: name = "Reset Bars", flickerstreak@1: desc = "Resets to single bar in the default position", flickerstreak@1: func = function() ReAction:ResetBars() end, flickerstreak@2: order = 8, flickerstreak@1: }, flickerstreak@2: ]] flickerstreak@1: flickerstreak@1: } flickerstreak@1: } flickerstreak@1: flickerstreak@1: function GenerateReActionBarOptions( bar ) flickerstreak@1: return { flickerstreak@1: type = "group", flickerstreak@1: args = { flickerstreak@1: flickerstreak@1: sep1 = { flickerstreak@1: type = "header", flickerstreak@1: name = " ", flickerstreak@1: desc = " ", flickerstreak@2: order = 9, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: hdr1 = { flickerstreak@1: type = "header", flickerstreak@1: name = "Bar Options", flickerstreak@1: des = "Bar Options", flickerstreak@2: order = 10, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: --[[ flickerstreak@1: hidden = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "Hidden", flickerstreak@1: desc = "Hides the bar except when rearranging bars", flickerstreak@1: get = function() return not bar:GetVisibility() end, flickerstreak@1: set = function() bar:ToggleVisibility() end, flickerstreak@2: order = 11, flickerstreak@1: }, flickerstreak@1: ]] flickerstreak@1: flickerstreak@1: opacity = { flickerstreak@1: type = "range", flickerstreak@1: name = "Opacity", flickerstreak@1: desc = "Set bar opacity", flickerstreak@1: get = function() return bar:GetOpacity() end, flickerstreak@1: set = function(o) bar:SetOpacity(o) end, flickerstreak@1: min = 0, flickerstreak@1: max = 100, flickerstreak@1: step = 1, flickerstreak@2: order = 12 flickerstreak@1: }, flickerstreak@1: flickerstreak@1: delete = { flickerstreak@1: type = "execute", flickerstreak@1: name = "Delete Bar", flickerstreak@1: desc = "Deletes the bar", flickerstreak@1: func = function() ReAction:DeleteBar(bar.barID) end, flickerstreak@2: order = 13, flickerstreak@1: }, flickerstreak@1: } flickerstreak@1: } flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: local function setButtonConfig( bar, field, value ) flickerstreak@1: if bar and bar.config and bar.config.btnConfig then flickerstreak@1: bar.config.btnConfig[field] = value flickerstreak@1: for _, b in ipairs(bar.buttons) do flickerstreak@1: b:ApplyLayout() flickerstreak@1: b:UpdateDisplay() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: local function getButtonConfig( bar, field ) flickerstreak@2: if bar and bar.config and bar.config.btnConfig then flickerstreak@1: return bar.config.btnConfig[field] flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: local function toggleButtonConfig( bar, field ) flickerstreak@1: if bar and bar.config and bar.config.btnConfig then flickerstreak@1: bar.config.btnConfig[field] = not bar.config.btnConfig[field] flickerstreak@1: for _, b in ipairs(bar.buttons) do flickerstreak@1: b:ApplyLayout() flickerstreak@1: b:UpdateDisplay() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: function GenerateReActionButtonOptions( bar ) flickerstreak@1: return { flickerstreak@1: type = "group", flickerstreak@1: args = { flickerstreak@1: flickerstreak@1: sep2 = { flickerstreak@1: type = "header", flickerstreak@1: name = " ", flickerstreak@1: desc = " ", flickerstreak@2: order = 14, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: hdr2 = { flickerstreak@1: type = "header", flickerstreak@1: name = "Button Options", flickerstreak@1: desc = "Button Options", flickerstreak@2: order = 15, flickerstreak@2: }, flickerstreak@2: flickerstreak@2: showgrid = { flickerstreak@2: type = "toggle", flickerstreak@2: name = "Always Show Buttons", flickerstreak@2: desc = "Show button placeholders when no action is assigned or on the cursor. Note that buttons are always shown when bars are unlocked.", flickerstreak@2: get = function() return getButtonConfig(bar, "showGrid") end, flickerstreak@2: set = function() toggleButtonConfig(bar, "showGrid") end, flickerstreak@2: order = 16, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: colorkeys = { flickerstreak@1: type = "toggle", flickerstreak@1: name = "Color Hotkeys", flickerstreak@1: desc = "Enables/disables colorizing hotkeys by key modifier", flickerstreak@1: get = function() return getButtonConfig(bar, "keyBindColorCode") end, flickerstreak@1: set = function() toggleButtonConfig(bar, "keyBindColorCode", c) end, flickerstreak@2: order = 17, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: keyloc = { flickerstreak@1: type = "text", flickerstreak@1: name = "Hotkey Location", flickerstreak@1: desc = "Sets hotkey location", flickerstreak@1: get = function() return getButtonConfig(bar, "keyBindLoc") end, flickerstreak@1: set = function(loc) setButtonConfig(bar, "keyBindLoc", loc) end, flickerstreak@1: validate = { "TOP", "BOTTOM", "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT" }, flickerstreak@2: order = 18, flickerstreak@1: }, flickerstreak@1: flickerstreak@1: } flickerstreak@1: } flickerstreak@1: end flickerstreak@1: flickerstreak@1: