Skip to content

Commit 6b2f6e1

Browse files
committed
let spells be added from the spellbook into the input line for range and style filter auras
1 parent 821a73e commit 6b2f6e1

File tree

6 files changed

+30
-13
lines changed

6 files changed

+30
-13
lines changed

ElvUI_Libraries/Core/Ace3-ElvUI/AceGUIWidget-EditBox-ElvUI.lua

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--[[-----------------------------------------------------------------------------
22
EditBox Widget
33
-------------------------------------------------------------------------------]]
4-
local Type, Version = "EditBox-ElvUI", 30
4+
local Type, Version = "EditBox-ElvUI", 31
55
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
66
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
77

@@ -93,19 +93,21 @@ local function EditBox_OnEnterPressed(frame)
9393
end
9494

9595
local function EditBox_OnReceiveDrag(frame)
96-
local self = frame.obj
97-
local type, id, info = GetCursorInfo()
98-
local name
96+
local self, name = frame.obj
97+
local type, id, info, spellID = GetCursorInfo()
98+
9999
if type == "item" then
100100
name = info
101101
elseif type == "spell" then
102-
name = GetSpellInfo(id, info)
102+
name = GetSpellInfo(spellID, info)
103103
elseif type == "macro" then
104104
name = GetMacroInfo(id)
105105
end
106+
106107
if name then
107-
self:SetText(name)
108-
self:Fire("OnEnterPressed", name)
108+
local text = (self.preferSpellID and spellID and tostring(spellID)) or name
109+
self:SetText(text)
110+
self:Fire("OnEnterPressed", text)
109111
ClearCursor()
110112
HideButton(self)
111113
AceGUI:ClearFocus()

ElvUI_Libraries/Core/Ace3-ElvUI/AceGUIWidget-MultiLineEditBox-ElvUI.lua

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--[[-----------------------------------------------------------------------------
22
MultiLineEditBox Widget (Modified to add Syntax highlighting from FAIAP)
33
-------------------------------------------------------------------------------]]
4-
local Type, Version = "MultiLineEditBox-ElvUI", 34
4+
local Type, Version = "MultiLineEditBox-ElvUI", 35
55
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
66
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
77

@@ -116,20 +116,24 @@ local function OnMouseUp(self)
116116
end
117117

118118
local function OnReceiveDrag(self) -- EditBox / ScrollFrame
119-
local type, id, info = GetCursorInfo()
119+
local type, _, info, spellID = GetCursorInfo()
120120
if type == "spell" then
121-
info = GetSpellInfo(id, info)
121+
info = GetSpellInfo(spellID, info)
122122
elseif type ~= "item" then
123123
return
124124
end
125+
125126
ClearCursor()
126127
self = self.obj
128+
127129
local editBox = self.editBox
128130
if not editBox:HasFocus() then
129131
editBox:SetFocus()
130132
editBox:SetCursorPosition(editBox:GetNumLetters())
131133
end
132-
editBox:Insert(info)
134+
135+
local text = (self.preferSpellID and spellID and tostring(spellID)) or info
136+
editBox:Insert(text)
133137
self.button:Enable()
134138
end
135139

ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local LibStub = LibStub
77
local gui = LibStub("AceGUI-3.0")
88
local reg = LibStub("AceConfigRegistry-3.0-ElvUI")
99

10-
local MAJOR, MINOR = "AceConfigDialog-3.0-ElvUI", 90 -- based off 87
10+
local MAJOR, MINOR = "AceConfigDialog-3.0-ElvUI", 91 -- based off 87
1111
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
1212

1313
if not AceConfigDialog then return end
@@ -1237,6 +1237,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
12371237
control:DisableButton(true)
12381238
end
12391239

1240+
control.preferSpellID = v.preferSpellID
12401241
control.textChanged = v.textChanged
12411242
control.focusSelect = v.focusSelect
12421243
-- End ElvUI block

ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-- @release $Id$
1212
local CallbackHandler = LibStub("CallbackHandler-1.0")
1313

14-
local MAJOR, MINOR = "AceConfigRegistry-3.0-ElvUI", 24
14+
local MAJOR, MINOR = "AceConfigRegistry-3.0-ElvUI", 25
1515
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
1616

1717
if not AceConfigRegistry then return end
@@ -153,6 +153,7 @@ local typedkeys={
153153
multiline=optboolnumber,
154154
luaSyntax=optbool, --ElvUI
155155
disableButton=optbool, --ElvUI
156+
preferSpellID=optbool, -- ElvUI
156157
focusSelect=optbool, --ElvUI
157158
textChanged=optfunc, --ElvUI
158159
},

ElvUI_Options/Core/StyleFilters.lua

+5
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ StyleFilters.triggers.args.casting.args.removeSpell = ACH:Select(L["Remove Spell
252252
StyleFilters.triggers.args.casting.args.notSpell = ACH:Toggle(L["Not Spell"], L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."], 4)
253253
StyleFilters.triggers.args.casting.args.description1 = ACH:Description(L["You do not need to use Is Casting Anything or Is Channeling Anything for these spells to trigger."], 10)
254254
StyleFilters.triggers.args.casting.args.description2 = ACH:Description(L["If this list is empty, and if Interruptible is checked, then the filter will activate on any type of cast that can be interrupted."], 11)
255+
StyleFilters.triggers.args.casting.args.addSpell.preferSpellID = true
255256

256257
StyleFilters.triggers.args.casting.args.spells = ACH:Group('', nil, 50, nil, function(info) local triggers = GetFilter(true) return triggers.casting.spells and triggers.casting.spells[info[#info]] end, function(info, value) local triggers = GetFilter(true) if not triggers.casting.spells then triggers.casting.spells = {} end triggers.casting.spells[info[#info]] = value NP:ConfigureAll() end, nil, true)
257258
StyleFilters.triggers.args.casting.args.spells.inline = true
@@ -264,6 +265,7 @@ StyleFilters.triggers.args.known.args.types.args.playerSpell = ACH:Toggle(L["Pla
264265

265266
StyleFilters.triggers.args.known.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 2, nil, nil, nil, function(_, value) local triggers = GetFilter(true) triggers.known.spells[value] = true UpdateFilterList('known', nil, value, true) NP:ConfigureAll() end, nil, nil, validateString)
266267
StyleFilters.triggers.args.known.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 3, function() local triggers, values = GetFilter(true), {} for spell in next, triggers.known.spells do values[spell] = spell end return values end, nil, nil, nil, function(_, value) local triggers = GetFilter(true) triggers.known.spells[value] = nil UpdateFilterList('known', nil, value) NP:ConfigureAll() end)
268+
StyleFilters.triggers.args.known.args.addSpell.preferSpellID = true
267269

268270
StyleFilters.triggers.args.known.args.spells = ACH:Group('', nil, 50, nil, function(info) local triggers = GetFilter(true) return triggers.known.spells and triggers.known.spells[info[#info]] end, function(info, value) local triggers = GetFilter(true) if not triggers.known.spells then triggers.known.spells = {} end triggers.known.spells[info[#info]] = value NP:ConfigureAll() end, nil, true)
269271
StyleFilters.triggers.args.known.args.spells.inline = true
@@ -480,6 +482,7 @@ do
480482
option.changeList.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 1, nil, nil, nil, function(_, value) if stackThreshold then value = value .. '\n' .. stackThreshold end local triggers = GetFilter(true) triggers[auraType].names[value] = true stackThreshold = nil UpdateFilterList(auraType, nil, value, true) NP:ConfigureAll() end, nil, nil, validateString)
481483
option.changeList.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 2, function() local triggers, values = GetFilter(true), {} for name in pairs(triggers[auraType].names) do values[name] = format('%s (%d)', strsplit('\n', name)) end return values end, nil, nil, nil, function(_, value) local triggers = GetFilter(true) triggers[auraType].names[value] = nil UpdateFilterList(auraType, nil, value) end)
482484
option.changeList.args.stackThreshold = ACH:Range(L["Stack Threshold"], L["Allows you to tie a stack count to an aura when you add it to the list, which allows the trigger to act when an aura reaches X number of stacks."], 3, { min = 1, max = 250, softMax = 100, step = 1 }, nil, function() return stackThreshold or 1 end, function(_, value) stackThreshold = (value > 1 and value) or nil end)
485+
option.changeList.args.addSpell.preferSpellID = true
483486

484487
option.names = ACH:Group('', nil, 50, nil, function(info) local triggers = GetFilter(true) return triggers[auraType].names and triggers[auraType].names[info[#info]] end, function(info, value) local triggers = GetFilter(true) triggers[auraType].names[info[#info]] = value NP:ConfigureAll() end, nil, true)
485488
option.names.inline = true
@@ -495,6 +498,8 @@ StyleFilters.triggers.args.cooldowns = ACH:Group(L["Cooldowns"], nil, 23, nil, n
495498
StyleFilters.triggers.args.cooldowns.args.addCooldown = ACH:Input(L["Add Spell ID or Name"], nil, 1, nil, nil, nil, function(_, value) local triggers = GetFilter(true) triggers.cooldowns.names[value] = 'ONCD' UpdateFilterList('cooldowns', nil, value, true) NP:ConfigureAll() end, nil, nil, validateString)
496499
StyleFilters.triggers.args.cooldowns.args.removeCooldown = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 2, function() local values = {} local triggers = GetFilter(true) for item in next, triggers.cooldowns.names do values[item] = item end return values end, nil, nil, nil, function(_, value) local triggers = GetFilter(true) triggers.cooldowns.names[value] = nil UpdateFilterList('cooldowns', nil, value) NP:ConfigureAll() end)
497500
StyleFilters.triggers.args.cooldowns.args.mustHaveAll = ACH:Toggle(L["Require All"], L["If enabled then it will require all cooldowns to activate the filter. Otherwise it will only require any one of the cooldowns to activate it."], 3, nil, nil, nil, function() local triggers = GetFilter(true) return triggers.cooldowns and triggers.cooldowns.mustHaveAll end, function(_, value) local triggers = GetFilter(true) triggers.cooldowns.mustHaveAll = value NP:ConfigureAll() end, DisabledFilter)
501+
StyleFilters.triggers.args.cooldowns.args.addCooldown.preferSpellID = true
502+
498503
StyleFilters.triggers.args.cooldowns.args.names = ACH:Group('', nil, 50, nil, function(info) local triggers = GetFilter(true) return triggers.cooldowns.names and triggers.cooldowns.names[info[#info]] end, function(info, value) local triggers = GetFilter(true) triggers.cooldowns.names[info[#info]] = value NP:ConfigureAll() end)
499504
StyleFilters.triggers.args.cooldowns.args.names.inline = true
500505

ElvUI_Options/Core/UnitFrames.lua

+4
Original file line numberDiff line numberDiff line change
@@ -1451,27 +1451,31 @@ UnitFrame.rangeGroup.args.rangeReset = ACH:Execute(L["Reset Spells"], nil, 4, fu
14511451
UnitFrame.rangeGroup.args.rangeEnemy = ACH:Group(L["Enemy Spells"], nil, 10)
14521452
UnitFrame.rangeGroup.args.rangeEnemy.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 2, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.ENEMY[E.myclass] list[value] = true UpdateRangeList(UnitFrame.rangeGroup.args.rangeEnemy, list, value, true) end)
14531453
UnitFrame.rangeGroup.args.rangeEnemy.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 3, function() local values, list = {}, E.global.unitframe.rangeCheck.ENEMY[E.myclass] for spell in next, list do values[spell] = spell end return values end, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.ENEMY[E.myclass] list[value] = nil UpdateRangeList(UnitFrame.rangeGroup.args.rangeEnemy, list, value) end)
1454+
UnitFrame.rangeGroup.args.rangeEnemy.args.addSpell.preferSpellID = true
14541455

14551456
UnitFrame.rangeGroup.args.rangeEnemy.args.spells = ACH:Group('', nil, 11, nil, function(info) local list = E.global.unitframe.rangeCheck.ENEMY[E.myclass] local value = info[#info] return list[value] end, function(info, value) local list = E.global.unitframe.rangeCheck.ENEMY[E.myclass] list[info[#info]] = value UF:UpdateRangeSpells() end, nil, true)
14561457
UnitFrame.rangeGroup.args.rangeEnemy.args.spells.inline = true
14571458

14581459
UnitFrame.rangeGroup.args.rangeFriendly = ACH:Group(L["Friendly Spells"], nil, 20)
14591460
UnitFrame.rangeGroup.args.rangeFriendly.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 2, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.FRIENDLY[E.myclass] list[value] = true UpdateRangeList(UnitFrame.rangeGroup.args.rangeFriendly, list, value, true) end)
14601461
UnitFrame.rangeGroup.args.rangeFriendly.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 3, function() local values, list = {}, E.global.unitframe.rangeCheck.FRIENDLY[E.myclass] for spell in next, list do values[spell] = spell end return values end, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.FRIENDLY[E.myclass] list[value] = nil UpdateRangeList(UnitFrame.rangeGroup.args.rangeFriendly, list, value) end)
1462+
UnitFrame.rangeGroup.args.rangeFriendly.args.addSpell.preferSpellID = true
14611463

14621464
UnitFrame.rangeGroup.args.rangeFriendly.args.spells = ACH:Group('', nil, 11, nil, function(info) local list = E.global.unitframe.rangeCheck.FRIENDLY[E.myclass] local value = info[#info] return list[value] end, function(info, value) local list = E.global.unitframe.rangeCheck.FRIENDLY[E.myclass] list[info[#info]] = value UF:UpdateRangeSpells() end, nil, true)
14631465
UnitFrame.rangeGroup.args.rangeFriendly.args.spells.inline = true
14641466

14651467
UnitFrame.rangeGroup.args.rangeResurrect = ACH:Group(L["Resurrect Spells"], nil, 30)
14661468
UnitFrame.rangeGroup.args.rangeResurrect.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 2, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.RESURRECT[E.myclass] list[value] = true UpdateRangeList(UnitFrame.rangeGroup.args.rangeResurrect, list, value, true) end)
14671469
UnitFrame.rangeGroup.args.rangeResurrect.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 3, function() local values, list = {}, E.global.unitframe.rangeCheck.RESURRECT[E.myclass] for spell in next, list do values[spell] = spell end return values end, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.RESURRECT[E.myclass] list[value] = nil UpdateRangeList(UnitFrame.rangeGroup.args.rangeResurrect, list, value) end)
1470+
UnitFrame.rangeGroup.args.rangeResurrect.args.addSpell.preferSpellID = true
14681471

14691472
UnitFrame.rangeGroup.args.rangeResurrect.args.spells = ACH:Group('', nil, 11, nil, function(info) local list = E.global.unitframe.rangeCheck.RESURRECT[E.myclass] local value = info[#info] return list[value] end, function(info, value) local list = E.global.unitframe.rangeCheck.RESURRECT[E.myclass] list[info[#info]] = value UF:UpdateRangeSpells() end, nil, true)
14701473
UnitFrame.rangeGroup.args.rangeResurrect.args.spells.inline = true
14711474

14721475
UnitFrame.rangeGroup.args.rangePet = ACH:Group(L["Pet Spells"], nil, 40)
14731476
UnitFrame.rangeGroup.args.rangePet.args.addSpell = ACH:Input(L["Add Spell ID or Name"], nil, 2, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.PET[E.myclass] list[value] = true UpdateRangeList(UnitFrame.rangeGroup.args.rangePet, list, value, true) end)
14741477
UnitFrame.rangeGroup.args.rangePet.args.removeSpell = ACH:Select(L["Remove Spell ID or Name"], L["If the aura is listed with a number then you need to use that to remove it from the list."], 3, function() local values, list = {}, E.global.unitframe.rangeCheck.PET[E.myclass] for spell in next, list do values[spell] = spell end return values end, nil, nil, nil, function(_, value) local list = E.global.unitframe.rangeCheck.PET[E.myclass] list[value] = nil UpdateRangeList(UnitFrame.rangeGroup.args.rangePet, list, value) end)
1478+
UnitFrame.rangeGroup.args.rangePet.args.addSpell.preferSpellID = true
14751479

14761480
UnitFrame.rangeGroup.args.rangePet.args.spells = ACH:Group('', nil, 11, nil, function(info) local list = E.global.unitframe.rangeCheck.PET[E.myclass] local value = info[#info] return list[value] end, function(info, value) local list = E.global.unitframe.rangeCheck.PET[E.myclass] list[info[#info]] = value UF:UpdateRangeSpells() end, nil, true)
14771481
UnitFrame.rangeGroup.args.rangePet.args.spells.inline = true

0 commit comments

Comments
 (0)