fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched #3218
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3218
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/widescreen-overlay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On a picture wider than 16:9 with Ultrawide menus at Centred (blurred sides or black bars), the system screens' header and button prompts are stretched sideways: the file select's Back, the save screen's prompts, Options'. To see it on
main: 21:9, Ultrawide menus Centred, title screen > Continue, the "Load" header and the prompt at the bottom right.The Centred modes keep the system overlay (
SystemOverlay_00) over the whole picture because it also draws the item wheel's background, so everything in it is drawn ratio / (16/9) as wide as it should be (1.34 at 21:9), and its prompts land behind the blurred sides. This keeps the overlay whole and draws two of its panes,N_Header_00andN_Footer_00, at their own shape in the middle 16:9, with the rest of the menu. "Full width" still stretches, as it asks to. "Extended" already plans the overlay and is unchanged.Read first:
Rule::Squeezeingame/mods/widescreen/src/names.rs,whole_squeezeinui.rs,placedandnote_squeezedinpanes.rs.This replaces #2817 (opened against
mod-api, closed); the same commit, onmain.Testing
Tested: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, played by hand in a build of
mainf359e2621with this commit and #2642's clickable prompts (the clicks' PR is separate; this commit does not need it). Title screen > Continue: the "Load" header and Back are in the middle 16:9 at their own shape, not stretched; saving from the System tab: the prompts sit in the middle, over the menu, not behind the blurred sides. The same run onmain+ #2642 alone, earlier the same day: Back stretched on Load, the save prompts behind the blurred sides.cargo fmt --check,cargo testandcargo clippyofsysmod-widescreen: queued on this PC behind other builds; their results follow as a comment.Still to test:
Measurements
Not measured: a layout being built costs one more name check (its root's); the two panes' matrices are set where the mod already sets the layout's.
Risks
The Widescreen mod only: a pane of
SystemOverlay_00that is not under its header or footer keeps its place. No setting, save or cache changes; a revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). Not run whole yet: the crate's tests above.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here (a_system_overlay_kept_whole_has_its_header_and_prompts_at_their_own_shape_in_the_middle).mainand here, for a change that shows on screen. None yet: the run was played by hand.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, by hand on main
f359e2621+ this + #2642's clicks: title > Continue's Load header and Back in the middle 16:9, unstretched; the save prompts over the menu, not behind the blurred sides (both were wrong in the same build without this commit).WIP: fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretchedto fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretchedRecommendation: Approve. The fix corrects the reported layout in the author's 21:9 run, but restarting the widescreen mod misses existing overlay panes. The remaining affected screen layouts also need a visual check. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change keeps the system overlay over the full picture while squeezing its header and footer into the centered 16:9 area. It adds a small amount of layout bookkeeping, but that bookkeeping does not cover mod shutdown and restart.
Should fix (1): not blocking, but worth doing before merging.
game/mods/widescreen/src/sites.rs:170: The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist. (more on the line) Do: Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
game/mods/widescreen/src/panes.rs:174: The visual change still needs the remaining layout cases checked. (more on the line) Do: Run those cases once in game and provide before-and-after screenshots of the same affected screen.@fixcan do L1.Questions (1) (not confirmed from the code; they don't hold the recommendation)
game/mods/widescreen/src/panes.rs:174: Does marking the overlay's root transform dirty cause the game to recalculate the footer's transform on the next pass?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports that the Load header and Back prompt were stretched on main and correctly shaped with this change at 3440×1440 on Windows with an RTX 3080. Save prompts also moved over the menu. Other aspect ratios and the item wheel remain untested.
Other systems: The change affects system overlay layouts on Windows and Linux, including centered menus and the item wheel. Extended and full-width modes follow different mask paths; the added unit test covers full width but not Extended or live mod reload.
Switches: None added, changed or removed.
Reviewed:
0d7807bfa3againstf359e26213: Read AGENTS.md, CONTRIBUTING.md, the available standards and pull request template, the commit and diff, and the changed code with its layout, state, mask and lifecycle callers. Skimmed existing tests and related layout helpers; no recorded runs, translations or generated files were changed. docs/review-checklist.md was not present.; nothing run (a code review).Checked and fine:
Testing: No code, tests or project scripts were run, as requested. The supplied CI checks are still running.
Overlaps and merge order: The description says this replaces closed PR #2817; #2642 is separate and was present in the author's run.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as dyst took it out of WIP. Nothing was run; a maintainer decides.
@ -171,2 +171,4 @@return; // (off: the transforms are the game's)}let squeeze = self.shape.whole_squeeze;if squeeze < 1.0 && self.squeezed.iter().any(|&(p, l)| p == pane && mem.alive(p, l)) {L2 (should fix): The visual change still needs the remaining layout cases checked.
When: The reported run covers 21:9 Load and save prompts, but does not show Options, the item wheel background, or the 32:9 and narrower layouts named in Still to test.
Do: Run those cases once in game and provide before-and-after screenshots of the same affected screen.
@ -167,6 +167,7 @@ fn picture_draw(cx: &mut SiteCx<'_, '_>) -> i32 {/// `ui.layoutBuilt`: a list widened as it is built.fn layout_built(cx: &mut SiteCx<'_, '_>) -> i32 {let layout = wide::site_built(cx.guest()).0;with_ui(|ui| ui.note_squeezed(&GameMem, layout));L1 (should fix): The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist.
When: If the widescreen system mod is reloaded while SystemOverlay_00 remains built, release clears the list and the new handler receives no layoutBuilt event for that existing layout. Subsequent placements therefore do not squeeze its header or footer, leaving the reported stretching until the layout is rebuilt.
Do: Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay.
Checks on this PC (Windows 11, Rust 1.99.1 gnullvm), on the head
0d7807bfa:cargo fmt --check -p sysmod-widescreenclean;cargo test -p sysmod-widescreen61 passed, 0 failed;cargo clippy -p sysmod-widescreen --all-targetsnothing in this crate (its four warnings are main's, inbuild-core,build-assetsandhost-sys). The same with #3219's commit beneath it: the same results, andgame-core411 passed.On BeanBot's review 3379 (merged at
0d7807bfa), followed up in #3281:setEnabled, as the Mods tab's switch does), the header and Back were stretched across the whole picture at 21:9, Centred, until the overlay was built again. The overlay is built once at boot, so in practice that means until the game restarts. A layout's root, the first time it is placed, now has its squeezed panes noted; the start's forced pass places the root before the panes made from it.ui.calcDirtyandui.paneDirtygive every pane the transform bit for a few frames, so the header and footer are remade and placed directly. But the mod's stop marked only the panes it notes (the overlay's root), and in game the header and Back stayed squeezed with the mod off. The follow-up marks every pane of a layout with squeezed panes as the mod stops.