From 96c633e9e980082bfd6292f708070e0a85b521d0 Mon Sep 17 00:00:00 2001 From: Buds Date: Mon, 7 Oct 2024 18:57:39 +0200 Subject: [PATCH] Don't pre-load in raid init scripts for auras with an encounterId load option --- WeakAuras/WeakAuras.lua | 53 +---------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index dec05084e7..95c920c837 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -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); @@ -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() @@ -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; @@ -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 @@ -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() @@ -3219,8 +3170,6 @@ function pAdd(data, simpleChange) activatedConditions = {}, }; - LoadEncounterInitScripts(id); - if (WeakAuras.IsOptionsOpen()) then Private.FakeStatesFor(id, visible) end