Skip to content

Commit c86fa73

Browse files
committed
Minor cleanup, adding proper support for /cancelmacro and [channeling] with or without a spell specified (closes #34)
1 parent 7775ff8 commit c86fa73

File tree

5 files changed

+191
-161
lines changed

5 files changed

+191
-161
lines changed

MacroToolkit/locales/enUS.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
local L = LibStub("AceLocale-3.0"):NewLocale("MacroToolkit", "enUS", true)
2-
local _G = _G
32

43
if not L then return end
54

@@ -193,6 +192,8 @@ L["noexists"] = "does not exist"
193192
L["extrabar"] = "extra bar"
194193
L["flyable"] = true
195194
L["noflyable"] = "not flyable"
195+
L["advflyable"] = "advflyable (dragonriding)"
196+
L["noadvflyable"] = "not advflyable (dragonriding)"
196197
L["flying"] = true
197198
L["noflying"] = "not flying"
198199
L["form"] = "form/stance"

MacroToolkit/modules/builderframe.lua

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--- @type MacroToolkit
12
local MT = MacroToolkit
23
local L = MT.L
34
local AceGUI = MT.LS("AceGUI-3.0")
@@ -159,8 +160,8 @@ function MT:CreateBuilderFrame()
159160
realkey = string.sub(key, 3)
160161
negate = true
161162
end
162-
local ctype = negate and 0 or (MT.conditions[realkey] or 0)
163-
if ctype == 1 then
163+
local ctype = negate and MT.CONDITION_TYPE_NONE or (MT.conditions[realkey] or MT.CONDITION_TYPE_NONE)
164+
if ctype == MT.CONDITION_TYPE_NUMERIC then
164165
ddvals.zero = ""
165166
local cap = 7
166167
if realkey == "spec" then cap = 4 end
@@ -169,32 +170,34 @@ function MT:CreateBuilderFrame()
169170
pdd.frame:Show()
170171
eb.frame:Hide()
171172
ed.frame:Hide()
172-
elseif ctype == 2 or ctype == 3 or ctype == 8 then
173+
elseif ctype == MT.CONDITION_TYPE_TEXTUAL
174+
or ctype == MT.CONDITION_TYPE_ALPHANUMERIC
175+
or ctype == MT.CONDITION_TYPE_ALPHANUMERIC_WITH_SPACES then
173176
pdd.frame:Hide()
174177
eb.frame:Show()
175178
ed.frame:Hide()
176-
elseif ctype == 4 then
179+
elseif ctype == MT.CONDITION_TYPE_PARTY_RAID then
177180
local b = {"zero","party","raid"}
178181
for _, bt in ipairs(b) do ddvals[bt] = L[bt] end
179182
pdd:SetList(ddvals, b)
180183
pdd.frame:Show()
181184
eb.frame:Hide()
182185
ed.frame:Hide()
183-
elseif ctype == 5 then
186+
elseif ctype == MT.CONDITION_TYPE_MOD_KEYS then
184187
local b = {"zero","alt","shift","ctrl"}
185188
for _, bt in ipairs(b) do ddvals[bt] = L[bt] end
186189
pdd:SetList(ddvals, b)
187190
pdd.frame:Show()
188191
eb.frame:Hide()
189192
ed.frame:Hide()
190-
elseif ctype == 6 then
193+
elseif ctype == MT.CONDITION_TYPE_MOUSEBUTTONS then
191194
local b = {"zero","LeftButton","MiddleButton","RightButton","Button4","Button5"}
192195
for _, bt in ipairs(b) do ddvals[bt] = L[bt] end
193196
pdd:SetList(ddvals, b)
194197
pdd.frame:Show()
195198
eb.frame:Hide()
196199
ed.frame:Hide()
197-
elseif ctype == 7 then
200+
elseif ctype == MT.CONDITION_TYPE_NUMERIC_WITH_SLASH then
198201
ddvals.zero = ""
199202
for n = 1, 7 do ddvals[tostring(n)] = n end
200203
pdd:SetList(ddvals)

0 commit comments

Comments
 (0)