comparison 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
comparison
equal deleted inserted replaced
7:f920db5fc6b1 8:c05fd3e18b4f
36 keyBindLoc = "TOPRIGHT", 36 keyBindLoc = "TOPRIGHT",
37 stackCountLoc = "BOTTOMRIGHT", 37 stackCountLoc = "BOTTOMRIGHT",
38 showKeyBind = true, 38 showKeyBind = true,
39 showStackCount = true, 39 showStackCount = true,
40 showMacroText = true, 40 showMacroText = true,
41 showGrid = false,
42 showBorder = true, 41 showBorder = true,
43 keyBindColorCode = false, 42 keyBindColorCode = false,
43 hideCooldown = false,
44 hideGlobalCooldown = false,
44 } 45 }
45 46
46 PetAction.defaultProfile = { 47 PetAction.defaultProfile = {
47 type = "ReAction", 48 type = "ReAction",
48 subtype = "Pet Action", 49 subtype = "Pet Action",
87 for _, b in pairs(buttonListFunc()) do 88 for _, b in pairs(buttonListFunc()) do
88 b:UpdateAction() 89 b:UpdateAction()
89 b:UpdateTooltip() 90 b:UpdateTooltip()
90 b:UpdateDisplay() 91 b:UpdateDisplay()
91 end 92 end
93 end
94
95 local function setOpacity(field, value)
96 if not config.opacity then
97 config.opacity = { }
98 end
99 config.opacity[field] = (value and value / 100)
100 refresh()
101 end
102
103 local function getOpacity(field, default)
104 local o = config.opacity and config.opacity[field] or (default and default/100) or 1
105 return o * 100
92 end 106 end
93 107
94 return { 108 return {
95 type = "group", 109 type = "group",
96 args = { 110 args = {
109 end 123 end
110 end, 124 end,
111 validate = { "default", "none", "alt", "ctrl", "shift", "right-click" }, 125 validate = { "default", "none", "alt", "ctrl", "shift", "right-click" },
112 }, 126 },
113 127
128 opacity = {
129 type = "group",
130 name = "Opacity",
131 desc = "Set options for variable button opacity",
132 args = {
133 usable = {
134 type = "range",
135 name = "Usable",
136 desc = "Button opacity when the action is currently usable",
137 min = 0,
138 max = 100,
139 step = 1,
140 get = function() return getOpacity("usable") end,
141 set = function(x) setOpacity("usable", x) end,
142 order = 1,
143 },
144
145 notUsable = {
146 type = "range",
147 name = "Not Usable",
148 desc = "Button opacity when the action is currently not usable",
149 min = 0,
150 max = 100,
151 step = 1,
152 get = function() return getOpacity("notUsable") end,
153 set = function(x) setOpacity("notUsable",x) end,
154 order = 2,
155 },
156
157 oom = {
158 type = "range",
159 name = "Out of Power",
160 desc = "Button opacity when the action is not usable due to not enough mana/energy/rage. "..
161 "By default this uses the generic 'not-usable' setting.",
162 min = 0,
163 max = 100,
164 step = 1,
165 get = function() return getOpacity("oom",getOpacity("notUsable")) end,
166 set = function(x) setOpacity("oom", x ~= getOpacity("notUsable") and x) end,
167 order = 3,
168 },
169
170 oorange = {
171 type = "range",
172 name = "Out of Range",
173 desc = "Button opacity when the action is not usable due to the target not being in range. "..
174 "By default this uses the generic 'not-usable' setting.",
175 min = 0,
176 max = 100,
177 step = 1,
178 get = function() return getOpacity("ooRange",getOpacity("notUsable")) end,
179 set = function(x) setOpacity("ooRange", x ~= getOpacity("notUsable") and x) end,
180 order = 4,
181 },
182
183 empty = {
184 type = "range",
185 name = "Empty Slot",
186 desc = "Button opacity when the button's action slot is empty. By default this is 0 (fully transparent), "..
187 "but note that they still block mouse clicks. Empty slots are automatically made opaque (per the "..
188 "'usable' opacity setting) when moving actions around.",
189 min = 0,
190 max = 100,
191 step = 1,
192 get = function() return getOpacity("empty",0) end,
193 set = function(x) setOpacity("empty",x) end,
194 order = 5,
195 },
196
197 hideEmpty = {
198 type = "toggle",
199 name = "Hide Empty Slots",
200 desc = "Hides empty action slots rather than changing their opacity. This has the advantage that empty slots "..
201 "don't block mouse clicks. WARNING: this makes it impossible to re-arrange actions with drag-and-drop "..
202 "while in combat.",
203 get = function() return config.hideEmptySlots end,
204 set = function() config.hideEmptySlots = not config.hideEmptySlots ; refresh() end,
205 order = 6,
206 },
207
208 },
209 },
210
114 keyloc = { 211 keyloc = {
115 type = "text", 212 type = "text",
116 name = "Hotkey Location", 213 name = "Hotkey Location",
117 desc = "Sets hotkey location", 214 desc = "Sets hotkey location",
118 get = function() return config.keyBindLoc end, 215 get = function() return config.keyBindLoc end,
151 desc = "Toggle show/hide macro name labels", 248 desc = "Toggle show/hide macro name labels",
152 get = function() return config.showMacroText end, 249 get = function() return config.showMacroText end,
153 set = function() config.showMacroText = not config.showMacroText ; refresh() end, 250 set = function() config.showMacroText = not config.showMacroText ; refresh() end,
154 }, 251 },
155 252
156 showgrid = { 253 hidecooldown = {
157 type = "toggle", 254 type = "toggle",
158 name = "Always Show Buttons", 255 name = "Hide Cooldowns",
159 desc = "Show button placeholders when no action is assigned or on the cursor. Note that buttons are always shown when bars are unlocked.", 256 desc = "Hides all cooldown displays on buttons. Toggling this on does not hide currently running cooldowns.",
160 get = function() return config.showGrid end, 257 get = function() return config.hideCooldown end,
161 set = function() config.showGrid = not config.showGrid ; refresh() end, 258 set = function() config.hideCooldown = not config.hideCooldown ; refresh() end,
259 },
260
261 hideglobalcooldown = {
262 type = "toggle",
263 name = "Hide Global Cooldown",
264 desc = "Disables the global cooldown from being displayed on buttons.",
265 get = function() return config.hideGlobalCooldown end,
266 set = function() config.hideGlobalCooldown = not config.hideGlobalCooldown ; refresh() end,
162 }, 267 },
163 268
164 colorhotkeys = { 269 colorhotkeys = {
165 type = "toggle", 270 type = "toggle",
166 name = "Colorize Hotkeys", 271 name = "Colorize Hotkeys",