fix: guard secret unit frame values and optimize portrait fallback#1830
Closed
mjodheim wants to merge 11 commits into
Closed
fix: guard secret unit frame values and optimize portrait fallback#1830mjodheim wants to merge 11 commits into
mjodheim wants to merge 11 commits into
Conversation
…UI side and optimize aura highlight
This reverts commit 9b16ac8.
…p hooks Removed EmbeddedItemTooltip_SetItemByQuestReward and EmbeddedItemTooltip_SetSpellByQuestReward hooks. In WoW Midnight (12.x), EmbeddedItemTooltip_UpdateSize receives secret frame sizes; running that code path through ElvUI's hooked execution taints arithmetic and causes SetWidth to reject the secret value. Also reverts a previous workaround (GameTooltip_AddWidgetSet wrapper via securecallfunction) that was applied only to installed files. That wrapper was counterproductive: replacing the global with a tainted closure taints the call even when Blizzard's untainted AreaPoiUtil.lua is the caller, causing the very crash it was meant to prevent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ust model retry The HasPortraitModel guard (secretGUID and not HasPortraitModel) was too conservative: when switching targets, the previous unit's 3D model stayed loaded, so HasPortraitModel returned true and the 2D fallback was never shown — leaving a stale portrait from the prior target. For secret-GUID units, always clear the model and show the 2D texture on genuine unit changes (needsLoad=true). The OnModelLoaded hook and RetryPortraitModel loop will dismiss the fallback once a 3D model successfully streams in. Also introduces RetryPortraitModel (ClearModel+SetUnit loop up to 10 attempts) and HidePortraitFallbackIfLoaded to make 3D model loading more reliable when streaming is slow, and cleans up retry state on GUID change and on the unavailable (question-mark) path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SetUnit("target") for a non-grouped instance NPC with a secret GUID
loads a stale cached model from Midnight's model cache (typically the
previous target's portrait). This makes the old 3D portrait persist and
hides the 2D fallback, despite ClearModel having been called.
The 2D texture fallback is the correct and permanent solution for secret-
GUID units. Split the needsLoad path: secret-GUID units get ClearModel
+ 2D fallback only; non-secret units get SetUnit + RetryPortraitModel.
Also call HidePortraitFallback before SetUnit on the non-secret path so
a stale 2D texture from a previous secret unit is cleared immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ction Instead of permanently skipping SetUnit for secret-GUID units (non-grouped instance NPCs), show a 2D cover frame immediately and simultaneously try to load the NPC's 3D model. If the model file ID changes after SetUnit, the real NPC model streamed in — hide the cover and show 3D. If the ID stays the same (stale cache hit) or no OnModelLoaded fires, the 2D cover stays visible, masking any wrong model. Key design decisions: - Fallback2D is now a child Frame (frame level +5) placed above the PlayerModel, so it renders on top of any stale 3D content regardless of draw layers. - SetUnit is called WITHOUT ClearModel to preserve the current model as a placeholder while the NPC model streams asynchronously. - secretPreloadModelID snapshots the file ID before SetUnit so OnModelLoadedCheck can distinguish a real new load from a stale hit. - needsLoad excludes needsModel and newGUID for secret-GUID units since secret values are always unequal; genuine triggers remain (prevState, OnShow, non-noUnitChange events) to avoid OnUpdate storm. - hasSecretUnit is set at function entry so all helpers (including HidePortraitFallbackIfLoaded) skip their hide logic for secret units. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Superseded by smaller, focused PRs rebased on current main: #1843 (secret-value taint: fade alpha, raid frames, menu skin, quest tooltips), #1844 (2D portrait fallback, draft), and #1845 (nil-safe aura/range iteration + pet spell-load caching). This branch had drifted ~157 commits behind main; closing in favor of those. |
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
In WoW Midnight, unit-frame values (such as GUIDs, class info, item levels, nameplate variables, etc.) can be secret or temporarily unavailable in instanced content, which led to:
AsyncCallbackSystem.lua.Resolution
This PR addresses all previous maintainer feedback from PR #1826 and PR #1829:
Pristine stock oUF (Objection 1 Resolved):
ElvUI_Libraries/Game/Shared/oUF/elements/portrait.lua), keeping the library 100% pristine and untouched.Overridehook insideElvUI/Game/Shared/Modules/UnitFrames/Elements/Portrait.lua(portrait.Override = UF.PortraitOverride).E:IsSecretValue) cleanly within ElvUI.Optimized Aura Highlight iteration (Objection 2 Resolved):
checked > 40loop count limit fromoUF_AuraHighlight.lua. The looper now executes naturally and efficiently on the cached filtered list.Range Checks Guard:
ElvUI/Game/Shared/Modules/UnitFrames/Elements/Range.luato safely handlenilranges or lists when values are temporarily unavailable.Pet Bar callback guard:
spellIDchanges, with stale callbacks cancelled when the spell changes, disappears, or the bar hides.