fix(ui): the text box's choices stay on a 16:10 or narrower screen #1233
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1233
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/held-choices-narrow"
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?
Type: fix · Risk: low · Tested on: Windows 10, RTX 4090 · Needs: none
Why
On a screen narrower than 16:9 (16:10 such as 1920x1200, 3:2, 4:3, 5:4), the answers you pick from in a conversation run off the right edge of the screen: their boxes are cut, and at 4:3 their text too ("Onde fica o caste..."). It happens in every conversation with choices, in every language, since #95 laid the HUD out for each screen shape. Fixes #1050.
How to reproduce
Seen on: Windows 10 22H2, RTX 4090, NVIDIA 617.42 (the report: Windows 11, RTX 5060 Laptop, a 1920x1200 display)
Settings and switches: Output resolution 1920x1200 (or
HOS_OUTPUT_RES=1920x1200), Aspect ratio the monitor's shape; any language (the runs were in pt-BR, the report's)Steps: load any save, go to the Market (the Cheats page's teleport, or the control bridge's
teleport Market_Child), talk to the guard at the gate: "Precisa de alguma coisa?" / "Need anything?" and three choicesExpected: the three choices whole on the screen, as at 16:9
Actual: on main their boxes are cut at the right edge, and the column's scroll hint (the ↑ key) is off the screen; at 4:3 the texts are cut too
What changed
The text box (
MessageDialog_00) is held where the game puts it, at the HUD's size (#95), but its choices sit in a column at the right edge of the game's 16:9 canvas. Down to 3:2 the HUD keeps its 16:9 size, so that canvas is wider than the screen and the column was left past the screen's edge. The column now moves in to the screen's right side exactly as far as the HUD's own side panes do, so it keeps the distance from the edge it has at 16:9; the box under it stays where it is, and nothing moves on a wider screen.host/hos_wide_ui.c): a new rule,RULE_HELD_RIGHT, for one pane by name,MessageDialog_00'sN_BtnNum_00(the choices' column; in the game's file its boxes reach x 1930 of the 3840-wide canvas).plan()gives it the HUD's side moveui_exonly when that is a move in (ui_ex < 0: 16:10 and narrower). For it to be placed, the held layout's panes are now noted as a tree (hos_wide_ui_placed:n->treeforLK_HELD); the planner still walks none of them (visitskips anything notLK_PLAIN), so nothing else in the text box moves.tests/test_hud_layout.py, its own commit before the fix): the fixture's text box is now shaped like the game's: the box across the middle, the column at 1460 and a 940-wide choice made from it. It checks the column at 21:9 (held), 16:10 and 4:3 (moved in by the HUD's side move, its choice following without moving twice, as far from the screen's edge as at 16:9), the box held at every shape, and at every shape from 5:4 to 48:9 the choices no further past the edge than at 16:9. The old 4:3 check asserted the choice unmoved, the position that is cut off.docs/tested/2026-11-16-held-choices-cuecuemoar-run01.mdtorun06): main and this change at 16:10, 4:3 and 21:9.Measurements
Verdict: fixed: on main the choices are cut at the right edge at 16:10 and 4:3; with this change they are whole, with their scroll hint, and at 21:9 they are where main puts them. The game-free check fails on main and passes here. Nothing to measure for speed: the plan's time a present is the same (0.04 to 0.06 ms with a text box open, both sides).
Hardware: Windows 10 Pro 22H2 (19045), RTX 4090 24 GB, NVIDIA 617.42, Core i9-13900K, 32 GB
Scene: the Market gate guard's question and its three choices;
HOS_OUTPUT_RES1920x1200, 1440x1080 and 2560x1080, headless (offscreen, scripted input through the control bridge), pt-BR, otherwise defaultsMethod: the
kokiri-startrepository save,teleport Market_Child, the guard talked to, a screenshot of the choices (RX_VK_SHOT_W/_Hat the output size) and the plan's log (HOS_WIDE_UI_LOG=400); one run each way at each shape, plus a second main run at 16:10How to reproduce: as above;
scripts/dev_packs.pybase of maine090cc48and this change as a pack over it (see Testing for the commits)Baseline: main
e090cc48, main's head when the runs were made; the PR is now on623a0ca3. The runs still hold there: none of the 188 commits between them changeshost/hos_wide_ui.c, and of the other files the text box's drawing goes through,nx2/oot_wide.pygained only the NPC speech bubbles' site (#1191, its own layout,BalloonMessage_00) andhost/rx_backend.conly audio and options changes (#1102, #1001, #729) and the Vulkan-only Windows build (#577). The game-free check ran on623a0ca3, both ways.e090cc48cc8cc945)N_BtnNum_00in the plan's logleft -192.0, 4:3left -300.0, 21:9stays 0.0tests/test_hud_layout.py(main @623a0ca3with the test commit5fe2f5a6; this PR @cc8cc945)Screenshots, cropped to the choices: #1233 (comment) (main on the left, this PR on the right).
Flags and settings
None.
HOS_WIDE_UI=0(the HUD in the middle 16:9, or fitted to a narrower screen's width) is unchanged and leaves the column where the game puts it, as before.Testing
Tested:
e090cc48(dev_packs.py base) and this change as a pack over it (6f9b566c, before the branch was rebased and split into a test commit and the fix; the change is the same,git diff 6f9b566c^ 6f9b566candgit diff 623a0ca3 cc8cc945have one patch ID, d0d83118). None of the 188 commits frome090cc48to623a0ca3touchhost/hos_wide_ui.cor its checks.tests/test_hud_layout.pyagainst broken fixes, each failing: the held layout's panes not noted, the column moved the wrong way, moved on wider screens too, and no rule for it.tests/test_hud_layout.pyandtests/test_wide_ui.py(the two checks that readhos_wide_ui.c) pass.host/hos_wide_ui.ccompiled: whole, for Windows, in the pack's build (llvm-mingw, nowarning:in its log); on Linux withgcc -std=c11 -fsyntax-only -Wall -Wextraand the build's generated headers, no warning or error on this branch or on main, and the checks above compile the whole file's body with gcc on Linux.python -I -B tests/run_all.pyon Linux (WSL, Ubuntu 22.04): 565 passed, 26 failed (25 checks) on main @ac778751; on this branch the same 25 fail and nothing else, the WSL machine lacking clang, the Vulkan headers and some Python modules for them (102 skipped):nx2/test_nup_zstd_heads,test_bug_report_defaults,test_check_third_party,test_cpp_preflight,test_crash_record,test_crt_options,test_crt_shaders,test_dlss_feature_size,test_failed_compile_keeps_objects,test_guest_imported,test_lift_lookups,test_link_skip,test_linux_update,test_longshot_saves,test_make_game_cache,test_missing_nup,test_mods_size_table,test_pending_guest_import,test_prof_clock,test_prompt_skip,test_run_all_changed,test_scene_tonemap_pass,test_vk_occlusion_queries,test_walk,test_walk_key.test_bug_report.pyandtest_hardware_report.pyfailed in the branch's first run only because../Toolingwas not cloned yet; with it they pass on both. That run was on the branch overac778751; the last rebase, onto623a0ca3, brought one commit (the menu's Frame generation and CRT rows, #1106), which touches none of this change's files; the two layout checks and the tested-runs check pass on it.Not tested:
HOS_OUTPUT_RES) and drew offscreen; the plan reads only the picture's shape, which the log shows.Must be tested:
Risks
What could break: the text box's panes are now kept in the plan's table (about 80, plus their parts'), out of 65,536 slots; the planner walks none of them. A layout of another name with choices at the canvas's edge would still be cut: none was seen.
Turning it off: revert the commit (
HOS_WIDE_UI=0turns off the HUD's layout as a whole).Compatibility: Nothing changes: no save, option, cache or interface (
MKWVK_API_VERSION) is touched.Issues
Fixes #1050
See #95
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_01VxeaZib8ryJL5zYJuGgxcr
Tested in game: Windows 10 22H2, RTX 4090, NVIDIA 617.42, headless through the control bridge: the Market gate guard's three choices at 1920x1200 (16:10) and 1440x1080 (4:3) are cut at the right edge on main
e090cc48and whole with this change (the plan logs N_BtnNum_00 moved left 192 and 300); at 2560x1080 (21:9) they stay where main puts them.Screenshots: the Market gate guard's choices, cropped to the right of the picture. Left: Before: main @
e090cc48. Right: After: this PR @ 6f9b566c (the same change asb4dcb377). Windows 10, RTX 4090, headless at the output size, pt-BR.1920x1200 (16:10): on main the boxes are cut at the right edge and the scroll hint (↑) is off the screen; with this PR they are whole, the hint beside them.
1440x1080 (4:3): on main the texts are cut too ("Onde fica o caste").
2560x1080 (21:9): the same place on both (the column is moved only where the screen is narrower than 16:9).
Description: the screenshots linked, a Baseline line saying why the runs on main
e090cc48hold on623a0ca3(hos_wide_ui.c unchanged in between; the other commits on the text box's path are #1191's speech-bubble site and audio/options changes), and the Docs box for the docs/tested files.WIP: fix(ui): the text box's choices stay on a 16:10 or narrower screento fix(ui): the text box's choices stay on a 16:10 or narrower screen81afb62aa3c55b75f221Force-pushed: the three commits' author and committer changed to cuecuemoar [email protected]; nothing else. The test commit is now
5fe2f5a6and the fixcc8cc945(the screenshots comment'sb4dcb377iscc8cc945); the change's patch ID is still d0d83118.@Beanstalk Please test with any machine.
Beanstalk test farm
Commit
c55b75f· tier reviewed · approved by llun · dashboardWhat will be tested · default plan (AI failed: the plan was refused: probe[0]: "at_s" is required)
The AI plan failed: the plan was refused: probe[0]: "at_s" is required; using the default plan.
Done. Comment
@Beanstalkto run it again.