Mercurial > wow > reaction
diff Buttons.lua @ 8:c05fd3e18b4f
Version 0.31
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Tue, 20 Mar 2007 21:33:59 +0000 |
parents | f920db5fc6b1 |
children | f3a7bfebc283 |
line wrap: on
line diff
--- a/Buttons.lua Tue Mar 20 21:25:29 2007 +0000 +++ b/Buttons.lua Tue Mar 20 21:33:59 2007 +0000 @@ -38,9 +38,10 @@ showKeyBind = true, showStackCount = true, showMacroText = true, - showGrid = false, showBorder = true, keyBindColorCode = false, + hideCooldown = false, + hideGlobalCooldown = false, } PetAction.defaultProfile = { @@ -91,6 +92,19 @@ end end + local function setOpacity(field, value) + if not config.opacity then + config.opacity = { } + end + config.opacity[field] = (value and value / 100) + refresh() + end + + local function getOpacity(field, default) + local o = config.opacity and config.opacity[field] or (default and default/100) or 1 + return o * 100 + end + return { type = "group", args = { @@ -111,6 +125,89 @@ validate = { "default", "none", "alt", "ctrl", "shift", "right-click" }, }, + opacity = { + type = "group", + name = "Opacity", + desc = "Set options for variable button opacity", + args = { + usable = { + type = "range", + name = "Usable", + desc = "Button opacity when the action is currently usable", + min = 0, + max = 100, + step = 1, + get = function() return getOpacity("usable") end, + set = function(x) setOpacity("usable", x) end, + order = 1, + }, + + notUsable = { + type = "range", + name = "Not Usable", + desc = "Button opacity when the action is currently not usable", + min = 0, + max = 100, + step = 1, + get = function() return getOpacity("notUsable") end, + set = function(x) setOpacity("notUsable",x) end, + order = 2, + }, + + oom = { + type = "range", + name = "Out of Power", + desc = "Button opacity when the action is not usable due to not enough mana/energy/rage. ".. + "By default this uses the generic 'not-usable' setting.", + min = 0, + max = 100, + step = 1, + get = function() return getOpacity("oom",getOpacity("notUsable")) end, + set = function(x) setOpacity("oom", x ~= getOpacity("notUsable") and x) end, + order = 3, + }, + + oorange = { + type = "range", + name = "Out of Range", + desc = "Button opacity when the action is not usable due to the target not being in range. ".. + "By default this uses the generic 'not-usable' setting.", + min = 0, + max = 100, + step = 1, + get = function() return getOpacity("ooRange",getOpacity("notUsable")) end, + set = function(x) setOpacity("ooRange", x ~= getOpacity("notUsable") and x) end, + order = 4, + }, + + empty = { + type = "range", + name = "Empty Slot", + desc = "Button opacity when the button's action slot is empty. By default this is 0 (fully transparent), ".. + "but note that they still block mouse clicks. Empty slots are automatically made opaque (per the ".. + "'usable' opacity setting) when moving actions around.", + min = 0, + max = 100, + step = 1, + get = function() return getOpacity("empty",0) end, + set = function(x) setOpacity("empty",x) end, + order = 5, + }, + + hideEmpty = { + type = "toggle", + name = "Hide Empty Slots", + desc = "Hides empty action slots rather than changing their opacity. This has the advantage that empty slots ".. + "don't block mouse clicks. WARNING: this makes it impossible to re-arrange actions with drag-and-drop ".. + "while in combat.", + get = function() return config.hideEmptySlots end, + set = function() config.hideEmptySlots = not config.hideEmptySlots ; refresh() end, + order = 6, + }, + + }, + }, + keyloc = { type = "text", name = "Hotkey Location", @@ -153,12 +250,20 @@ set = function() config.showMacroText = not config.showMacroText ; refresh() end, }, - showgrid = { + hidecooldown = { type = "toggle", - name = "Always Show Buttons", - desc = "Show button placeholders when no action is assigned or on the cursor. Note that buttons are always shown when bars are unlocked.", - get = function() return config.showGrid end, - set = function() config.showGrid = not config.showGrid ; refresh() end, + name = "Hide Cooldowns", + desc = "Hides all cooldown displays on buttons. Toggling this on does not hide currently running cooldowns.", + get = function() return config.hideCooldown end, + set = function() config.hideCooldown = not config.hideCooldown ; refresh() end, + }, + + hideglobalcooldown = { + type = "toggle", + name = "Hide Global Cooldown", + desc = "Disables the global cooldown from being displayed on buttons.", + get = function() return config.hideGlobalCooldown end, + set = function() config.hideGlobalCooldown = not config.hideGlobalCooldown ; refresh() end, }, colorhotkeys = {