Skip to content

Commit 7149132

Browse files
committed
#1845 - add Soulbind Active condition.
1 parent 6b72b90 commit 7149132

File tree

6 files changed

+206
-101
lines changed

6 files changed

+206
-101
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## v9.0.4
22
* New Condition: Torghast Anima Power Count
3+
* New Condition: Soulbind Active
34
* #1811 - The group/target point of a group will now be preserved when moving a shrunk group via click-and-drag.
45
### Bug Fixes
56
* #1840 - Talents granted by Torghast powers are now correctly reflected by the Talent Learned condition.

Components/Core/Conditions/Categories/PlayerAttributes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ ConditionCategory:RegisterCondition(16, "TRACKING", {
336336
useSUG = "tracking",
337337
icon = "Interface\\MINIMAP\\TRACKING\\None",
338338
tcoords = CNDT.COMMON.standardtcoords,
339-
funcstr = function(ConditionObject, c)
339+
funcstr = function(c)
340340
-- this event handling it is really extensive, so keep it in a handler separate from the condition
341341
CNDT:RegisterEvent("MINIMAP_UPDATE_TRACKING")
342342
CNDT:MINIMAP_UPDATE_TRACKING()

Components/Core/Conditions/Categories/Talents.lua

Lines changed: 142 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ ConditionCategory:RegisterCondition(9, "TALENTLEARNED", {
390390
useSUG = "talents",
391391
icon = function() return select(3, GetTalentInfo(1, 1, 1)) end,
392392
tcoords = CNDT.COMMON.standardtcoords,
393-
funcstr = function(ConditionObject, c)
393+
funcstr = function(c)
394394
-- this is handled externally because TalentMap is so extensive a process,
395395
-- and if it ends up getting processed in an OnUpdate condition, it could be very bad.
396396
CNDT:RegisterEvent("PLAYER_TALENT_UPDATE")
@@ -407,64 +407,64 @@ ConditionCategory:RegisterCondition(9, "TALENTLEARNED", {
407407
})
408408

409409

410-
CNDT.Env.AzeriteEssenceMap = {}
411-
CNDT.Env.AzeriteEssenceMap_MAJOR = {}
412-
local C_AzeriteEssence = C_AzeriteEssence
413-
function CNDT:AZERITE_ESSENCE_UPDATE()
414-
wipe(Env.AzeriteEssenceMap)
415-
wipe(Env.AzeriteEssenceMap_MAJOR)
416-
local milestones = C_AzeriteEssence.GetMilestones()
417-
if not milestones then return end
410+
411+
ConditionCategory:RegisterCondition(9, "PTSINTAL", {
412+
text = L["UIPANEL_PTSINTAL"],
413+
funcstr = "DEPRECATED",
414+
min = 0,
415+
max = 5,
416+
})
417+
418+
419+
420+
ConditionCategory:RegisterCondition(10, "PVPTALENTLEARNED", {
421+
text = L["UIPANEL_PVPTALENTLEARNED"],
422+
423+
bool = true,
418424

419-
for _, slot in pairs(milestones) do
420-
if slot.unlocked then
421-
local equippedEssenceId = C_AzeriteEssence.GetMilestoneEssence(slot.ID)
422-
if equippedEssenceId then
423-
local essence = C_AzeriteEssence.GetEssenceInfo(equippedEssenceId)
424-
local name = essence.name
425-
local id = essence.ID
425+
unit = PLAYER,
426+
name = function(editbox)
427+
editbox:SetTexts(L["SPELLTOCHECK"], L["CNDT_ONLYFIRST"])
428+
end,
429+
useSUG = "pvptalents",
430+
icon = 1322720,
431+
tcoords = CNDT.COMMON.standardtcoords,
432+
funcstr = function(c)
433+
-- this is handled externally because PvpTalentMap is so extensive a process,
434+
-- and if it ends up getting processed in an OnUpdate condition, it could be very bad.
435+
CNDT:RegisterEvent("PLAYER_TALENT_UPDATE")
436+
CNDT:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "PLAYER_TALENT_UPDATE")
437+
CNDT:PLAYER_TALENT_UPDATE()
438+
439+
return [[BOOLCHECK( PvpTalentMap[LOWER(c.NameFirst)] )]]
440+
end,
441+
events = function(ConditionObject, c)
442+
return
443+
ConditionObject:GenerateNormalEventString("PLAYER_TALENT_UPDATE"),
444+
ConditionObject:GenerateNormalEventString("ACTIVE_TALENT_GROUP_CHANGED")
445+
end,
446+
})
447+
448+
449+
ConditionCategory:RegisterCondition(11, "GLYPH", {
450+
text = L["UIPANEL_GLYPH"],
451+
tooltip = L["UIPANEL_GLYPH_DESC"],
452+
453+
bool = true,
454+
455+
unit = PLAYER,
456+
name = function(editbox)
457+
editbox:SetTexts(L["GLYPHTOCHECK"], L["CNDT_ONLYFIRST"])
458+
end,
459+
icon = "Interface\\Icons\\inv_inscription_tradeskill01",
460+
tcoords = CNDT.COMMON.standardtcoords,
461+
funcstr = "DEPRECATED",
462+
})
463+
464+
ConditionCategory:RegisterSpacer(20)
426465

427-
local lower = name and strlowerCache[name]
428-
if lower then
429-
Env.AzeriteEssenceMap[lower] = true
430-
Env.AzeriteEssenceMap[id] = true
431466

432-
-- Slot 0 is the major slot. There doesn't seem to be any other way to identify it.
433-
if slot.slot == 0 then
434-
Env.AzeriteEssenceMap_MAJOR[lower] = true
435-
Env.AzeriteEssenceMap_MAJOR[id] = true
436-
end
437-
end
438-
end
439-
end
440-
end
441-
end
442467

443-
for i, kind in TMW:Vararg("", "_MAJOR") do
444-
ConditionCategory:RegisterCondition(9.1 + i/10, "AZESSLEARNED" .. kind, {
445-
text = L["UIPANEL_AZESSLEARNED" .. kind],
446-
bool = true,
447-
unit = PLAYER,
448-
name = function(editbox)
449-
editbox:SetTexts(L["SPELLTOCHECK"], L["CNDT_ONLYFIRST"])
450-
end,
451-
useSUG = "azerite_essence",
452-
icon = "Interface\\Icons\\" .. (kind == "" and "inv_radientazeritematrix" or "spell_azerite_essence_15"),
453-
tcoords = CNDT.COMMON.standardtcoords,
454-
funcstr = function(ConditionObject, c)
455-
CNDT:RegisterEvent("AZERITE_ESSENCE_UPDATE")
456-
CNDT:RegisterEvent("AZERITE_ESSENCE_ACTIVATED", "AZERITE_ESSENCE_UPDATE")
457-
CNDT:AZERITE_ESSENCE_UPDATE()
458-
459-
return [[BOOLCHECK( AzeriteEssenceMap]] .. kind .. [[[LOWER(c.NameFirst)] )]]
460-
end,
461-
events = function(ConditionObject, c)
462-
return
463-
ConditionObject:GenerateNormalEventString("AZERITE_ESSENCE_UPDATE"),
464-
ConditionObject:GenerateNormalEventString("AZERITE_ESSENCE_ACTIVATED")
465-
end,
466-
})
467-
end
468468

469469
local AnimaPowWatcher = TMW:NewModule("ANIMAPOW", "AceEvent-3.0")
470470
local currentAnimaPows = {}
@@ -503,9 +503,8 @@ function AnimaPowWatcher:UNIT_AURA(_, unit)
503503
end
504504
end
505505

506-
507-
ConditionCategory:RegisterCondition(9.4, "ANIMAPOW", {
508-
text = L["UIPANEL_ANIMAPOW"],
506+
ConditionCategory:RegisterCondition(21, "ANIMAPOW", {
507+
text = L["CONDITIONPANEL_ANIMAPOW"],
509508
range = 5,
510509
unit = PLAYER,
511510
name = function(editbox)
@@ -514,7 +513,7 @@ ConditionCategory:RegisterCondition(9.4, "ANIMAPOW", {
514513
useSUG = true,
515514
icon = 3528304,
516515
tcoords = CNDT.COMMON.standardtcoords,
517-
funcstr = function(ConditionObject, c)
516+
funcstr = function(c)
518517
AnimaPowWatcher:Init()
519518
return [[(CurrentAnimaPows[LOWER(c.NameFirst)] or 0) c.Operator c.Level]]
520519
end,
@@ -524,59 +523,103 @@ ConditionCategory:RegisterCondition(9.4, "ANIMAPOW", {
524523
end,
525524
})
526525

527-
528-
529-
530-
531-
ConditionCategory:RegisterCondition(9, "PTSINTAL", {
532-
text = L["UIPANEL_PTSINTAL"],
533-
funcstr = "DEPRECATED",
534-
min = 0,
535-
max = 5,
536-
})
537-
538-
539-
540-
ConditionCategory:RegisterCondition(10, "PVPTALENTLEARNED", {
541-
text = L["UIPANEL_PVPTALENTLEARNED"],
542-
526+
ConditionCategory:RegisterCondition(21, "SOULBIND", {
527+
text = L["CONDITIONPANEL_SOULBIND"],
543528
bool = true,
544-
545529
unit = PLAYER,
546530
name = function(editbox)
547531
editbox:SetTexts(L["SPELLTOCHECK"], L["CNDT_ONLYFIRST"])
548532
end,
549-
useSUG = "pvptalents",
550-
icon = 1322720,
533+
useSUG = "soulbind",
534+
icon = 3528291,
551535
tcoords = CNDT.COMMON.standardtcoords,
552-
funcstr = function(ConditionObject, c)
553-
-- this is handled externally because PvpTalentMap is so extensive a process,
554-
-- and if it ends up getting processed in an OnUpdate condition, it could be very bad.
555-
CNDT:RegisterEvent("PLAYER_TALENT_UPDATE")
556-
CNDT:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "PLAYER_TALENT_UPDATE")
557-
CNDT:PLAYER_TALENT_UPDATE()
536+
Env = {
537+
GetActiveSoulbindID = C_Soulbinds.GetActiveSoulbindID,
538+
},
539+
funcstr = function(c)
540+
local id = c.Name:trim()
541+
if not tonumber(id) then
542+
for i = 1, 30 do
543+
local data = C_Soulbinds.GetSoulbindData(i)
544+
if strlowerCache[data.name] == strlowerCache[c.Name] then
545+
id = i
546+
break
547+
end
548+
end
549+
end
550+
if not tonumber(id) then
551+
return "false"
552+
end
558553

559-
return [[BOOLCHECK( PvpTalentMap[LOWER(c.NameFirst)] )]]
554+
return "BOOLCHECK( GetActiveSoulbindID() == " .. id .. " )"
560555
end,
561556
events = function(ConditionObject, c)
562557
return
563-
ConditionObject:GenerateNormalEventString("PLAYER_TALENT_UPDATE"),
564-
ConditionObject:GenerateNormalEventString("ACTIVE_TALENT_GROUP_CHANGED")
558+
ConditionObject:GenerateNormalEventString("SOULBIND_ACTIVATED")
565559
end,
566560
})
567561

568562

569-
ConditionCategory:RegisterCondition(11, "GLYPH", {
570-
text = L["UIPANEL_GLYPH"],
571-
tooltip = L["UIPANEL_GLYPH_DESC"],
572563

573-
bool = true,
564+
565+
566+
567+
568+
CNDT.Env.AzeriteEssenceMap = {}
569+
CNDT.Env.AzeriteEssenceMap_MAJOR = {}
570+
local C_AzeriteEssence = C_AzeriteEssence
571+
function CNDT:AZERITE_ESSENCE_UPDATE()
572+
wipe(Env.AzeriteEssenceMap)
573+
wipe(Env.AzeriteEssenceMap_MAJOR)
574+
local milestones = C_AzeriteEssence.GetMilestones()
575+
if not milestones then return end
574576

575-
unit = PLAYER,
576-
name = function(editbox)
577-
editbox:SetTexts(L["GLYPHTOCHECK"], L["CNDT_ONLYFIRST"])
578-
end,
579-
icon = "Interface\\Icons\\inv_inscription_tradeskill01",
580-
tcoords = CNDT.COMMON.standardtcoords,
581-
funcstr = "DEPRECATED",
582-
})
577+
for _, slot in pairs(milestones) do
578+
if slot.unlocked then
579+
local equippedEssenceId = C_AzeriteEssence.GetMilestoneEssence(slot.ID)
580+
if equippedEssenceId then
581+
local essence = C_AzeriteEssence.GetEssenceInfo(equippedEssenceId)
582+
local name = essence.name
583+
local id = essence.ID
584+
585+
local lower = name and strlowerCache[name]
586+
if lower then
587+
Env.AzeriteEssenceMap[lower] = true
588+
Env.AzeriteEssenceMap[id] = true
589+
590+
-- Slot 0 is the major slot. There doesn't seem to be any other way to identify it.
591+
if slot.slot == 0 then
592+
Env.AzeriteEssenceMap_MAJOR[lower] = true
593+
Env.AzeriteEssenceMap_MAJOR[id] = true
594+
end
595+
end
596+
end
597+
end
598+
end
599+
end
600+
601+
for i, kind in TMW:Vararg("", "_MAJOR") do
602+
ConditionCategory:RegisterCondition(30 + i/10, "AZESSLEARNED" .. kind, {
603+
text = L["UIPANEL_AZESSLEARNED" .. kind],
604+
bool = true,
605+
unit = PLAYER,
606+
name = function(editbox)
607+
editbox:SetTexts(L["SPELLTOCHECK"], L["CNDT_ONLYFIRST"])
608+
end,
609+
useSUG = "azerite_essence",
610+
icon = "Interface\\Icons\\" .. (kind == "" and "inv_radientazeritematrix" or "spell_azerite_essence_15"),
611+
tcoords = CNDT.COMMON.standardtcoords,
612+
funcstr = function(c)
613+
CNDT:RegisterEvent("AZERITE_ESSENCE_UPDATE")
614+
CNDT:RegisterEvent("AZERITE_ESSENCE_ACTIVATED", "AZERITE_ESSENCE_UPDATE")
615+
CNDT:AZERITE_ESSENCE_UPDATE()
616+
617+
return [[BOOLCHECK( AzeriteEssenceMap]] .. kind .. [[[LOWER(c.NameFirst)] )]]
618+
end,
619+
events = function(ConditionObject, c)
620+
return
621+
ConditionObject:GenerateNormalEventString("AZERITE_ESSENCE_UPDATE"),
622+
ConditionObject:GenerateNormalEventString("AZERITE_ESSENCE_ACTIVATED")
623+
end,
624+
})
625+
end

Components/Core/Conditions/Categories/Talents_config.lua

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,61 @@ function Module:Entry_AddToList_1(f, id)
149149

150150
f.Icon:SetTexture(info.icon)
151151
end
152+
153+
154+
155+
156+
local Module = SUG:NewModule("soulbind", SUG:GetModule("default"))
157+
Module.noMin = true
158+
Module.showColorHelp = false
159+
Module.helpText = L["SUG_TOOLTIPTITLE_GENERIC"]
160+
Module.table = {}
161+
local covenantIcons = {
162+
[1] = GetSpellTexture(321076),
163+
[2] = GetSpellTexture(321079),
164+
[3] = GetSpellTexture(299206),
165+
[4] = GetSpellTexture(321078),
166+
}
167+
function Module:OnInitialize()
168+
-- nothing
169+
end
170+
function Module:Table_Get()
171+
wipe(self.table)
172+
173+
for id = 1, 30 do
174+
local data = C_Soulbinds.GetSoulbindData(id)
175+
if data.name and data.name ~= "" then
176+
self.table[id] = strlowerCache[data.name]
177+
end
178+
end
179+
180+
return self.table
181+
end
182+
function Module.Sorter(a, b)
183+
local nameA, nameB = C_Soulbinds.GetSoulbindData(a), C_Soulbinds.GetSoulbindData(b)
184+
if nameA.covenantID == nameB.covenantID then
185+
--sort identical names by ID
186+
return a < b
187+
else
188+
--sort by name
189+
return nameA.covenantID < nameB.covenantID
190+
end
191+
end
192+
function Module:Table_GetSorter()
193+
return self.Sorter
194+
end
195+
function Module:Entry_AddToList_1(f, id)
196+
local info = C_Soulbinds.GetSoulbindData(id)
197+
198+
f.Name:SetText(info.name)
199+
f.ID:SetText(id)
200+
201+
f.tooltiptitle = info.name
202+
f.tooltiptext = info.description
203+
204+
f.insert = info.name
205+
f.insert2 = id
206+
207+
f.Icon:SetTexture(covenantIcons[info.covenantID])
208+
end
152209
Module.Entry_Colorize_1 = TMW.NULLFUNC

Localization/TellMeWhen-enUS.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ L["UIPANEL_PTSINTAL"] = "Points in talent"
876876
L["UIPANEL_TALENTLEARNED"] = "Talent learned"
877877
L["UIPANEL_AZESSLEARNED"] = "Azerite Essence Active"
878878
L["UIPANEL_AZESSLEARNED_MAJOR"] = "Major Azerite Essence Active"
879-
L["UIPANEL_ANIMAPOW"] = "Torghast Anima Power Count"
880879
L["UIPANEL_PVPTALENTLEARNED"] = "PvP Talent learned"
881880
L["UIPANEL_GLYPH"] = "Glyph active"
882881
L["UIPANEL_GLYPH_DESC"] = "Checks if you have a particular glyph active."
@@ -1603,6 +1602,10 @@ L["CONDITIONPANEL_LOC_SUBZONE_DESC"] = "Checks your current sub-zone. Note that
16031602
L["CONDITIONPANEL_LOC_SUBZONE_BOXDESC"] = "Enter the sub-zones that you would like to check for. Separate multiple sub-zones with semicolons."
16041603

16051604

1605+
L["CONDITIONPANEL_ANIMAPOW"] = "Torghast Anima Power Count"
1606+
L["CONDITIONPANEL_SOULBIND"] = "Soulbind Active"
1607+
1608+
16061609
L["AURA"] = "Aura"
16071610
L["SEAL"] = "Seal"
16081611
L["ASPECT"] = "Aspect"

Options/CHANGELOG.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ TMW.CHANGELOG_LASTVER="7.4.0"
55
TMW.CHANGELOG = [==[
66
## v9.0.4
77
* New Condition: Torghast Anima Power Count
8+
* New Condition: Soulbind Active
89
* #1811 - The group/target point of a group will now be preserved when moving a shrunk group via click-and-drag.
910
### Bug Fixes
1011
* #1840 - Talents granted by Torghast powers are now correctly reflected by the Talent Learned condition.

0 commit comments

Comments
 (0)