Fix(Unit Frames): apply a SharedMedia font that registers after the login build - #1914
Open
dfrisone wants to merge 2 commits into
Open
Fix(Unit Frames): apply a SharedMedia font that registers after the login build#1914dfrisone wants to merge 2 commits into
dfrisone wants to merge 2 commits into
Conversation
…n build A custom font loaded through SharedMedia applied everywhere except the unit frames, and toggling Dark Mode off and on fixed it for the session. Unit frame text is fonted only while frames are built, from a path this module snapshots into a local; every other module resolves through the shared font cache on each repaint, so a late registration heals them on their own. A pack that registers after the login build leaves the unit frames on the fallback face until something calls ReloadFrames. Rebuild when a SharedMedia font registration changes what the unit frame font resolves to, deferred a tick and coalesced.
ReloadFrames re-resolves the module's font snapshot before its own combat lockdown return, so comparing against that snapshot read as settled after a reload in combat and the repaint was never retried. Track the path last actually repainted instead, and re-arm on PLAYER_REGEN_ENABLED when the rebuild is blocked, matching RealiseClassPowerStyle. The local cache drop is gone with it: the core's own receiver runs synchronously on registration, a tick before this check.
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.
Bug: reported by Discord user @boeckske_agentzero23 in the EllesmereUI bug channel (2026-08-28, on the current release).
Issue: a font loaded through a custom font loader and picked as the general font applies everywhere in the UI except the unit frames, which stay on the fallback face. A bundled EUI font applies normally, and setting the font override on the Unit Frames card instead of the global font makes no difference. Toggling Dark Mode off and on fixes the unit frames for the session, which is the tell: the font resolves correctly by then, so this is timing rather than resolution.
Root cause: the unit frames module keeps the resolved path in a local, cachedFontPath, refreshed only by ResolveFontPath from OnInitialize, ReloadFrames and the options page, and SetFSFont reads it through GetSelectedFont. Every sibling module calls EllesmereUI.GetFontPath at paint time instead, so when a late LibSharedMedia_Registered drops the shared font cache they pick the new face up on their next repaint. Unit frames never re-read, so a SharedMedia pack that registers after the login build, either from a PLAYER_LOGIN handler dispatching later than ours or on demand, leaves only the unit frames on the fallback face until something calls ReloadFrames, which is what the Dark Mode toggle does. Bundled fonts resolve out of FONT_FILES with no SharedMedia involvement, which is why they always worked, and a per-module override fails identically because it walks the same GetFontPath("unitFrames").
Fix: the module registers its own LibSharedMedia_Registered receiver. On a font registration it re-resolves and calls ns.ReloadFrames only when the path changed, so a login with no SharedMedia font in play does no work at all. Two details matter. The check is deferred a tick, because ns.ReloadFrames is assigned from a C_Timer.After(0) inside EnableBody and a registration arriving during the login dispatch would otherwise find it missing; the same tick also puts the check after the core's own receiver, which is what repopulates _smFontPaths. And what it tracks as done is the path last actually repainted, never the module snapshot: ReloadFrames refreshes that snapshot before its own InCombatLockdown return, so after a reload in combat the snapshot would match while nothing had been painted and no retry would ever fire. A rebuild blocked by lockdown re-arms on PLAYER_REGEN_ENABLED through its own frame, the same shape RealiseClassPowerStyle uses a few lines above for the same reason.
Not yet verified in game.