add maintank/mainassist trigger options

This commit is contained in:
NoM0Re
2024-07-08 02:01:30 +02:00
parent b7dac42f5a
commit d3eee1e364
4 changed files with 128 additions and 2 deletions
+83 -1
View File
@@ -87,6 +87,13 @@ local constants = {
nameRealmFilterDesc = L[" Filter formats: 'Name', 'Name-Realm', '-Realm'. \n\nSupports multiple entries, separated by commas\nCan use \\ to escape -."],
}
WeakAuras.UnitRaidRole = function(unit)
local raidID = UnitInRaid(unit)
if raidID then
return select(10, GetRaidRosterInfo(raidID + 1)) or "NONE"
end
end
function WeakAuras.SpellSchool(school)
return Private.combatlog_spell_school_types[school] or ""
end
@@ -1013,6 +1020,24 @@ local function AddUnitChangeInternalEvents(triggerUnit, t, includePets)
end
end
local function AddUnitRoleChangeInternalEvents(triggerUnit, t)
if (triggerUnit == nil) then
return
end
if Private.multiUnitUnits[triggerUnit] then
for unit in pairs(Private.multiUnitUnits[triggerUnit]) do
if not WeakAuras.UnitIsPet(unit) then
tinsert(t, "UNIT_ROLE_CHANGED_" .. string.lower(unit))
end
end
else
if not WeakAuras.UnitIsPet(triggerUnit) then
tinsert(t, "UNIT_ROLE_CHANGED_" .. string.lower(triggerUnit))
end
end
end
local function AddRemainingCastInternalEvents(triggerUnit, t)
if (triggerUnit == nil) then
return
@@ -1169,6 +1194,7 @@ Private.event_prototypes = {
local unit = trigger.unit
local result = {}
AddUnitChangeInternalEvents(unit, result)
AddUnitRoleChangeInternalEvents(unit, result)
if trigger.unitisunit then
AddUnitChangeInternalEvents(trigger.unitisunit, result)
end
@@ -1264,6 +1290,18 @@ Private.event_prototypes = {
store = true,
conditionType = "select"
},
{
name = "raid_role",
display = L["Raid Role"],
type = "select",
init = "WeakAuras.UnitRaidRole(unit)",
values = "raid_role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raidMarkIndex",
display = L["Raid Mark"],
@@ -1513,6 +1551,9 @@ Private.event_prototypes = {
local result = {}
local includePets = trigger.use_includePets == true and trigger.includePets or nil
AddUnitChangeInternalEvents(unit, result, includePets)
if includePets ~= "PetsOnly" then
AddUnitRoleChangeInternalEvents(unit, result)
end
return result
end,
force_events = unitHelperFunctions.UnitChangedForceEventsWithPets,
@@ -1636,6 +1677,18 @@ Private.event_prototypes = {
store = true,
conditionType = "select"
},
{
name = "raid_role",
display = L["Raid Role"],
type = "select",
init = "WeakAuras.UnitRaidRole(unit)",
values = "raid_role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raidMarkIndex",
display = L["Raid Mark"],
@@ -1751,7 +1804,9 @@ Private.event_prototypes = {
local result = {}
local includePets = trigger.use_includePets == true and trigger.includePets or nil
AddUnitChangeInternalEvents(unit, result, includePets)
if includePets ~= "PetsOnly" then
AddUnitRoleChangeInternalEvents(unit, result)
end
return result
end,
force_events = unitHelperFunctions.UnitChangedForceEventsWithPets,
@@ -1906,6 +1961,18 @@ Private.event_prototypes = {
store = true,
conditionType = "select"
},
{
name = "raid_role",
display = L["Raid Role"],
type = "select",
init = "WeakAuras.UnitRaidRole(unit)",
values = "raid_role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end
},
{
name = "raidMarkIndex",
display = L["Raid Mark"],
@@ -5232,6 +5299,9 @@ Private.event_prototypes = {
AddRemainingCastInternalEvents(unit, result)
local includePets = trigger.use_includePets == true and trigger.includePets or nil
AddUnitChangeInternalEvents(unit, result, includePets)
if includePets ~= "PetsOnly" then
AddUnitRoleChangeInternalEvents(unit, result)
end
return result
end,
loadFunc = function(trigger)
@@ -5416,6 +5486,18 @@ Private.event_prototypes = {
return not trigger.use_inverse
end
},
{
name = "raid_role",
display = L["Raid Role"],
type = "select",
init = "WeakAuras.UnitRaidRole(unit)",
values = "raid_role_types",
store = true,
conditionType = "select",
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" and not trigger.use_inverse
end
},
{
name = "raidMarkIndex",
display = L["Raid Mark"],