WIP: feat(menu): a HUD layout row, the HUD at the screen's edges or in the middle 16:9 #1152
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1152
Loading…
Reference in a new issue
No description provided.
Delete branch "enum/Longshot:feat/hud-layout-row"
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: feat · Risk: low · Tested on: Windows 11, RTX 4070 · Needs: Linux, any GPU (a build)
Why
On a screen that is not 16:9 (an ultrawide, 16:10, 4:3) the HUD's corners go to the screen's own edges since #95:
the hearts at the far left, the minimap and the item buttons at the far right. Players who want them near the middle,
as the first versions had them, have no row for it. The Ultrawide menus row moves only the pause, item and map menus,
and only the switch
HOS_WIDE_UI=0moves the HUD back. The README still says the default "keeps the HUD and movies inthe middle 16:9". #1133's reporter, on a 3440x1440 monitor, found exactly that: "none of the widescreen options
changes this view". See #1133.
What changed
A Graphics row, HUD layout, under Ultrawide menus: Screen's edges (the default, as now) or Middle 16:9
(the HUD where it is at 16:9, fitted to the width on a narrower screen, as
HOS_WIDE_UI=0does). It changes at once.HOS_WIDE_UI, when set, still decides: the row is greyed then, and its hint says why.hos_wide_ui_tick(host/hos_wide_ui.c) asks the row at each present (rx_option(71, 0)) whenHOS_WIDE_UIis unset. The existing check that re-places every pane when the plan changes then moves the HUD atonce. The switch reads as before.
HOS_OPT_HUD_LAYOUT = 71ingpu/vk/vk_api.h(60 is the item wheel's; 62 to 70, 80, 88 and 90 are taken byopen pull requests, #227 among them);
opts.hud_layout(0 by default,vk_menu.h), saved ashud_layout; the row,tx_hud_layoutandhn_hud_layoutinvk_menu.cpp;vk_replay.cpp's option callback answers 71;row_fixedgreys therow while
HOS_WIDE_UIholds it, as rows other switches hold are. The callback's signature isunchanged, so
MKWVK_API_VERSIONstays, as for option 61.gpu/vk/menu_i18n.h, each at its sorted place and with thecounts raised. They are machine-made, as the file's others are, for speakers to correct.
docs/development.md'sHOS_WIDE_UIline and options file (hud_layout).tests/test_hud_layout_row.py(new);tests/test_wide_ui.py's stand-ins answerrx_optionfor it.Measurements
Verdict: works. On a 3440x1440 monitor, the row at Middle 16:9 moves the HUD 440 pixels in at once, to where
HOS_WIDE_UI=0puts it, and back. At Screen's edges nothing changes frommain. The new check fails onmainandpasses here.
Hardware: Windows 11 Pro (26300), RTX 4070 (616.56), Ryzen 9 7900X, 64 GB; a 3440x1440 monitor
Scene: Kokiri Forest, the repository's
kokiri-startsave, in play; Aspect ratio 21:9, Output resolution 3440x1440,DLSS, Frame generation 2x, Reflex, fullscreen
Method: captures of the monitor itself, the hearts' columns measured; the row changed from the Insert menu (keyboard)
and through the control bridge's
option set;longshot_log.txt'swide ui:lineHow to reproduce: the scene above, Insert menu > Graphics > HUD layout;
python -I -B tests/run_all.py test_hud_layout_row71b1edd8867c70b0867c70b0wide ui:line, the HUD's sides movedhud_layout=0hud_layout=1HOS_WIDE_UI=1set, the row set to Middle 16:9tests/test_hud_layout_row.pyrun_all.py(Windows)Flags and settings
A new menu row and its ini key; no switch added or changed.
hud_layout(Graphics > HUD layout)HOS_WIDE_UI=0)HOS_WIDE_UI=0HOS_WIDE_UITesting
Tested:
tests/test_hud_layout_row.pycompileshost/hos_wide_ui.cwhole and places the HUD at 21:9 and 4:3. Middle 16:9matches
HOS_WIDE_UI=0, Screen's edges matches the default, the switch stands over the row both ways, a change inplay takes effect at once, and 16:9 is unmoved. It also checks the wiring (the row greyed while the switch holds it)
and the docs. It fails on
main(13 checks)and passes here on Windows (llvm-mingw clang) and Linux (WSL, gcc 15).
test_hud_layout,test_wide_ui,test_menu_i18n,test_readme_menu_rows,test_menu_sectionsandtest_preset_exemptpass on both.Insert menu, back again, and
hud_layoutsaved.HOS_WIDE_UI=1: the row stays at its value and the bridge's set is refused, as the menu greys it.greyed under the switch, which it now is. It also noted that at 48:9 (three screens, the HUD on the middle one) and
with
HOS_HUD_MAX_RATIOat 16:9 or less the two choices look the same, as at 16:9; the help text names only 16:9.The default's behaviour, every value of
HOS_WIDE_UI, the threading, the translations and the counts checked out.Not tested: a 16:10 or 4:3 monitor in the game (covered by the check). A whole build on Linux: only
host/hos_wide_ui.cwas compiled there (gcc 15, whole, by the check); the renderer's files and the game were built onWindows.
Must be tested:
host/hos_wide_ui.c,gpu/vk/vk_menu.cppandgpu/vk/vk_replay.cpp; with a screen that is not 16:9, Insert menu > Graphics > HUD layoutat Middle 16:9 moves the HUD in at once (Test Farm: @Beanstalk linux, a build of this branch and the HUD layout row)
Risks
What could break: the HUD's place on a screen that is not 16:9, only with the row at Middle 16:9. At its default
the HUD is placed as on
main. The host reads one more option each present through the existing callback, as otherhost files do.
Turning it off: the row's default is the behaviour before this PR; revert the commit to remove it.
Compatibility: an options file without
hud_layoutreads as Screen's edges, as before. An older renderer answersunknown option ids with 0, which is also Screen's edges. Shader and pipeline caches, saves and
MKWVK_API_VERSIONareunchanged.
Issues
See #1133
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.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: Windows 11 Pro (26300), RTX 4070, NVIDIA 616.56, on a 3440x1440 monitor in fullscreen (21:9, 3440x1440, DLSS, DLSS FG 2x, Reflex), Kokiri Forest on the kokiri-start save: HUD layout at Screen's edges places the HUD as main (hearts x 116); set to Middle 16:9 from the Insert menu (keyboard) and through the control bridge, the HUD moves in at once (hearts x 556, the wide ui line's sides 660 -> 0) and back; saved as hud_layout=1. With HOS_WIDE_UI=1 set the row is greyed: the bridge's set is refused and the HUD stays at the edges.
@Beanstalk linux, any GPU: build this branch (make_game.py or a dev pack) and say whether host/hos_wide_ui.c, gpu/vk/vk_menu.cpp and gpu/vk/vk_replay.cpp compile with no new warning. If a game folder and a screen that isn't 16:9 are at hand: Insert menu > Graphics > HUD layout set to Middle 16:9 should move the hearts, buttons and minimap into the middle 16:9 at once, and Screen's edges back.
@enum only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.