Skip to content

Commit

Permalink
Don't pre-load in raid init scripts for auras with an encounterId loa…
Browse files Browse the repository at this point in the history
…d option
  • Loading branch information
mrbuds committed Oct 30, 2024
1 parent 85e025c commit 96c633e
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,6 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon)
db.migrationCutoff = db.migrationCutoff or 730
db.historyCutoff = db.historyCutoff or 730

Private.UpdateCurrentInstanceType();
Private.SyncParentChildRelationships();
local isFirstUIDValidation = db.dbVersion == nil or db.dbVersion < 26;
Private.ValidateUniqueDataIds(isFirstUIDValidation);
Expand Down Expand Up @@ -1415,7 +1414,6 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon)
timer:ScheduleTimer(function() squelch_actions = false; end, remainingSquelch); -- No sounds while loading
end
CreateTalentCache() -- It seems that GetTalentInfo might give info about whatever class was previously being played, until PLAYER_ENTERING_WORLD
Private.UpdateCurrentInstanceType();
Private.InitializeEncounterAndZoneLists()
end
Private.PostAddCompanion()
Expand Down Expand Up @@ -1543,48 +1541,6 @@ local function CreateEncounterTable(encounter_id)
return WeakAuras.CurrentEncounter
end

local encounterScriptsDeferred = {}
local function LoadEncounterInitScriptsImpl(id)
if (currentInstanceType ~= "raid") then
return
end
if (id) then
local data = db.displays[id]
if (data and data.load.use_encounterid and not Private.IsEnvironmentInitialized(id) and data.actions.init and data.actions.init.do_custom) then
Private.ActivateAuraEnvironment(id)
Private.ActivateAuraEnvironment(nil)
end
encounterScriptsDeferred[id] = nil
else
for id, data in pairs(db.displays) do
if (data.load.use_encounterid and not Private.IsEnvironmentInitialized(id) and data.actions.init and data.actions.init.do_custom) then
Private.ActivateAuraEnvironment(id)
Private.ActivateAuraEnvironment(nil)
end
end
end
end

local function LoadEncounterInitScripts(id)
if not WeakAuras.IsLoginFinished() then
if encounterScriptsDeferred[id] then
return
end
loginQueue[#loginQueue + 1] = {LoadEncounterInitScriptsImpl, {id}}
encounterScriptsDeferred[id] = true
return
end
LoadEncounterInitScriptsImpl(id)
end

function Private.UpdateCurrentInstanceType(instanceType)
if (not IsInInstance()) then
currentInstanceType = "none"
else
currentInstanceType = instanceType or select (2, GetInstanceInfo())
end
end

local pausedOptionsProcessing = false;
function Private.pauseOptionsProcessing(enable)
pausedOptionsProcessing = enable;
Expand Down Expand Up @@ -1732,8 +1688,7 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
specId, role, position = Private.LibSpecWrapper.SpecRolePositionForUnit("player")
end

local size, difficulty, instanceType, instanceId, difficultyIndex= GetInstanceTypeAndSize()
Private.UpdateCurrentInstanceType(instanceType)
local size, difficulty, instanceType, instanceId, difficultyIndex = GetInstanceTypeAndSize()

if (WeakAuras.CurrentEncounter) then
if (instanceId ~= WeakAuras.CurrentEncounter.zone_id and not inCombat) then
Expand All @@ -1742,10 +1697,6 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
end
end

if (event == "ZONE_CHANGED_NEW_AREA") then
LoadEncounterInitScripts();
end

local group = Private.ExecEnv.GroupType()
local groupSize = GetNumGroupMembers()

Expand Down Expand Up @@ -3219,8 +3170,6 @@ function pAdd(data, simpleChange)
activatedConditions = {},
};

LoadEncounterInitScripts(id);

if (WeakAuras.IsOptionsOpen()) then
Private.FakeStatesFor(id, visible)
end
Expand Down

0 comments on commit 96c633e

Please sign in to comment.