added pvp status for for load auras

This commit is contained in:
Bunny67
2021-03-08 12:58:34 +03:00
parent cc4f2a33b6
commit 47eb74ed3d
2 changed files with 14 additions and 2 deletions
+9
View File
@@ -759,6 +759,15 @@ Private.load_prototype = {
optional = true,
events = {"PLAYER_DEAD", "PLAYER_ALIVE", "PLAYER_UNGHOST"}
},
{
name = "pvpmode",
display = L["PvP Mode Active"],
type = "tristate",
init = "arg",
width = WeakAuras.normalWidth,
optional = true,
events = {"PLAYER_FLAGS_CHANGED", "UNIT_FACTION", "ZONE_CHANGED"}
},
{
name = "never",
display = L["Never"],
+5 -2
View File
@@ -1202,6 +1202,7 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
local inCombat = UnitAffectingCombat("player") -- or UnitAffectingCombat("pet");
local alive = not UnitIsDeadOrGhost('player')
local pvp = UnitIsPVPFreeForAll("player") or UnitIsPVP("player")
local vehicle = UnitInVehicle("player") or UnitOnTaxi("player")
local vehicleUi = UnitHasVehicleUI("player")
@@ -1218,8 +1219,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
if (data and not data.controlledChildren) then
local loadFunc = loadFuncs[id];
local loadOpt = loadFuncsForOptions[id];
shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, vehicle, vehicleUi, group, player, realm, class, faction, playerLevel, zone, zoneId, size, difficulty);
couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, vehicle, vehicleUi, group, player, realm, class, faction, playerLevel, zone, zoneId, size, difficulty);
shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, group, player, realm, class, faction, playerLevel, zone, zoneId, size, difficulty);
couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, group, player, realm, class, faction, playerLevel, zone, zoneId, size, difficulty);
if(shouldBeLoaded and not loaded[id]) then
changed = changed + 1;
@@ -1299,6 +1300,7 @@ loadFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
loadFrame:RegisterEvent("PLAYER_DEAD")
loadFrame:RegisterEvent("PLAYER_ALIVE")
loadFrame:RegisterEvent("PLAYER_UNGHOST")
loadFrame:RegisterEvent("PLAYER_FLAGS_CHANGED")
local unitLoadFrame = CreateFrame("FRAME");
WeakAuras.unitLoadFrame = unitLoadFrame;
@@ -1307,6 +1309,7 @@ WeakAuras.frames["Display Load Handling 2"] = unitLoadFrame;
unitLoadFrame:RegisterEvent("UNIT_FLAGS");
unitLoadFrame:RegisterEvent("UNIT_ENTERED_VEHICLE");
unitLoadFrame:RegisterEvent("UNIT_EXITED_VEHICLE");
unitLoadFrame:RegisterEvent("UNIT_FACTION");
function Private.RegisterLoadEvents()
loadFrame:SetScript("OnEvent", function(frame, ...)