add nameplate trigger/anchor with awesome wotlk

This commit is contained in:
NoM0Re
2024-06-29 18:33:34 +02:00
parent 58c9953264
commit 909f61f102
14 changed files with 379 additions and 22 deletions
+37 -3
View File
@@ -1250,7 +1250,7 @@ Private.event_prototypes = {
type = "toggle",
width = WeakAuras.doubleWidth,
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
return trigger.unit == "nameplate" or trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end,
init = "not UnitIsUnit(\"player\", unit)"
},
@@ -1633,7 +1633,7 @@ Private.event_prototypes = {
type = "toggle",
width = WeakAuras.doubleWidth,
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
return trigger.unit == "nameplate" or trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end,
init = "not UnitIsUnit(\"player\", unit)"
},
@@ -1657,6 +1657,15 @@ Private.event_prototypes = {
end,
init = "UnitIsConnected(unit)"
},
{
name = "nameplateType",
display = L["Nameplate Type"],
type = "select",
init = "WeakAuras.GetPlayerReaction(unit)",
values = "hostility_types",
conditionType = "select",
store = true,
},
{
name = "name",
hidden = true,
@@ -5171,6 +5180,9 @@ Private.event_prototypes = {
internal_events = function(trigger)
local unit = trigger.unit
local result = {}
if unit == "nameplate" and trigger.use_onUpdateUnitTarget then
tinsert(result, "WA_UNIT_TARGET_NAME_PLATE")
end
AddRemainingCastInternalEvents(unit, result)
local includePets = trigger.use_includePets == true and trigger.includePets or nil
AddUnitChangeInternalEvents(unit, result, includePets)
@@ -5180,6 +5192,9 @@ Private.event_prototypes = {
if trigger.use_showLatency and trigger.unit == "player" then
WeakAuras.WatchForCastLatency()
end
if trigger.unit == "nameplate" and trigger.use_onUpdateUnitTarget then
WeakAuras.WatchForNameplateTargetChange()
end
end,
force_events = unitHelperFunctions.UnitChangedForceEventsWithPets,
canHaveDuration = "timed",
@@ -5372,6 +5387,15 @@ Private.event_prototypes = {
test = "true",
init = "raidMarkIndex > 0 and '{rt'..raidMarkIndex..'}' or ''"
},
{
name = "nameplateType",
display = L["Nameplate Type"],
type = "select",
init = "WeakAuras.GetPlayerReaction(unit)",
values = "hostility_types",
store = true,
conditionType = "select",
},
{
name = "includePets",
display = WeakAuras.newFeatureString .. L["Include Pets"],
@@ -5389,10 +5413,20 @@ Private.event_prototypes = {
type = "toggle",
width = WeakAuras.doubleWidth,
enable = function(trigger)
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
return trigger.unit == "nameplate" or trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
end,
init = "not UnitIsUnit(\"player\", unit)"
},
{
name = "onUpdateUnitTarget",
display = WeakAuras.newFeatureString .. L["Advanced Caster's Target Check"],
desc = L["Check nameplate's target every 0.2s"],
type = "toggle",
test = "true",
enable = function(trigger)
return trigger.unit == "nameplate"
end
},
{
name = "sourceUnit",
init = "unit",