WIP: fix(menu): while the menu starts it says so, never that it could not start, and not over its page #2842
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2842
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-api-menu-starting"
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
For #2822 (into
mod-api). Two things the menu says wrongly while it starts.1. The fallback says "could not start" while the menu is only starting. The menu can open in the first seconds of a start, for example when a mod's permission prompt opens it. Then it shows the fallback page with "Longshot's menu could not start" and "The menu's system mod (system/menu) did not start". A moment later the real menu replaces it. Nothing failed: the menu's system mods had not started yet.
The cause: scripts start one per frame. While
system/menuandsystem/mods-tabwait for their frame, their loader rows arePending.menu_fallback::Down::of(game/crates/longshot-game/src/menu_fallback.rs) turned every row that does not run, other than a fault stop, intoNotStarted, and that state's page says the menu could not start. This addsDown::Startingfor aPendingrow. Its page says "Longshot's menu is starting" and "The menu's system mod (%s) is starting: it shows in a moment."Only
Pendingchanges. A menu mod whose start failed (Failed), that cannot start (Cannot), waits (Waits), is held (Held), broken, off or missing still shows "could not start" with its reason. A fault stop still shows "stopped after N faults" and Restart the menu. The page is rebuilt each frame while the menu is open, so a start that fails after "is starting" turns into the "could not start" page on the next frame.2. The menu's frame draws "The menu is starting." over the page for two frames. The frame draws that grey line while it hosts no page. It found out from the hosted page of two presents before:
game_ui_present(game/crates/longshot-game/src/ui.rs) read UI's last frame (p.hosted), and UI's thread is a present behind. So the first two frames with a page, the fallback's at a start and the menu's at every open, drew the line over the page's title.The line is now a tree of its own,
engine:menu-starting, beside the frame's (build_lineingame/crates/longshot-game/src/screens/menu_frame.rs). The renderer's input names it as the host'sunhostedtree (Host::unhosted, set ininput_of). UI's core leaves that tree's screens out of a tick that hosts a page (shown_orderingame/crates/ui/src/core.rs). The page and the line are now decided in the same tick. The frame's help box still follows the page as before.To see both on
mod-api: a development mod with apermissionsentry the player has not granted (its prompt opens the menu at the start). Frames 3 and 4 show "could not start" with "The menu is starting." over its title, then "could not start", then the menu.Read first:
Down::ofinmenu_fallback.rs, thenMenuFrame::tickinmenu_frame.rsandshown_orderincore.rs.Testing
Tested: Windows 11, RTX 5080, NVIDIA 621.40, the game confined through
longshot-builder game. The profile has four mods, plus a development mod (LONGSHOT_DEV_MODS,local/first-mod) whose permission prompt opens the menu at the start. The menu was taken in headless shots (RX_VK_SHOT_MENU=1), one every frame.mod-api): frames 3 and 4 show "Longshot's menu could not start" with "The menu is starting." over the title. Frames 5 to 28 show "Longshot's menu could not start" / "The menu's system mod (system/menu) did not start, so this is the fallback. The log says why.", namingsystem/mods-tabfrom frame 27. The menu shows from frame 29.system/mods-tabfrom frame 27, with no line over the title. The menu shows from frame 29.Both runs are on
mod-apiwith #2726's save-folder fix and its broker change applied locally, beneath this PR: on plainmod-apia confined Windows start with a profile stops at the save folder. The shots are in the comments.Checks:
menu_fallback::tests::a_menu_that_is_still_starting_says_so_not_that_it_could_not_startgives the fallback aPendingmenu row. It checks the page says "is starting", never "could not start" nor "did not start", and that Resume is there, for each of the menu's system mods. It fails onmod-api(the page says "Longshot's menu could not start") and passes here.ui::menu_line_tests::the_menus_starting_line_never_shows_in_a_tick_that_hosts_a_pagegoes through the game's own input (input_of), the frame (MenuFrame) and UI's core: in a tick that hostssystem/menu's page, the line is not laid out. It fails onmod-api(the line is laid out at [95, 140] over the page) and passes here. Its pair,the_menus_starting_line_shows_while_no_page_is_hosted, passes on both.core::tests::an_unhosted_screen_shows_only_in_a_tick_that_hosts_no_page(game-ui): the screen shows with no page, goes in the tick a page is hosted, and comes back when the page goes.engine_text::tests::every_language_has_every_text_and_keeps_its_conversionspasses: the two new texts are in all 14 languages ofgame/strings/, with their%s.On Windows (
cargo test --target x86_64-pc-windows-gnullvmwith llvm-mingw):game-ui94 pass;longshot-game168 pass;modtool211 pass. The failures fail the same way onmod-api:longshot-game:mod_tests::…a_folder_of_mods_tests_each_of_its_folders,runtime::…a_mods_profile_sits_inside_the_launchers_save_folder,runtime::…a_separate_mod_moves_the_saves_into_its_profile_and_records_it.modtool:emulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches, its list in another order.cargo fmt --all --checkandcargo clippy -p game-ui -p longshot-game -p modtool --all-targets --no-deps -- -D warnings(Windows target) pass, and so doesmise run lint.Still to test:
cargo test -p game-ui -p longshot-game -p modtool(CI)Measurements
Verdict: fixed. While the menu starts it says so, never that it could not start, and the frame's line no longer shows over a page.
Baseline:
mod-api(#2822's head), the branch this PR goes into. The fallback and the frame are there, not onmain. Nothing to time: the change is what the menu shows. Shots one every frame, the same start.Pendinga_menu_that_is_still_starting_says_so_not_that_it_could_not_startthe_menus_starting_line_never_shows_in_a_tick_that_hosts_a_pageRisks
The sandbox: no permission, grant or refusal changes. The fallback's change is which text the engine's own page shows; it starts, grants and reads nothing.
Host::unhostedis set only from the renderer's input (input_of), never by a mod's batch. It can only leave out Screen roots, which no mod can mount (Grants::allowsrefusesSurface::Screen), so it hides nothing of a mod's. The new tree is the engine's, like the frame's.A menu mod stuck in
Pendingwould now say "is starting" rather than "could not start". Mods inPendingstart on the next frames, and a failed start becomesFailed, which shows "could not start" again.The line is a second engine tree now, sent and taken down with the frame (
Msg::Gonefor both on close).modtool's test game builds itsHostwithunhosted: None, as before. A revert is enough.Checklist
Ready for review
mod-api(#2822's head); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (The checks this change reaches pass, as above.mod-api's whole suite has failures on Windows that this PR doesn't change: #2825 and #2826 fix eight of them.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (Each fails onmod-api, where the bugs are.)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 the game: Windows 11, RTX 5080, NVIDIA 621.40. The game was confined through
longshot-builder game, with a development mod (local/first-mod) whose permission prompt opens the menu at the start. The menu was taken in headless shots (RX_VK_SHOT_MENU=1). Both runs are onmod-apiwith #2726's save-folder fix and its broker change applied locally, beneath this PR.Before (
mod-api), frame 10:After (this PR), frame 10:
The real menu replaces the page at frame 30. Both have the same two frames (3 and 4) where the menu's frame also draws its own "The menu is starting." line over the title. It reads the hosted page from the present before. That is not this PR's change.
WIP: fix(menu): while the menu's system mods are still starting, its fallback says so, not that the menu could not startto WIP: fix(menu): while the menu starts it says so, never that it could not start, and not over its pageAdded to this PR: the menu's frame no longer draws its grey "The menu is starting." line over the page. The fix is commits
527bbcc3(its test) andde61135a. The description says how.Tested in the game, set up as in the comment above (Windows 11, RTX 5080, NVIDIA 621.40, confined through
longshot-builder game, #2726's fix applied locally beneath this PR), with a shot every frame.Before (
mod-api), frame 3: the line over the fallback's title.After (this PR), frame 3: no line over the page.
On
mod-apithe line was there in frames 3 and 4; here it is in none. One correction to the comment above: the real menu takes over at frame 29 in both runs, not 30.de61135afa55fa63fe3855fa63fe383b79aa67cfRebased onto
mod-api@c5e5b676: it was re-squashed onto main @46291934(#2833) twice today (cdbb8551, thenc5e5b676), which made this PR show main's and the whole mod API's diff. Now3b79aa67, the same diff as before (samegit patch-id), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.