Arena: stop early GetContentType calls from destroying the reload hint#156
Open
Krathe82 wants to merge 1 commit into
Open
Arena: stop early GetContentType calls from destroying the reload hint#156Krathe82 wants to merge 1 commit into
Krathe82 wants to merge 1 commit into
Conversation
The ARENA RELOAD FIX fallback (trust the saved lastContentType hint while IsInInstance() recovers after a reload) was being defeated by its own neighbours: on a reload, FinalizeHeaderInit -> UpdateHeaderVisibility calls GetContentType at ADDON_LOADED -- before PLAYER_ENTERING_WORLD arms useContentTypeFallback. If WoW's APIs weren't ready yet, that early call either nil'd DandersFramesCharDB.lastContentType (not-in-raid branch) or overwrote it with "openWorld" (in-raid + instanceType "none"), destroying the hint in exactly the scenario it exists for. Out of combat the ArenaDetectionRetry/ARENA_PREP backups recover; on a combat reload mid-round the arena frames could stay hidden until the round ended. - Snapshot the hint once at load (ADDON_LOADED, plus a self-capture in GetContentType for safety) and read the fallback from the snapshot, so later live-field writes can't destroy it. - Arm the fallback at ADDON_LOADED on a /reload (player already exists at ADDON_LOADED only on a reload -- same detection the header init uses), so the combat-safe FinalizeHeaderInit window already benefits. Fresh logins still never arm it: a stale "arena" hint from a previous session would misclassify the login zone. - Extend the fallback to the IsInRaid()==true + instanceType "none" case: IsInRaid() can recover before IsInInstance() after an arena reload (arena groups ARE raid groups), which previously classified the arena as "openWorld" and showed raid frames over the arena header.
2c5cf32 to
345b74a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The existing ARENA RELOAD FIX (trust the saved
lastContentTypehint whileIsInInstance()recovers after a reload) was being defeated by its own neighbours, leaving the arena header hidden after a reload in arena — worst case on a combat reload mid-round, where the frames could stay hidden until the round ended.Sequence:
FinalizeHeaderInit→UpdateHeaderVisibilitycallsGetContentType()at ADDON_LOADED — before PLAYER_ENTERING_WORLD armsuseContentTypeFallback.DandersFramesCharDB.lastContentType(not-in-raid branch) or overwrites it with "openWorld" (in-raid + instanceType "none" — arena groups are raid groups, andIsInRaid()can recover beforeIsInInstance()).Out of combat, the ArenaDetectionRetry / ARENA_PREP backups recover. Mid-combat they can't (secure Show is blocked), so the one window that can fix it — the combat-safe ADDON_LOADED window the addon already uses for combat reloads — ran with a wrong content type.
Fix
DF._contentTypeHintAtLoad, captured in Core's ADDON_LOADED handler plus a self-capture inGetContentTypefor ordering safety) and read the fallback from the snapshot, so later live-field writes can't destroy it.FinalizeHeaderInitwindow already resolves "arena" and can show the arena header. Fresh logins still never arm it: a stale "arena" hint from a previous session would misclassify the login zone, and the fallback only clears once real detection returns a definite answer.IsInRaid()==true+ instanceType "none" case, which previously classified an arena reload as "openWorld" and showed raid frames over the arena header.No behaviour change outside the reload-recovery window: the first confident
IsInInstance()/roster read clears the fallback and resumes normal detection, exactly as before.Testing