Mercurial > wow > reaction
diff Options.lua @ 1:c11ca1d8ed91
Version 0.1
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Tue, 20 Mar 2007 21:03:57 +0000 |
parents | |
children | 8e0ff8ae4c08 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Options.lua Tue Mar 20 21:03:57 2007 +0000 @@ -0,0 +1,255 @@ +-- Ace2 Options table for ReAction + +ReActionConsoleOptions = { + type="group", + args={ + lock = { + type = "execute", + name = "lock", + desc = "Locks action bars and disables rearrangement", + func = "Lock", + }, + + unlock = { + type = "execute", + name = "unlock", + desc = "Unlocks action bars and enables rearrangement", + func = "Unlock", + }, + + hideart = { + type = "toggle", + name = "hideart", + desc = "Hide default Blizzard action bar artwork and XP bar", + get = "IsArtHidden", + set = "ToggleHideArt", + }, + + new = { + type = "execute", + name = "new", + desc = "Create a new bar with default settings", + func = "NewBar" + }, + + showid = { + type = "toggle", + name = "showid", + desc = "Show ActionIDs on buttons", + get = "IsActionIDVisible", + set = "ToggleActionID", + }, + + reset = { + type = "execute", + name = "reset", + desc = "Resets to single bar in the default position", + func = "ResetBars" + }, + + --[[ + resync = { + type = "execute", + name = "resync", + desc = "Re-orders action IDs sequentially amongst bars", + func = "ResyncActionIDs" + }, + ]] + } +} + + +ReActionGlobalMenuOptions = { + type="group", + args={ + lock = { + type = "toggle", + name = "Locked", + desc = "Locks action bars and disables rearrangement", + get = function() return ReAction:IsLocked() end, + set = function() ReAction:ToggleLocked() end, + order = 2, + }, + + new = { + type = "execute", + name = "New Bar", + desc = "Create a new bar with default settings", + func = function() ReAction:NewBar() end, + order = 3 + }, + + showid = { + type = "toggle", + name = "Show Action IDs", + desc = "Show ActionIDs on buttons", + get = function() return ReAction:IsActionIDVisible() end, + set = function() ReAction:ToggleActionID() end, + order = 4 + }, + + --[[ + resync = { + type = "execute", + name = "Re-sync Action IDs", + desc = "Re-orders action IDs sequentially amongst bars", + func = function() ReAction:ResyncActionIDs() end, + order = 5, + }, + ]] + + hideart = { + type = "toggle", + name = "Hide Default Art", + desc = "Hide default Blizzard action bar artwork and XP bar", + get = function() return ReAction:IsArtHidden() end, + set = function() return ReAction:ToggleHideArt() end, + order = 6, + }, + + reset = { + type = "execute", + name = "Reset Bars", + desc = "Resets to single bar in the default position", + func = function() ReAction:ResetBars() end, + order = 7 + }, + + } +} + + +function GenerateReActionBarOptions( bar ) + return { + type = "group", + args = { + + sep1 = { + type = "header", + name = " ", + desc = " ", + order = 8, + }, + + hdr1 = { + type = "header", + name = "Bar Options", + des = "Bar Options", + order = 9, + }, + + --[[ + hidden = { + type = "toggle", + name = "Hidden", + desc = "Hides the bar except when rearranging bars", + get = function() return not bar:GetVisibility() end, + set = function() bar:ToggleVisibility() end, + order = 10, + }, + ]] + + opacity = { + type = "range", + name = "Opacity", + desc = "Set bar opacity", + get = function() return bar:GetOpacity() end, + set = function(o) bar:SetOpacity(o) end, + min = 0, + max = 100, + step = 1, + order = 11 + }, + + delete = { + type = "execute", + name = "Delete Bar", + desc = "Deletes the bar", + func = function() ReAction:DeleteBar(bar.barID) end, + order = 12, + }, + } + } +end + + +local function setButtonConfig( bar, field, value ) + if bar and bar.config and bar.config.btnConfig then + bar.config.btnConfig[field] = value + for _, b in ipairs(bar.buttons) do + b:ApplyLayout() + b:UpdateDisplay() + end + end +end + +local function getButtonConfig( bar, field ) + if bar and config and btnConfig then + return bar.config.btnConfig[field] + end +end + +local function toggleButtonConfig( bar, field ) + if bar and bar.config and bar.config.btnConfig then + bar.config.btnConfig[field] = not bar.config.btnConfig[field] + for _, b in ipairs(bar.buttons) do + b:ApplyLayout() + b:UpdateDisplay() + end + end +end + + +function GenerateReActionButtonOptions( bar ) + return { + type = "group", + args = { + + sep2 = { + type = "header", + name = " ", + desc = " ", + order = 13, + }, + + hdr2 = { + type = "header", + name = "Button Options", + desc = "Button Options", + order = 14, + }, + + colorkeys = { + type = "toggle", + name = "Color Hotkeys", + desc = "Enables/disables colorizing hotkeys by key modifier", + get = function() return getButtonConfig(bar, "keyBindColorCode") end, + set = function() toggleButtonConfig(bar, "keyBindColorCode", c) end, + order = 15, + }, + + keyloc = { + type = "text", + name = "Hotkey Location", + desc = "Sets hotkey location", + get = function() return getButtonConfig(bar, "keyBindLoc") end, + set = function(loc) setButtonConfig(bar, "keyBindLoc", loc) end, + validate = { "TOP", "BOTTOM", "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT" }, + order = 16, + }, + + sep3 = { + type = "header", + name = " ", + desc = " ", + order = 17 + }, + } + } +end + + +ReActionProfileMenuOptions = { + type = "group", + args = { } +}