fix(mods): hideGameHud() hides the minimap too #3154
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!3154
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/hide-game-hud-minimap"
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
A mod's
hideGameHud()hides the hearts but leaves the minimap on screen, so a photo mode still shows it in everypicture. The modding docs say the call hides the map too. A mod author reported this on Discord.
See it on main: run a mod that calls
hideGameHud()in the Market (the repository savemarket-entrance). Thehearts go away, and the minimap stays in the bottom-right corner, with the game paused or not.
Why: the game has four 2D layers that all carry the name
Layer2D. The game's action thathideGameHud()useshides only the first of them, and the minimap is not drawn there. Read from the game's memory in the run below: after
the call, one 2D layer was off and the other three stayed on.
The fix: while a mod holds the hide, the minimap's drawing is shrunk to nothing while its screen updates, then
put back right after. This is how the HUD toggle already hides it (#1855, futondestroyer's). It works with the widescreen
system mod on or off, and it leaves the pause menu's map alone. Nothing is written to the save or the settings.
Read first:
hud_update_beginingame/mods/widescreen/src/screen.rs, andhud_hiddeningame/crates/game-core/src/pause.rs.The docs now say what the game does: the pause menu and its Map page still show while the HUD is hidden (seen in the
run below, before and after this change).
Testing
Tested: Windows 11, RTX 5080, NVIDIA 621.47. A test mod in the game's test mode, from the repository save
market-entrance, headless. It hid the HUD, paused the game, let the pause go, added a second hide, released one, thenreleased the other. One picture per step, on main and on this change:
f577a1aea: the minimap stayed in all five hidden pictures; the hearts went away.f577a1aea): the minimap went away with the hearts in all five, paused or not, and stayed hiddenuntil the last hide was released. Then both came back.
system/widescreenoff and the test modgranted its two permissions by the player): the log shows the widescreen mod never started, and the minimap was
hidden in all five pictures and back after the last release.
on both. Main says the same with nothing hidden at all, so that comes from the save, not this change.
that save has the map of, the minimap (in the dungeon, with its floor label) was hidden with the hearts while the mod
held the hide. The pause Map page, opened during the hide, drew its full map. After the release the minimap was back.
The small-key count was not on screen in either place before the hide (no small keys held there), so it was not seen.
Checks:
the_hud_a_mod_hides_takes_the_minimap_with_it(widescreen, new) fails on main for the bug (the minimap'sdrawing keeps its size) and passes here. It checks the minimap hidden and put back, the pause map left alone, and
the minimap drawn again after the release, with the widescreen mod off and on. With the fix's key line removed it
fails again.
mise run test(Windows,--strict): all 844 checks pass. 835 ran on mainf577a1aeaplus this change; the 9 thatfailed on that main ran again after the rebase onto
ca830e895, which fixed them.test_lifterwas left out: itholds tests that fail on main.
cargo testof sysmod-widescreen, game-core, api, longshot-game and modtool passes, except two tests that fail onmain and were skipped:
api'sa_walked_reshade_folder_counts_a_change_once_two_walks_agreeandmodtool'sa_mod_written_off_the_first_time.the_menu_passes_its_testsfailed once while other tests ran and passed alone.cargo fmt --all --checkpasses.cargo clippy -D warningsfails on main'sunused import: note_linesinbuild-core; nothing in this change's files.
Still to test:
hideGameHud(), expecting the small-key count beside the minimaphidden with it, and back after the release.
hideGameHud()during a text box, expecting the text box hidden as on main.@Beanstalk run the game in the Market with a mod that calls hideGameHud(); expecting the minimap hiddenMeasurements
Verdict: the minimap is hidden now; no speed is measured, as the cost is one atomic read per HUD screen update.
Setup: Windows 11, RTX 5080, NVIDIA 621.47; the Market from the repository save
market-entrance, 1280x720screenshots of each step through the control bridge.
The runs were on main
f577a1aea. The numbers still hold on mainca830e895: its three new commits (#3044, #3121, #3146)don't touch the HUD screens' update, the widescreen mod or the pause code, and the tests pass again after the rebase.
f577a1aeaccff24679Risks
Only the minimap's drawing changes, and only while a mod holds
hideGameHud(). Its values are put back after eachupdate, so a mod that stops, crashes or is turned off leaves nothing behind. Revert to undo. Players without such a mod
see no change.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.mainand here, for a change that shows on screen.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 5080, NVIDIA 621.47, the Market (repository save market-entrance), a test mod in the game's test mode: on main
f577a1aeathe minimap stayed in all 5 pictures with the HUD hidden; with this change it was hidden in all 5, paused or not, and came back with the hearts when the last hide was released.Possibly related, for context:
The same spot in the Market, with a mod holding
hideGameHud()and the game paused (step 2 of the test mod's run).Before: main @
f577a1aea. The hearts are hidden, and the minimap stays in the bottom-right corner.After: this PR. The hearts and the minimap are both hidden.
The game runs were on main
f577a1aea. The rebase ontoca830e895added three commits: controller support (#3044) and two test fixes (#3121, #3146). None of them touch the HUD screens' update, the widescreen mod or the pause code this change uses, so the before and after pictures still hold. After the rebase, the new test and the game-core and widescreen tests pass again (Windows), and so do the 9 checks those two test fixes repaired.@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The reported Market run shows that the minimap now hides and returns after the last release. The remaining in-game map and dungeon cases, and the pending CI checks, need results before merge. Recommend approval; not approved on the forge.
A mod holding hideGameHud() also hides the minimap by temporarily collapsing its projection during the HUD update, including when the widescreen system mod is off. The pause map is intended to remain visible; the change adds one atomic read per HUD screen update and reuses the existing HUD-toggle mechanism.
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/screen.rs:132: The remaining map modes need an in-game check before merge. (more on the line) Do: On one supported PC, test a populated pause Map page, a dungeon minimap and key count, and the Market with the widescreen mod disabled while a mod holds and releases hideGameHud().Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author's Windows Market comparison reports the minimap visible in 5 of 5 hidden-HUD pictures on main and 0 of 5 with the change; it returned after the last release. The comparison used an earlier main, and the author explains why the intervening commits do not affect this path.
Other systems: The wrapper runs on a game worker thread and is used with the widescreen mod both on and off. The change also reaches the shared pause-map screen, but checks its minimap flag before collapsing the projection. The fake test covers both modes and restoration; an in-game pause map with actual map content, dungeon key count, and the mod-off path remain untested. The logic is not GPU-specific.
Switches: None added, changed, or removed.
Reviewed:
ccff246795againstca830e8959: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the complete diff and commit messages, screen.rs, pause.rs, the changed documentation, and the wrapper, projection helpers, layouts, site declaration, and relevant test support. Skimmed other widescreen modules and the reported runs. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run for this review. The author reports Windows game and game-free test results; CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -122,3 +130,3 @@SCOPE.with(|c| c.set(Scope { map: mode, minimap }));u.previous = Some(previous);if mini && hidden {if mini && (hidden || by_a_mod) {L1 (should fix): The remaining map modes need an in-game check before merge.
When: The reported run used a pause Map page that displayed no map, and did not exercise a dungeon or the widescreen mod disabled in game. The fake test supplies the screen flag and projections itself, so it cannot confirm those game states select and draw the expected screen.
Do: On one supported PC, test a populated pause Map page, a dungeon minimap and key count, and the Market with the widescreen mod disabled while a mod holds and releases hideGameHud().
On L1: two of the three cases ran in the game now, the third can't run with the saves we have.
system/widescreenoff (the log shows it never started), the Market, the same steps. The minimap was hidden in all five pictures, paused or not, and came back with the hearts after the last release.The last two stay in Still to test for someone with a save further on. The description is updated.
@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The Market run shows that the minimap now hides and returns, including with widescreen disabled. The pause map and dungeon minimap cases still need in-game checks before merge. Recommend approval; not approved on the forge.
A mod holding hideGameHud() now also hides the minimap by temporarily collapsing its projection; the pause map is intended to remain visible. The change reuses the HUD toggle’s approach and adds a game-free regression test.
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/screen.rs:132: The remaining map modes need an in-game check before merge. When: A save with a populated pause Map page or a dungeon map has not been used to check the hidden HUD and subsequent release. Do: On a save with a populated map, check that the pause Map page remains visible; in a dungeon with its map, check that the minimap and key count hide and return after release.Since the last review (on
ccff246795)Still open: L1 (The remaining map modes need an in-game check before merge.)
Checks: Still running: 11 checks.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes: the reported Windows Market run showed the minimap in 5 of 5 hidden pictures on main and 0 of 5 with the change; it returned after the last hide was released. The remaining map modes have not been demonstrated in game.
Other systems: The widescreen-on and widescreen-off paths are covered by the reported Market runs and the game-free test. The pause map and dungeon minimap with its key count remain untested in game; Linux is also listed for testing.
Switches: None.
Reviewed:
ccff246795againstca830e8959: Read the changed code and documentation, the diff, commit list, repository rules available locally, pull request template, and supplied comments and CI status. The review checklist and adjacent Tooling rules were not present locally; screenshot attachments were not inspected.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. The author reports Windows game runs and passing game-free tests; the remaining map-mode runs are outstanding.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
On L1, the last two cases, with a copy of a save further on (adult Link, on this PR's build):
Not seen: the small-key count beside the minimap. It was not on screen in either place before the hide (no small keys held there), so it stays in Still to test. The description is updated.
@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The reported runs show the minimap hiding and returning correctly, including with widescreen disabled and with the pause map open. The small-key count remains untested, and CI is still running. Recommend approval; not approved on the forge.
The change hides the minimap while a mod holds hideGameHud(), restores it on release, and leaves the pause map visible. It reuses the existing HUD projection collapse, at the cost of an atomic read during HUD screen updates.
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/screen.rs:132: Check the dungeon small-key count while the HUD is hidden. When: With small keys held in a dungeon, the reported runs did not show whether the count disappears with the minimap and returns after release. Do: Run a mod calling hideGameHud() in a dungeon with small keys held; check the count before the hide, during it and after release.Since the last review (on
ccff246795)Still open: L1 (Check the dungeon small-key count while the HUD is hidden.)
Checks: Still running: 11 checks.
Also noticed (3; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes: on Windows in the Market, the minimap appeared in 5 of 5 hidden-HUD pictures on main and 0 of 5 with the change; it returned after release. Dungeon and widescreen-disabled runs also reported the intended behavior.
Other systems: The reported Windows runs cover widescreen on and off, a dungeon minimap and the pause map. Linux, the small-key count and text boxes remain untested; CI is still running.
Switches: None.
Reviewed:
ccff246795againstca830e8959: Read the diff, screen.rs, the changed HUD state and call references in pause.rs, the camera documentation, repository contribution rules and PR template. Skimmed surrounding callers and test evidence; the linked Tooling rules were unavailable, and docs/review-checklist.md does not exist.; nothing run (a code review).Checked and fine:
Testing: No commands that execute project code were run. The author reports Windows game runs and game-free tests; CI remains in progress.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.