Rework LibGroupTalents now also returns function returns additionally, add Spec Role triggers to load/generic/bt2, fix WeakAuras.GetRegion

- **WeakAuras.SpecForUnit(unit)** = Returns: `classFileName..spec`, `Dominant Tree`, `spent1`, `spent2`, `spent3`
- **WeakAuras.GetUnitRole(unit)** = Returns one of: `"melee"`, `"caster"`, `"healer"`, `"tank"`
- **WeakAuras.SpecRolePositionForUnit(unit)** = Returns: `Dominant Tree`, `spent1`, `spent2`, `spent3`
- **WeakAuras.CheckTalentForUnit(unit, talentId)** = Returns: `"Points spent"` in talent or `nil`
- **WeakAuras.CheckGlyphForUnit(unit, glyphId)** = Returns: `true` if the player has the glyph associated with `spellID` or `spellName`, we can only see the glyphs of players running `LibGroupTalents-1.0`
This commit is contained in:
NoM0Re
2025-02-11 00:12:30 +01:00
parent 0b40284f3f
commit 5d1ac74d27
12 changed files with 270 additions and 56 deletions
+60 -9
View File
@@ -1094,6 +1094,14 @@ Private.load_prototype = {
limit = 2
},
},
{
name = "role",
display = L["Spec Role"],
type = "multiselect",
values = "role_types",
init = "arg",
events = {"PLAYER_TALENT_UPDATE", "PLAYER_ROLES_ASSIGNED", "SPELL_UPDATE_USABLE", "WA_DELAYED_PLAYER_ENTERING_WORLD"}
},
{
name = "raid_role",
display = L["Raid Role"],
@@ -1474,9 +1482,8 @@ Private.event_prototypes = {
local unit = trigger.unit
local result = {}
AddUnitChangeInternalEvents(unit, result, nil, trigger.use_unitisunit and trigger.unitisunit or nil)
if trigger.use_specId then
AddUnitSpecChangeInternalEvents(unit, result)
end
AddUnitRoleChangeInternalEvents(unit, result)
AddUnitSpecChangeInternalEvents(unit, result)
return result
end,
loadFunc = function(trigger)
@@ -1587,6 +1594,18 @@ Private.event_prototypes = {
store = true,
conditionType = "select"
},
{
name = "role",
display = L["Spec Role"],
type = "select",
init = "WeakAuras.GetUnitRole(unit)",
values = "role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raid_role",
display = L["Raid Role"],
@@ -1912,9 +1931,7 @@ Private.event_prototypes = {
if includePets ~= "PetsOnly" then
AddUnitRoleChangeInternalEvents(unit, result)
end
if trigger.use_specId then
AddUnitSpecChangeInternalEvents(unit, result)
end
AddUnitSpecChangeInternalEvents(unit, result)
return result
end,
loadFunc = function(trigger)
@@ -2101,6 +2118,18 @@ Private.event_prototypes = {
end,
desc = L["Requires syncing the specialization via LibGroupTalents."],
},
{
name = "role",
display = L["Spec Role"],
type = "select",
init = "WeakAuras.GetUnitRole(unit)",
values = "role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raid_role",
display = L["Raid Role"],
@@ -2260,9 +2289,7 @@ Private.event_prototypes = {
if includePets ~= "PetsOnly" then
AddUnitRoleChangeInternalEvents(unit, result)
end
if trigger.use_specId then
AddUnitSpecChangeInternalEvents(unit, result)
end
AddUnitSpecChangeInternalEvents(unit, result)
if trigger.use_showCost and trigger.unit == "player" then
tinsert(result, "WA_UNIT_QUEUED_SPELL_CHANGED");
end
@@ -2515,6 +2542,18 @@ Private.event_prototypes = {
end,
desc = L["Requires syncing the specialization via LibGroupTalents."],
},
{
name = "role",
display = L["Spec Role"],
type = "select",
init = "WeakAuras.GetUnitRole(unit)",
values = "role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raid_role",
display = L["Raid Role"],
@@ -6446,6 +6485,18 @@ Private.event_prototypes = {
return not trigger.use_inverse
end
},
{
name = "role",
display = L["Spec Role"],
type = "select",
init = "WeakAuras.GetUnitRole(unit)",
values = "role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raid_role",
display = L["Raid Role"],