from retail
This commit is contained in:
@@ -997,7 +997,7 @@ local function GetAllUnits(unit, allUnits, includePets)
|
|||||||
elseif unit == "arena" then
|
elseif unit == "arena" then
|
||||||
max = 5
|
max = 5
|
||||||
elseif unit == "nameplate" then
|
elseif unit == "nameplate" then
|
||||||
max = C_NamePlate and C_NamePlate.GetNamePlates and #C_NamePlate.GetNamePlates() or 40
|
max = 100
|
||||||
else
|
else
|
||||||
return function() end
|
return function() end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -341,8 +341,7 @@ local function CreateTestForCondition(data, input, allConditionsTemplate, usedSt
|
|||||||
local found = 0
|
local found = 0
|
||||||
local op = %q
|
local op = %q
|
||||||
local range = %s
|
local range = %s
|
||||||
local max = C_NamePlate and C_NamePlate.GetNamePlates and #C_NamePlate.GetNamePlates() or 40
|
for i = 1, 100 do
|
||||||
for i = 1, max do
|
|
||||||
local unit = "nameplate" .. i
|
local unit = "nameplate" .. i
|
||||||
if UnitExists(unit) and UnitCanAttack("player", unit) and WeakAuras.CheckRange(unit, range, op) then
|
if UnitExists(unit) and UnitCanAttack("player", unit) and WeakAuras.CheckRange(unit, range, op) then
|
||||||
found = found + 1
|
found = found + 1
|
||||||
|
|||||||
+234
-140
@@ -706,7 +706,7 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
|
|||||||
end
|
end
|
||||||
elseif (data.statesParameter == "unit") then
|
elseif (data.statesParameter == "unit") then
|
||||||
if arg1 then
|
if arg1 then
|
||||||
if Private.multiUnitUnits[data.trigger.unit] or data.trigger.unit == "nameplate" then
|
if Private.multiUnitUnits[data.trigger.unit] then
|
||||||
unitForUnitTrigger = arg1
|
unitForUnitTrigger = arg1
|
||||||
cloneIdForUnitTrigger = arg1
|
cloneIdForUnitTrigger = arg1
|
||||||
else
|
else
|
||||||
@@ -847,6 +847,16 @@ local function getGameEventFromComposedEvent(composedEvent)
|
|||||||
return separatorPosition == nil and composedEvent or composedEvent:sub(1, separatorPosition - 1)
|
return separatorPosition == nil and composedEvent or composedEvent:sub(1, separatorPosition - 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Private.ScanEventsByID(event, id, ...)
|
||||||
|
if loaded_events[event] then
|
||||||
|
WeakAuras.ScanEvents(event, id, ...)
|
||||||
|
end
|
||||||
|
local eventWithID = event .. ":" .. id
|
||||||
|
if loaded_events[eventWithID] then
|
||||||
|
WeakAuras.ScanEvents(eventWithID, id, ...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function WeakAuras.ScanEvents(event, arg1, arg2, ...)
|
function WeakAuras.ScanEvents(event, arg1, arg2, ...)
|
||||||
local system = getGameEventFromComposedEvent(event)
|
local system = getGameEventFromComposedEvent(event)
|
||||||
Private.StartProfileSystem("generictrigger " .. system)
|
Private.StartProfileSystem("generictrigger " .. system)
|
||||||
@@ -1142,8 +1152,8 @@ function HandleEvent(frame, event, arg1, arg2, ...)
|
|||||||
end
|
end
|
||||||
if (event == "PLAYER_ENTERING_WORLD") then
|
if (event == "PLAYER_ENTERING_WORLD") then
|
||||||
timer:ScheduleTimer(function()
|
timer:ScheduleTimer(function()
|
||||||
Private.StartProfileSystem("generictrigger WA_DELAYED_PLAYER_ENTERING_WORLD");
|
|
||||||
HandleEvent(frame, "WA_DELAYED_PLAYER_ENTERING_WORLD");
|
HandleEvent(frame, "WA_DELAYED_PLAYER_ENTERING_WORLD");
|
||||||
|
Private.StartProfileSystem("generictrigger WA_DELAYED_PLAYER_ENTERING_WORLD");
|
||||||
Private.ScanForLoads(nil, "WA_DELAYED_PLAYER_ENTERING_WORLD")
|
Private.ScanForLoads(nil, "WA_DELAYED_PLAYER_ENTERING_WORLD")
|
||||||
Private.CheckCooldownReady();
|
Private.CheckCooldownReady();
|
||||||
Private.StopProfileSystem("generictrigger WA_DELAYED_PLAYER_ENTERING_WORLD");
|
Private.StopProfileSystem("generictrigger WA_DELAYED_PLAYER_ENTERING_WORLD");
|
||||||
@@ -1260,7 +1270,7 @@ local function MultiUnitLoop(Func, unit, includePets, ...)
|
|||||||
Func(unit..i, ...)
|
Func(unit..i, ...)
|
||||||
end
|
end
|
||||||
elseif unit == "nameplate" then
|
elseif unit == "nameplate" then
|
||||||
for i = 1, 400 do
|
for i = 1, 100 do
|
||||||
Func(unit..i, ...)
|
Func(unit..i, ...)
|
||||||
end
|
end
|
||||||
elseif unit == "group" then
|
elseif unit == "group" then
|
||||||
@@ -1741,6 +1751,8 @@ function GenericTrigger.Add(data, region)
|
|||||||
tinsert(trigger_subevents, subevent)
|
tinsert(trigger_subevents, subevent)
|
||||||
hasParam = true
|
hasParam = true
|
||||||
end
|
end
|
||||||
|
elseif Private.InternalEventByIDList[trueEvent] then
|
||||||
|
tinsert(trigger_events, trueEvent..":"..i)
|
||||||
elseif trueEvent:match("^UNIT_") then
|
elseif trueEvent:match("^UNIT_") then
|
||||||
isUnitEvent = true
|
isUnitEvent = true
|
||||||
|
|
||||||
@@ -2476,14 +2488,14 @@ do
|
|||||||
itemCdDurs[id] = nil;
|
itemCdDurs[id] = nil;
|
||||||
itemCdExps[id] = nil;
|
itemCdExps[id] = nil;
|
||||||
itemCdEnabled[id] = 1;
|
itemCdEnabled[id] = 1;
|
||||||
WeakAuras.ScanEvents("ITEM_COOLDOWN_READY:" .. id, id);
|
Private.ScanEventsByID("ITEM_COOLDOWN_READY", id);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ItemSlotCooldownFinished(id)
|
local function ItemSlotCooldownFinished(id)
|
||||||
itemSlotsCdHandles[id] = nil;
|
itemSlotsCdHandles[id] = nil;
|
||||||
itemSlotsCdDurs[id] = nil;
|
itemSlotsCdDurs[id] = nil;
|
||||||
itemSlotsCdExps[id] = nil;
|
itemSlotsCdExps[id] = nil;
|
||||||
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_READY:" .. id, id);
|
Private.ScanEventsByID("ITEM_SLOT_COOLDOWN_READY", id);
|
||||||
end
|
end
|
||||||
|
|
||||||
function Private.CheckRuneCooldown()
|
function Private.CheckRuneCooldown()
|
||||||
@@ -2584,7 +2596,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if changed and not WeakAuras.IsPaused() then
|
if changed and not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED:" .. id, id)
|
Private.ScanEventsByID("SPELL_COOLDOWN_CHANGED", id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2609,15 +2621,15 @@ do
|
|||||||
|
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
if nowReady then
|
if nowReady then
|
||||||
WeakAuras.ScanEvents("SPELL_COOLDOWN_READY:" .. id, id)
|
Private.ScanEventsByID("SPELL_COOLDOWN_READY", id)
|
||||||
end
|
end
|
||||||
|
|
||||||
if changed or chargesChanged then
|
if changed or chargesChanged then
|
||||||
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED:" .. id, id)
|
Private.ScanEventsByID("SPELL_COOLDOWN_CHANGED", id)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (chargesDifference ~= 0 ) then
|
if (chargesDifference ~= 0 ) then
|
||||||
WeakAuras.ScanEvents("SPELL_CHARGES_CHANGED:" .. id, id, chargesDifference, spellCount or 0);
|
Private.ScanEventsByID("SPELL_CHARGES_CHANGED", id, chargesDifference, spellCount or 0);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2656,7 +2668,7 @@ do
|
|||||||
itemCdExps[id] = endTime;
|
itemCdExps[id] = endTime;
|
||||||
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
|
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("ITEM_COOLDOWN_STARTED:" .. id, id)
|
Private.ScanEventsByID("ITEM_COOLDOWN_STARTED", id)
|
||||||
end
|
end
|
||||||
itemCdEnabledChanged = false;
|
itemCdEnabledChanged = false;
|
||||||
elseif(itemCdExps[id] ~= endTime) then
|
elseif(itemCdExps[id] ~= endTime) then
|
||||||
@@ -2668,7 +2680,7 @@ do
|
|||||||
itemCdExps[id] = endTime;
|
itemCdExps[id] = endTime;
|
||||||
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
|
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("ITEM_COOLDOWN_CHANGED:" .. id, id)
|
Private.ScanEventsByID("ITEM_COOLDOWN_CHANGED", id)
|
||||||
end
|
end
|
||||||
itemCdEnabledChanged = false;
|
itemCdEnabledChanged = false;
|
||||||
end
|
end
|
||||||
@@ -2686,7 +2698,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (itemCdEnabledChanged and not WeakAuras.IsPaused()) then
|
if (itemCdEnabledChanged and not WeakAuras.IsPaused()) then
|
||||||
WeakAuras.ScanEvents("ITEM_COOLDOWN_CHANGED:" .. id, id);
|
Private.ScanEventsByID("ITEM_COOLDOWN_CHANGED", id);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2711,7 +2723,7 @@ do
|
|||||||
itemSlotsCdExps[id] = endTime;
|
itemSlotsCdExps[id] = endTime;
|
||||||
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
|
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_STARTED:" .. id, id)
|
Private.ScanEventsByID("ITEM_SLOT_COOLDOWN_STARTED", id)
|
||||||
end
|
end
|
||||||
elseif(itemSlotsCdExps[id] ~= endTime) then
|
elseif(itemSlotsCdExps[id] ~= endTime) then
|
||||||
-- Cooldown is now different
|
-- Cooldown is now different
|
||||||
@@ -2722,7 +2734,7 @@ do
|
|||||||
itemSlotsCdExps[id] = endTime;
|
itemSlotsCdExps[id] = endTime;
|
||||||
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
|
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_CHANGED:" .. id, id)
|
Private.ScanEventsByID("ITEM_SLOT_COOLDOWN_CHANGED", id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif(duration > 0) then
|
elseif(duration > 0) then
|
||||||
@@ -2741,7 +2753,7 @@ do
|
|||||||
local newItemId = GetInventoryItemID("player", id);
|
local newItemId = GetInventoryItemID("player", id);
|
||||||
if (itemId ~= newItemId) then
|
if (itemId ~= newItemId) then
|
||||||
if not WeakAuras.IsPaused() then
|
if not WeakAuras.IsPaused() then
|
||||||
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_ITEM_CHANGED:" .. id, id)
|
Private.ScanEventsByID("ITEM_SLOT_COOLDOWN_ITEM_CHANGED", id)
|
||||||
end
|
end
|
||||||
itemSlots[id] = newItemId or 0;
|
itemSlots[id] = newItemId or 0;
|
||||||
end
|
end
|
||||||
@@ -2891,12 +2903,15 @@ function WeakAuras.WatchUnitChange(unit)
|
|||||||
unit = string.lower(unit)
|
unit = string.lower(unit)
|
||||||
if not watchUnitChange then
|
if not watchUnitChange then
|
||||||
watchUnitChange = CreateFrame("Frame");
|
watchUnitChange = CreateFrame("Frame");
|
||||||
watchUnitChange.unitChangeGUIDS = {}
|
watchUnitChange.trackedUnits = {}
|
||||||
|
watchUnitChange.unitIdToGUID = {}
|
||||||
|
watchUnitChange.GUIDToUnitIds = {}
|
||||||
watchUnitChange.unitRoles = {}
|
watchUnitChange.unitRoles = {}
|
||||||
watchUnitChange.unitRaidRole = {}
|
watchUnitChange.unitRaidRole = {}
|
||||||
watchUnitChange.inRaid = IsInRaid()
|
watchUnitChange.inRaid = IsInRaid()
|
||||||
watchUnitChange.nameplateFaction = {}
|
watchUnitChange.nameplateFaction = {}
|
||||||
watchUnitChange.raidmark = {}
|
watchUnitChange.raidmark = {}
|
||||||
|
watchUnitChange.unitIsUnit = {}
|
||||||
|
|
||||||
Private.frames["Unit Change Frame"] = watchUnitChange;
|
Private.frames["Unit Change Frame"] = watchUnitChange;
|
||||||
watchUnitChange:RegisterEvent("PLAYER_TARGET_CHANGED")
|
watchUnitChange:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||||
@@ -2915,115 +2930,200 @@ function WeakAuras.WatchUnitChange(unit)
|
|||||||
watchUnitChange:RegisterEvent("UNIT_PET")
|
watchUnitChange:RegisterEvent("UNIT_PET")
|
||||||
watchUnitChange:RegisterEvent("RAID_TARGET_UPDATE")
|
watchUnitChange:RegisterEvent("RAID_TARGET_UPDATE")
|
||||||
|
|
||||||
|
local function unitUpdate(unitA, eventsToSend)
|
||||||
|
local oldGUID = watchUnitChange.unitIdToGUID[unitA]
|
||||||
|
local newGUID = WeakAuras.UnitExistsFixed(unitA) and UnitGUID(unitA)
|
||||||
|
if oldGUID ~= newGUID then
|
||||||
|
eventsToSend["UNIT_CHANGED_" .. unitA] = unitA
|
||||||
|
if watchUnitChange.GUIDToUnitIds[oldGUID] then
|
||||||
|
for unitB in pairs(watchUnitChange.GUIDToUnitIds[oldGUID]) do
|
||||||
|
eventsToSend["UNIT_IS_UNIT_CHANGED_" .. unitA .. "_" .. unitB] = unitA
|
||||||
|
eventsToSend["UNIT_IS_UNIT_CHANGED_" .. unitB .. "_" .. unitA] = unitB
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if watchUnitChange.GUIDToUnitIds[newGUID] then
|
||||||
|
for unitB in pairs(watchUnitChange.GUIDToUnitIds[newGUID]) do
|
||||||
|
eventsToSend["UNIT_IS_UNIT_CHANGED_" .. unitA .. "_" .. unitB] = unitA
|
||||||
|
eventsToSend["UNIT_IS_UNIT_CHANGED_" .. unitB .. "_" .. unitA] = unitB
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- update data
|
||||||
|
if oldGUID and watchUnitChange.GUIDToUnitIds[oldGUID] then
|
||||||
|
watchUnitChange.GUIDToUnitIds[oldGUID][unitA] = nil
|
||||||
|
if next(watchUnitChange.GUIDToUnitIds[oldGUID]) == nil then
|
||||||
|
watchUnitChange.GUIDToUnitIds[oldGUID] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if newGUID then
|
||||||
|
watchUnitChange.GUIDToUnitIds[newGUID] = watchUnitChange.GUIDToUnitIds[newGUID] or {}
|
||||||
|
watchUnitChange.GUIDToUnitIds[newGUID][unitA] = true
|
||||||
|
end
|
||||||
|
watchUnitChange.unitIdToGUID[unitA] = newGUID
|
||||||
|
end
|
||||||
|
|
||||||
|
local function markerUpdate(unit, eventsToSend)
|
||||||
|
local oldMarker = watchUnitChange.raidmark[unit]
|
||||||
|
local newMarker = GetRaidTargetIndex(unit) or 0
|
||||||
|
if newMarker ~= oldMarker then
|
||||||
|
eventsToSend["UNIT_CHANGED_" .. unit] = unit
|
||||||
|
watchUnitChange.raidmark[unit] = newMarker
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function markerInit(unit)
|
||||||
|
watchUnitChange.raidmark[unit] = GetRaidTargetIndex(unit) or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local function markerClear(unit)
|
||||||
|
watchUnitChange.raidmark[unit] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reactionUpdate(unit, eventsToSend)
|
||||||
|
local oldReaction = watchUnitChange.nameplateFaction[unit]
|
||||||
|
local newReaction = WeakAuras.GetPlayerReaction(unit)
|
||||||
|
if oldReaction ~= newReaction then
|
||||||
|
eventsToSend["UNIT_CHANGED_" .. unit] = unit
|
||||||
|
watchUnitChange.nameplateFaction[unit] = newReaction
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reactionInit(unit)
|
||||||
|
watchUnitChange.nameplateFaction[unit] = WeakAuras.GetPlayerReaction(unit)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reactionClear(unit)
|
||||||
|
watchUnitChange.nameplateFaction[unit] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function roleUpdate(unit, eventsToSend)
|
||||||
|
local oldRaidRole = watchUnitChange.unitRaidRole[unit]
|
||||||
|
local newRaidRole = WeakAuras.UnitRaidRole(unit)
|
||||||
|
if oldRaidRole ~= newRaidRole then
|
||||||
|
eventsToSend["UNIT_ROLE_CHANGED_" .. unit] = unit
|
||||||
|
watchUnitChange.unitRaidRole[unit] = newRaidRole
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
watchUnitChange:SetScript("OnEvent", function(self, event, unit)
|
watchUnitChange:SetScript("OnEvent", function(self, event, unit)
|
||||||
Private.StartProfileSystem("generictrigger unit change");
|
Private.StartProfileSystem("generictrigger unit change");
|
||||||
if event == "UNIT_PET" then
|
local eventsToSend = {}
|
||||||
local pet = WeakAuras.unitToPetUnit[unit]
|
if event == "PLAYER_ENTERING_WORLD" then
|
||||||
if pet then
|
for unit in pairs(watchUnitChange.unitIdToGUID) do
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. pet, pet)
|
unitUpdate(unit, eventsToSend)
|
||||||
end
|
markerUpdate(unit, eventsToSend)
|
||||||
elseif event == "RAID_TARGET_UPDATE" then
|
reactionUpdate(unit, eventsToSend)
|
||||||
for unit, marker in pairs(watchUnitChange.raidmark) do
|
|
||||||
local newMarker = GetRaidTargetIndex(unit) or 0
|
|
||||||
if marker ~= newMarker then
|
|
||||||
watchUnitChange.raidmark[unit] = newMarker
|
|
||||||
if unit:find("^nameplate%d+$") then
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
else
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
elseif event == "NAME_PLATE_UNIT_ADDED" then
|
elseif event == "NAME_PLATE_UNIT_ADDED" then
|
||||||
local oldGUID = watchUnitChange.unitChangeGUIDS[unit]
|
if not watchUnitChange.trackedUnits[unit] then
|
||||||
local newGUID = WeakAuras.UnitExistsFixed(unit) and UnitGUID(unit)
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
if oldGUID ~= newGUID then
|
return
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
end
|
end
|
||||||
watchUnitChange.unitChangeGUIDS[unit] = newGUID
|
unitUpdate(unit, eventsToSend)
|
||||||
watchUnitChange.raidmark[unit] = GetRaidTargetIndex(unit) or 0
|
markerInit(unit)
|
||||||
watchUnitChange.nameplateFaction[unit] = WeakAuras.GetPlayerReaction(unit)
|
reactionInit(unit)
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
elseif event == "NAME_PLATE_UNIT_REMOVED" then
|
elseif event == "NAME_PLATE_UNIT_REMOVED" then
|
||||||
local oldGUID = watchUnitChange.unitChangeGUIDS[unit]
|
if not watchUnitChange.trackedUnits[unit] then
|
||||||
local newGUID = WeakAuras.UnitExistsFixed(unit) and UnitGUID(unit)
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
if oldGUID ~= newGUID then
|
return
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
end
|
end
|
||||||
watchUnitChange.unitChangeGUIDS[unit] = newGUID
|
unitUpdate(unit, eventsToSend)
|
||||||
watchUnitChange.raidmark[unit] = nil
|
markerClear(unit)
|
||||||
watchUnitChange.nameplateFaction[unit] = nil
|
reactionClear(unit)
|
||||||
WeakAuras.ScanEvents(event, unit)
|
elseif event == "INSTANCE_ENCOUNTER_ENGAGE_UNIT" then
|
||||||
elseif event == "UNIT_FACTION" then
|
for i = 1, 5 do
|
||||||
local oldReaction = watchUnitChange.nameplateFaction[unit]
|
local unit = "boss" .. i
|
||||||
local newReaction = WeakAuras.GetPlayerReaction(unit)
|
if watchUnitChange.trackedUnits[unit] then
|
||||||
if oldReaction ~= newReaction then
|
unitUpdate(unit, eventsToSend)
|
||||||
watchUnitChange.nameplateFaction[unit] = newReaction
|
markerInit(unit)
|
||||||
if unit:find("^nameplate%d+$") then
|
reactionInit(unit)
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
else
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif event == "PLAYER_TARGET_CHANGED" then
|
||||||
|
if not watchUnitChange.trackedUnits["target"] then
|
||||||
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
|
return
|
||||||
|
end
|
||||||
|
unitUpdate("target", eventsToSend)
|
||||||
|
markerInit("target")
|
||||||
|
reactionInit("target")
|
||||||
|
elseif event == "PLAYER_FOCUS_CHANGED" then
|
||||||
|
if not watchUnitChange.trackedUnits["focus"] then
|
||||||
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
|
return
|
||||||
|
end
|
||||||
|
unitUpdate("focus", eventsToSend)
|
||||||
|
markerInit("focus")
|
||||||
|
reactionInit("focus")
|
||||||
|
elseif event == "RAID_TARGET_UPDATE" then
|
||||||
|
for unit in pairs(watchUnitChange.raidmark) do
|
||||||
|
markerUpdate(unit, eventsToSend)
|
||||||
|
end
|
||||||
|
elseif event == "UNIT_FACTION" then
|
||||||
|
if watchUnitChange.trackedUnits[unit] then
|
||||||
|
reactionUpdate(unit, eventsToSend)
|
||||||
|
end
|
||||||
|
elseif event == "UNIT_PET" then
|
||||||
|
local pet = WeakAuras.unitToPetUnit[unit]
|
||||||
|
if pet and watchUnitChange.trackedUnits[pet] then
|
||||||
|
eventsToSend["UNIT_CHANGED_" .. pet] = pet
|
||||||
|
end
|
||||||
elseif event == "PLAYER_ROLES_ASSIGNED" then
|
elseif event == "PLAYER_ROLES_ASSIGNED" then
|
||||||
for unit in pairs(Private.multiUnitUnits.group) do
|
for unit in pairs(Private.multiUnitUnits.group) do
|
||||||
local oldRaidRole = watchUnitChange.unitRaidRole[unit]
|
if watchUnitChange.trackedUnits[unit] then
|
||||||
local newRaidRole = WeakAuras.UnitRaidRole(unit)
|
roleUpdate(unit, eventsToSend)
|
||||||
if oldRaidRole ~= newRaidRole then
|
end
|
||||||
if unit:find("^nameplate%d+$") then
|
end
|
||||||
WeakAuras.ScanEvents("UNIT_ROLE_CHANGED_nameplate", unit)
|
elseif event == "UNIT_TARGET" then
|
||||||
else
|
local unitTarget = unit .. "target"
|
||||||
WeakAuras.ScanEvents("UNIT_ROLE_CHANGED_" .. unit, unit)
|
if not watchUnitChange.trackedUnits[unitTarget] then
|
||||||
end
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
watchUnitChange.unitRaidRole[unit] = newRaidRole
|
return
|
||||||
|
end
|
||||||
|
unitUpdate(unitTarget, eventsToSend)
|
||||||
|
markerInit(unitTarget)
|
||||||
|
reactionInit(unitTarget)
|
||||||
|
elseif event == "PARTY_MEMBERS_CHANGED" or event == "RAID_ROSTER_UPDATE" then
|
||||||
|
for unit in pairs(Private.multiUnitUnits.group) do
|
||||||
|
if watchUnitChange.trackedUnits[unit] then
|
||||||
|
unitUpdate(unit, eventsToSend)
|
||||||
|
markerInit(unit, eventsToSend)
|
||||||
|
reactionInit(unit, eventsToSend)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
local inRaid = IsInRaid()
|
local inRaid = IsInRaid()
|
||||||
local inRaidChanged = inRaid ~= watchUnitChange.inRaid
|
local inRaidChanged = inRaid ~= watchUnitChange.inRaid
|
||||||
|
if inRaidChanged then
|
||||||
for unit, guid in pairs(watchUnitChange.unitChangeGUIDS) do
|
for unit in pairs(Private.multiUnitUnits.group) do
|
||||||
local newGuid = WeakAuras.UnitExistsFixed(unit) and UnitGUID(unit) or ""
|
if watchUnitChange.trackedUnits[unit] and watchUnitChange.unitIdToGUID[unit] then
|
||||||
local newMarker = GetRaidTargetIndex(unit) or 0
|
eventsToSend["UNIT_CHANGED_" .. unit] = unit
|
||||||
if guid ~= newGuid
|
|
||||||
or newMarker ~= watchUnitChange.raidmark[unit]
|
|
||||||
or event == "PLAYER_ENTERING_WORLD"
|
|
||||||
then
|
|
||||||
if unit:find("^nameplate%d+$") then
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
else
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
|
|
||||||
end
|
|
||||||
watchUnitChange.unitChangeGUIDS[unit] = newGuid
|
|
||||||
watchUnitChange.raidmark[unit] = newMarker
|
|
||||||
|
|
||||||
local oldReaction = watchUnitChange.nameplateFaction[unit]
|
|
||||||
local newReaction = WeakAuras.GetPlayerReaction(unit)
|
|
||||||
if oldReaction ~= newReaction then
|
|
||||||
watchUnitChange.nameplateFaction[unit] = newReaction
|
|
||||||
if unit:find("^nameplate%d+$") then
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_nameplate", unit)
|
|
||||||
else
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
elseif Private.multiUnitUnits.group[unit] then
|
|
||||||
-- If in raid changed we send a UNIT_CHANGED for the group units
|
|
||||||
if inRaidChanged then
|
|
||||||
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
watchUnitChange.inRaid = inRaid
|
||||||
end
|
end
|
||||||
watchUnitChange.inRaid = inRaid
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- send events
|
||||||
|
for event, unit in pairs(eventsToSend) do
|
||||||
|
WeakAuras.ScanEvents(event, unit)
|
||||||
|
end
|
||||||
|
|
||||||
Private.StopProfileSystem("generictrigger unit change");
|
Private.StopProfileSystem("generictrigger unit change");
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
watchUnitChange.unitChangeGUIDS = watchUnitChange.unitChangeGUIDS or {}
|
if watchUnitChange.trackedUnits[unit] then
|
||||||
watchUnitChange.unitChangeGUIDS[unit] = UnitGUID(unit) or ""
|
return
|
||||||
|
end
|
||||||
|
local guid = UnitGUID(unit)
|
||||||
|
watchUnitChange.trackedUnits[unit] = true
|
||||||
|
watchUnitChange.unitIdToGUID[unit] = guid
|
||||||
|
if guid then
|
||||||
|
watchUnitChange.GUIDToUnitIds[guid] = watchUnitChange.GUIDToUnitIds[guid] or {}
|
||||||
|
watchUnitChange.GUIDToUnitIds[guid][unit] = true
|
||||||
|
end
|
||||||
watchUnitChange.raidmark = watchUnitChange.raidmark or {}
|
watchUnitChange.raidmark = watchUnitChange.raidmark or {}
|
||||||
watchUnitChange.raidmark[unit] = GetRaidTargetIndex(unit) or 0
|
watchUnitChange.raidmark[unit] = GetRaidTargetIndex(unit) or 0
|
||||||
|
watchUnitChange.inRaid = IsInRaid()
|
||||||
end
|
end
|
||||||
|
|
||||||
local equipmentItemIDs, equipmentSetItemIDs = {}, {}
|
local equipmentItemIDs, equipmentSetItemIDs = {}, {}
|
||||||
@@ -3264,46 +3364,44 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Nameplate Target
|
-- Nameplate Target
|
||||||
if WeakAuras.isAwesomeEnabled() then
|
do
|
||||||
do
|
local nameplateTargetFrame = nil
|
||||||
local nameplateTargetFrame = nil
|
local nameplateTargets = {}
|
||||||
local nameplateTargets = {}
|
|
||||||
|
|
||||||
local function nameplateTargetOnEvent(self, event, unit)
|
local function nameplateTargetOnEvent(self, event, unit)
|
||||||
if event == "NAME_PLATE_UNIT_ADDED" then
|
if event == "NAME_PLATE_UNIT_ADDED" then
|
||||||
nameplateTargets[unit] = UnitGUID(unit.."-target") or true
|
nameplateTargets[unit] = UnitGUID(unit.."-target") or true
|
||||||
elseif event == "NAME_PLATE_UNIT_REMOVED" then
|
elseif event == "NAME_PLATE_UNIT_REMOVED" then
|
||||||
nameplateTargets[unit] = nil
|
nameplateTargets[unit] = nil
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local tick_throttle = 0.2
|
local tick_throttle = 0.2
|
||||||
local throttle_update = tick_throttle
|
local throttle_update = tick_throttle
|
||||||
local function nameplateTargetOnUpdate(self, delta)
|
local function nameplateTargetOnUpdate(self, delta)
|
||||||
throttle_update = throttle_update - delta
|
throttle_update = throttle_update - delta
|
||||||
if throttle_update < 0 then
|
if throttle_update < 0 then
|
||||||
for unit, targetGUID in pairs(nameplateTargets) do
|
for unit, targetGUID in pairs(nameplateTargets) do
|
||||||
local newTargetGUID = UnitGUID(unit.."-target")
|
local newTargetGUID = UnitGUID(unit.."-target")
|
||||||
if (newTargetGUID == nil and targetGUID ~= true)
|
if (newTargetGUID == nil and targetGUID ~= true)
|
||||||
or (newTargetGUID ~= nil and targetGUID ~= newTargetGUID)
|
or (newTargetGUID ~= nil and targetGUID ~= newTargetGUID)
|
||||||
then
|
then
|
||||||
nameplateTargets[unit] = newTargetGUID or true
|
nameplateTargets[unit] = newTargetGUID or true
|
||||||
WeakAuras.ScanEvents("WA_UNIT_TARGET_NAME_PLATE", unit)
|
WeakAuras.ScanEvents("WA_UNIT_TARGET_NAME_PLATE", unit)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
throttle_update = tick_throttle
|
|
||||||
end
|
end
|
||||||
|
throttle_update = tick_throttle
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Private.frames["Nameplate Target Handler"] = nameplateTargetFrame
|
Private.frames["Nameplate Target Handler"] = nameplateTargetFrame
|
||||||
function WeakAuras.WatchForNameplateTargetChange()
|
function WeakAuras.WatchForNameplateTargetChange()
|
||||||
if not nameplateTargetFrame then
|
if not nameplateTargetFrame then
|
||||||
nameplateTargetFrame = CreateFrame("Frame")
|
nameplateTargetFrame = CreateFrame("Frame")
|
||||||
nameplateTargetFrame:SetScript("OnUpdate", nameplateTargetOnUpdate)
|
nameplateTargetFrame:SetScript("OnUpdate", nameplateTargetOnUpdate)
|
||||||
nameplateTargetFrame:RegisterEvent("NAME_PLATE_UNIT_ADDED")
|
nameplateTargetFrame:RegisterEvent("NAME_PLATE_UNIT_ADDED")
|
||||||
nameplateTargetFrame:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
|
nameplateTargetFrame:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
|
||||||
nameplateTargetFrame:SetScript("OnEvent", nameplateTargetOnEvent)
|
nameplateTargetFrame:SetScript("OnEvent", nameplateTargetOnEvent)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3541,13 +3639,9 @@ do
|
|||||||
|
|
||||||
local function doCastScan(firetime, unit)
|
local function doCastScan(firetime, unit)
|
||||||
scheduled_scans[unit][firetime] = nil;
|
scheduled_scans[unit][firetime] = nil;
|
||||||
|
WeakAuras.ScanEvents("CAST_REMAINING_CHECK_" .. string.lower(unit), unit);
|
||||||
if unit:find("^nameplate%d+$") then
|
|
||||||
WeakAuras.ScanEvents("CAST_REMAINING_CHECK_nameplate", unit);
|
|
||||||
else
|
|
||||||
WeakAuras.ScanEvents("CAST_REMAINING_CHECK_" .. string.lower(unit), unit);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Private.ExecEnv.ScheduleCastCheck(fireTime, unit)
|
function Private.ExecEnv.ScheduleCastCheck(fireTime, unit)
|
||||||
scheduled_scans[unit] = scheduled_scans[unit] or {}
|
scheduled_scans[unit] = scheduled_scans[unit] or {}
|
||||||
if not(scheduled_scans[unit][fireTime]) then
|
if not(scheduled_scans[unit][fireTime]) then
|
||||||
|
|||||||
+40
-38
@@ -1156,7 +1156,7 @@ Private.load_prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
local function AddUnitChangeInternalEvents(triggerUnit, t, includePets)
|
local function AddUnitChangeInternalEvents(triggerUnit, t, includePets, unitisunit)
|
||||||
if (triggerUnit == nil) then
|
if (triggerUnit == nil) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -1164,16 +1164,6 @@ local function AddUnitChangeInternalEvents(triggerUnit, t, includePets)
|
|||||||
-- Handled by normal events"
|
-- Handled by normal events"
|
||||||
elseif triggerUnit == "pet" then
|
elseif triggerUnit == "pet" then
|
||||||
tinsert(t, "PET_UPDATE")
|
tinsert(t, "PET_UPDATE")
|
||||||
elseif (triggerUnit == "nameplate") then
|
|
||||||
tinsert(t, "UNIT_CHANGED_nameplate")
|
|
||||||
local nameplates = C_NamePlate.GetNamePlates()
|
|
||||||
if nameplates then
|
|
||||||
for i, unitData in pairs(nameplates) do
|
|
||||||
if unitData then
|
|
||||||
WeakAuras.WatchUnitChange("nameplate" .. i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if Private.multiUnitUnits[triggerUnit] then
|
if Private.multiUnitUnits[triggerUnit] then
|
||||||
local isPet
|
local isPet
|
||||||
@@ -1181,17 +1171,21 @@ local function AddUnitChangeInternalEvents(triggerUnit, t, includePets)
|
|||||||
isPet = WeakAuras.UnitIsPet(unit)
|
isPet = WeakAuras.UnitIsPet(unit)
|
||||||
if (includePets ~= nil and isPet) or (includePets ~= "PetsOnly" and not isPet) then
|
if (includePets ~= nil and isPet) or (includePets ~= "PetsOnly" and not isPet) then
|
||||||
tinsert(t, "UNIT_CHANGED_" .. string.lower(unit))
|
tinsert(t, "UNIT_CHANGED_" .. string.lower(unit))
|
||||||
WeakAuras.WatchUnitChange(unit)
|
if unitisunit then
|
||||||
|
tinsert(t, "UNIT_IS_UNIT_CHANGED_" .. string.lower(unit) .. "_" .. string.lower(unitisunit))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
tinsert(t, "UNIT_CHANGED_" .. string.lower(triggerUnit))
|
tinsert(t, "UNIT_CHANGED_" .. string.lower(triggerUnit))
|
||||||
WeakAuras.WatchUnitChange(triggerUnit)
|
if unitisunit then
|
||||||
|
tinsert(t, "UNIT_IS_UNIT_CHANGED_" .. string.lower(triggerUnit) .. "_" .. string.lower(unitisunit))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function AddWatchedUnits(triggerUnit, includePets)
|
local function AddWatchedUnits(triggerUnit, includePets, unitisunit)
|
||||||
if (triggerUnit == nil) then
|
if (triggerUnit == nil) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -1199,25 +1193,22 @@ local function AddWatchedUnits(triggerUnit, includePets)
|
|||||||
-- Handled by normal events"
|
-- Handled by normal events"
|
||||||
elseif triggerUnit == "pet" then
|
elseif triggerUnit == "pet" then
|
||||||
WeakAuras.WatchForPetDeath();
|
WeakAuras.WatchForPetDeath();
|
||||||
elseif (triggerUnit == "nameplate") then
|
|
||||||
local nameplates = C_NamePlate.GetNamePlates()
|
|
||||||
if nameplates then
|
|
||||||
for i, unitData in pairs(nameplates) do
|
|
||||||
if unitData then
|
|
||||||
WeakAuras.WatchUnitChange("nameplate" .. i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if Private.multiUnitUnits[triggerUnit] then
|
if Private.multiUnitUnits[triggerUnit] then
|
||||||
local isPet
|
local isPet
|
||||||
for unit in pairs(Private.multiUnitUnits[triggerUnit]) do
|
for unit in pairs(Private.multiUnitUnits[triggerUnit]) do
|
||||||
isPet = WeakAuras.UnitIsPet(unit)
|
isPet = WeakAuras.UnitIsPet(unit)
|
||||||
if (includePets ~= nil and isPet) or (includePets ~= "PetsOnly" and not isPet) then
|
if (includePets ~= nil and isPet) or (includePets ~= "PetsOnly" and not isPet) then
|
||||||
|
if unitisunit then
|
||||||
|
WeakAuras.WatchUnitChange(unitisunit)
|
||||||
|
end
|
||||||
WeakAuras.WatchUnitChange(unit)
|
WeakAuras.WatchUnitChange(unit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
if unitisunit then
|
||||||
|
WeakAuras.WatchUnitChange(unitisunit)
|
||||||
|
end
|
||||||
WeakAuras.WatchUnitChange(triggerUnit)
|
WeakAuras.WatchUnitChange(triggerUnit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1284,8 +1275,6 @@ local unitHelperFunctions = {
|
|||||||
tinsert(events, {"UNIT_CHANGED_" .. unit, unit})
|
tinsert(events, {"UNIT_CHANGED_" .. unit, unit})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif trigger.unit == "nameplate" then
|
|
||||||
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit})
|
|
||||||
else
|
else
|
||||||
if trigger.unit then
|
if trigger.unit then
|
||||||
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit, trigger.unit})
|
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit, trigger.unit})
|
||||||
@@ -1302,8 +1291,6 @@ local unitHelperFunctions = {
|
|||||||
tinsert(events, {"UNIT_CHANGED_" .. unit, unit})
|
tinsert(events, {"UNIT_CHANGED_" .. unit, unit})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif trigger.unit == "nameplate" then
|
|
||||||
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit})
|
|
||||||
else
|
else
|
||||||
if trigger.unit then
|
if trigger.unit then
|
||||||
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit, trigger.unit})
|
tinsert(events, {"UNIT_CHANGED_" .. trigger.unit, trigger.unit})
|
||||||
@@ -1403,15 +1390,12 @@ Private.event_prototypes = {
|
|||||||
internal_events = function(trigger)
|
internal_events = function(trigger)
|
||||||
local unit = trigger.unit
|
local unit = trigger.unit
|
||||||
local result = {}
|
local result = {}
|
||||||
AddUnitChangeInternalEvents(unit, result)
|
AddUnitChangeInternalEvents(unit, result, nil, trigger.use_unitisunit and trigger.unitisunit or nil)
|
||||||
AddUnitRoleChangeInternalEvents(unit, result)
|
AddUnitRoleChangeInternalEvents(unit, result)
|
||||||
if trigger.unitisunit then
|
|
||||||
AddUnitChangeInternalEvents(trigger.unitisunit, result)
|
|
||||||
end
|
|
||||||
return result
|
return result
|
||||||
end,
|
end,
|
||||||
loadFunc = function(trigger)
|
loadFunc = function(trigger)
|
||||||
AddWatchedUnits(trigger.unit, nil)
|
AddWatchedUnits(trigger.unit, nil, trigger.use_unitisunit and trigger.unitisunit or nil)
|
||||||
end,
|
end,
|
||||||
force_events = unitHelperFunctions.UnitChangedForceEvents,
|
force_events = unitHelperFunctions.UnitChangedForceEvents,
|
||||||
name = L["Unit Characteristics"],
|
name = L["Unit Characteristics"],
|
||||||
@@ -1439,19 +1423,23 @@ Private.event_prototypes = {
|
|||||||
values = "actual_unit_types_cast",
|
values = "actual_unit_types_cast",
|
||||||
desc = Private.actual_unit_types_cast_tooltip,
|
desc = Private.actual_unit_types_cast_tooltip,
|
||||||
test = "true",
|
test = "true",
|
||||||
store = true
|
store = true,
|
||||||
|
reloadOptions = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "unitisunit",
|
name = "unitisunit",
|
||||||
display = L["Unit is Unit"],
|
display = L["Unit is Unit"],
|
||||||
type = "unit",
|
type = "unit",
|
||||||
init = "UnitIsUnit(unit, extraUnit) == 1 and true or false",
|
init = "UnitIsUnit(unit, extraUnit) == 1 and true or false",
|
||||||
values = "actual_unit_types_with_specific",
|
values = function(trigger)
|
||||||
|
if Private.multiUnitUnits[trigger.unit] then
|
||||||
|
return Private.actual_unit_types
|
||||||
|
else
|
||||||
|
return Private.actual_unit_types_with_specific
|
||||||
|
end
|
||||||
|
end,
|
||||||
test = "unitisunit",
|
test = "unitisunit",
|
||||||
store = true,
|
|
||||||
conditionType = "bool",
|
|
||||||
desc = function() return L["Can be used for e.g. checking if \"boss1target\" is the same as \"player\"."] end,
|
desc = function() return L["Can be used for e.g. checking if \"boss1target\" is the same as \"player\"."] end,
|
||||||
enable = function(trigger) return not Private.multiUnitUnits[trigger.unit] end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "name",
|
name = "name",
|
||||||
@@ -5519,7 +5507,7 @@ Private.event_prototypes = {
|
|||||||
return result
|
return result
|
||||||
end,
|
end,
|
||||||
loadFunc = function(trigger)
|
loadFunc = function(trigger)
|
||||||
local unit = trigger.threatUnit
|
local unit = trigger.unit
|
||||||
if unit and unit ~= "none" then
|
if unit and unit ~= "none" then
|
||||||
AddWatchedUnits(unit)
|
AddWatchedUnits(unit)
|
||||||
end
|
end
|
||||||
@@ -7507,3 +7495,17 @@ Private.dynamic_texts = {
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Private.InternalEventByIDList = {
|
||||||
|
ITEM_COOLDOWN_STARTED = true,
|
||||||
|
ITEM_COOLDOWN_CHANGED = true,
|
||||||
|
ITEM_COOLDOWN_READY = true,
|
||||||
|
ITEM_SLOT_COOLDOWN_STARTED = true,
|
||||||
|
ITEM_SLOT_COOLDOWN_CHANGED = true,
|
||||||
|
ITEM_SLOT_COOLDOWN_READY = true,
|
||||||
|
ITEM_SLOT_COOLDOWN_ITEM_CHANGED = true,
|
||||||
|
SPELL_COOLDOWN_CHANGED = true,
|
||||||
|
SPELL_COOLDOWN_READY = true,
|
||||||
|
SPELL_CHARGES_CHANGED = true,
|
||||||
|
WA_UPDATE_OVERLAY_GLOW = true,
|
||||||
|
}
|
||||||
|
|||||||
+15
-6
@@ -789,12 +789,18 @@ if WeakAuras.isAwesomeEnabled() then
|
|||||||
Private.unit_types_bufftrigger_2.nameplate = L["Nameplate"]
|
Private.unit_types_bufftrigger_2.nameplate = L["Nameplate"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Private.actual_unit_types = {
|
||||||
|
player = L["Player"],
|
||||||
|
pet = L["Pet"],
|
||||||
|
target = L["Target"],
|
||||||
|
}
|
||||||
|
|
||||||
Private.actual_unit_types_with_specific = {
|
Private.actual_unit_types_with_specific = {
|
||||||
player = L["Player"],
|
player = L["Player"],
|
||||||
target = L["Target"],
|
target = L["Target"],
|
||||||
focus = L["Focus"],
|
focus = L["Focus"],
|
||||||
pet = L["Pet"],
|
pet = L["Pet"],
|
||||||
member = L["Specific Unit"]
|
member = L["Specific Unit"],
|
||||||
}
|
}
|
||||||
|
|
||||||
Private.actual_unit_types_cast = {
|
Private.actual_unit_types_cast = {
|
||||||
@@ -2870,9 +2876,9 @@ Private.multiUnitId = {
|
|||||||
["partypetsonly"] = true,
|
["partypetsonly"] = true,
|
||||||
["raid"] = true,
|
["raid"] = true,
|
||||||
}
|
}
|
||||||
--if WeakAuras.isAwesomeEnabled() then
|
if WeakAuras.isAwesomeEnabled() then
|
||||||
-- Private.multiUnitId["nameplate"] = true
|
Private.multiUnitId["nameplate"] = true
|
||||||
--end
|
end
|
||||||
|
|
||||||
Private.multiUnitUnits = {
|
Private.multiUnitUnits = {
|
||||||
["boss"] = {},
|
["boss"] = {},
|
||||||
@@ -2913,14 +2919,17 @@ end
|
|||||||
for i = 1, 40 do
|
for i = 1, 40 do
|
||||||
Private.baseUnitId["raid"..i] = true
|
Private.baseUnitId["raid"..i] = true
|
||||||
Private.baseUnitId["raidpet"..i] = true
|
Private.baseUnitId["raidpet"..i] = true
|
||||||
-- Private.baseUnitId["nameplate"..i] = true -- no need to restrict it, blizzard only allows 40 nameplates, we can get all.
|
|
||||||
-- Private.multiUnitUnits.nameplate["nameplate"..i] = true -- no need to restrict it, blizzard only allows 40 nameplates, we can get all.
|
|
||||||
Private.multiUnitUnits.group["raid"..i] = true
|
Private.multiUnitUnits.group["raid"..i] = true
|
||||||
Private.multiUnitUnits.raid["raid"..i] = true
|
Private.multiUnitUnits.raid["raid"..i] = true
|
||||||
Private.multiUnitUnits.group["raidpet"..i] = true
|
Private.multiUnitUnits.group["raidpet"..i] = true
|
||||||
Private.multiUnitUnits.raid["raidpet"..i] = true
|
Private.multiUnitUnits.raid["raidpet"..i] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i = 1, 100 do
|
||||||
|
Private.baseUnitId["nameplate"..i] = true
|
||||||
|
Private.multiUnitUnits.nameplate["nameplate"..i] = true
|
||||||
|
end
|
||||||
|
|
||||||
Private.dbm_types = {
|
Private.dbm_types = {
|
||||||
[1] = L["Add"],
|
[1] = L["Add"],
|
||||||
[2] = L["AOE"],
|
[2] = L["AOE"],
|
||||||
|
|||||||
@@ -3171,7 +3171,8 @@ function Private.HandleGlowAction(actions, region)
|
|||||||
if actions.glow_action
|
if actions.glow_action
|
||||||
and (
|
and (
|
||||||
(
|
(
|
||||||
(actions.glow_frame_type == "UNITFRAME" or (actions.glow_frame_type == "NAMEPLATE" and WeakAuras.isAwesomeEnabled()))
|
(actions.glow_frame_type == "UNITFRAME" or
|
||||||
|
actions.glow_frame_type == "NAMEPLATE")
|
||||||
and region.state.unit
|
and region.state.unit
|
||||||
)
|
)
|
||||||
or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame)
|
or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame)
|
||||||
@@ -5405,7 +5406,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.UntrackableUnit(unit)
|
function WeakAuras.UntrackableUnit(unit)
|
||||||
return not (trackableUnits[unit] or unit:find("^nameplate%d+$"))
|
return not trackableUnits[unit]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -801,7 +801,7 @@ local function GetBuffTriggerOptions(data, triggernum)
|
|||||||
name = L["Filter by Nameplate Type"],
|
name = L["Filter by Nameplate Type"],
|
||||||
order = 69.1,
|
order = 69.1,
|
||||||
hidden = function() return
|
hidden = function() return
|
||||||
not (trigger.type == "aura2" and (WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate"))
|
not (trigger.type == "aura2" and trigger.unit == "nameplate")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
hostility = {
|
hostility = {
|
||||||
@@ -817,7 +817,7 @@ local function GetBuffTriggerOptions(data, triggernum)
|
|||||||
name = "",
|
name = "",
|
||||||
order = 69.3,
|
order = 69.3,
|
||||||
width = WeakAuras.normalWidth,
|
width = WeakAuras.normalWidth,
|
||||||
hidden = function() return not (trigger.type == "aura2" and (WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate") and not trigger.useHostility) end
|
hidden = function() return not (trigger.type == "aura2" and trigger.unit == "nameplate" and not trigger.useHostility) end
|
||||||
},
|
},
|
||||||
|
|
||||||
useNpcId = {
|
useNpcId = {
|
||||||
@@ -826,14 +826,14 @@ local function GetBuffTriggerOptions(data, triggernum)
|
|||||||
name = L["Filter by Npc ID"],
|
name = L["Filter by Npc ID"],
|
||||||
order = 69.31,
|
order = 69.31,
|
||||||
hidden = function() return
|
hidden = function() return
|
||||||
not (trigger.type == "aura2" and (WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate"))
|
not (trigger.type == "aura2" and trigger.unit == "nameplate")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
npcId = {
|
npcId = {
|
||||||
type = "input",
|
type = "input",
|
||||||
width = WeakAuras.normalWidth,
|
width = WeakAuras.normalWidth,
|
||||||
name = L["Npc ID"],
|
name = L["Npc ID"],
|
||||||
hidden = function() return not (trigger.type == "aura2" and WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate" and trigger.useNpcId) end,
|
hidden = function() return not (trigger.type == "aura2" and trigger.unit == "nameplate" and trigger.useNpcId) end,
|
||||||
order = 69.32,
|
order = 69.32,
|
||||||
desc = L["Supports multiple entries, separated by commas"]
|
desc = L["Supports multiple entries, separated by commas"]
|
||||||
},
|
},
|
||||||
@@ -842,7 +842,7 @@ local function GetBuffTriggerOptions(data, triggernum)
|
|||||||
name = "",
|
name = "",
|
||||||
order = 69.33,
|
order = 69.33,
|
||||||
width = WeakAuras.normalWidth,
|
width = WeakAuras.normalWidth,
|
||||||
hidden = function() return not (trigger.type == "aura2" and WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate" and not trigger.useNpcId) end
|
hidden = function() return not (trigger.type == "aura2" and trigger.unit == "nameplate" and not trigger.useNpcId) end
|
||||||
},
|
},
|
||||||
|
|
||||||
ignoreSelf = {
|
ignoreSelf = {
|
||||||
@@ -850,7 +850,7 @@ local function GetBuffTriggerOptions(data, triggernum)
|
|||||||
name = L["Ignore Self"],
|
name = L["Ignore Self"],
|
||||||
order = 69.35,
|
order = 69.35,
|
||||||
width = WeakAuras.doubleWidth,
|
width = WeakAuras.doubleWidth,
|
||||||
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" or (WeakAuras.isAwesomeEnabled() and trigger.unit == "nameplate"))) end
|
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" or trigger.unit == "nameplate")) end
|
||||||
},
|
},
|
||||||
|
|
||||||
ignoreDead = {
|
ignoreDead = {
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ function OptionsPrivate.CreateFrame()
|
|||||||
local awesomeWotlkButton
|
local awesomeWotlkButton
|
||||||
if not WeakAuras.isAwesomeEnabled() then
|
if not WeakAuras.isAwesomeEnabled() then
|
||||||
awesomeWotlkButton = addFooter("Awesome WotLK", [[Interface\AddOns\WeakAuras\Media\Textures\GitHub.tga]], "https://github.com/FrostAtom/awesome_wotlk",
|
awesomeWotlkButton = addFooter("Awesome WotLK", [[Interface\AddOns\WeakAuras\Media\Textures\GitHub.tga]], "https://github.com/FrostAtom/awesome_wotlk",
|
||||||
L["Unlock Nameplate units in WeakAuras with awesome_wotlk binary patch!"])
|
L["Unlock Nameplate anchoring and units in WeakAuras with awesome_wotlk client patch!"])
|
||||||
awesomeWotlkButton:SetParent(tipFrame)
|
awesomeWotlkButton:SetParent(tipFrame)
|
||||||
awesomeWotlkButton:SetPoint("LEFT", documentationButton, "RIGHT", 10, 0)
|
awesomeWotlkButton:SetPoint("LEFT", documentationButton, "RIGHT", 10, 0)
|
||||||
end
|
end
|
||||||
@@ -1386,10 +1386,8 @@ function OptionsPrivate.CreateFrame()
|
|||||||
|
|
||||||
for _, id in ipairs(batchSelection) do
|
for _, id in ipairs(batchSelection) do
|
||||||
if not alreadySelected[id] then
|
if not alreadySelected[id] then
|
||||||
if displayButtons[id].frame:IsVisible() then
|
displayButtons[id]:Pick()
|
||||||
displayButtons[id]:Pick()
|
tinsert(tempGroup.controlledChildren, id)
|
||||||
tinsert(tempGroup.controlledChildren, id)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
frame:ClearOptions(tempGroup.id)
|
frame:ClearOptions(tempGroup.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user