Skip to content

notes test: pause the game while the overlay is installed - #1632

Open
Alistair-Afton wants to merge 2 commits into
DFHack:masterfrom
Alistair-Afton:notes-test-pause
Open

Alistair-Afton wants to merge 2 commits into
DFHack:masterfrom
Alistair-Afton:notes-test-pause

Conversation

@Alistair-Afton

Copy link
Copy Markdown

Summary

  • overlay/notes tests depend on df.global.pause_state being true: NotesOverlay:onRenderFrame() skips drawing map pins when the game is unpaused in text mode.
  • The test previously relied on the ambient pause state left by the test harness (ensure_fortress pauses once when entering fortress mode). Any earlier test that leaves the game unpaused breaks render_existing_notes (this happened in fix three plugin crash/UB bugs; test coverage for 14 plugins dfhack#5939 CI).
  • install_notes_overlay now saves and sets pause_state; cleanup restores it, matching the existing waypoint/overlay-state save-restore pattern in this file.

Test plan

  • test -t overlay/notes in-game: 5/5 tests, 17/17 checks pass

The notes overlay only draws map pins when the game is paused (in text
mode). Pausing during test setup instead of relying on ambient pause
state makes the tests robust against earlier tests leaving the game
unpaused.

@SilasD SilasD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requested change: use the existing API.

Comment thread test/overlay/notes.lua Outdated
Comment thread test/overlay/notes.lua Outdated
@Alistair-Afton

Copy link
Copy Markdown
Author

Done in cfdefba - both sites now use dfhack.world.ReadPauseState()/SetPauseState(). Re-verified in-game: 5/5 notes tests pass.

Also applied the same API in the dfhack-side pause handling (test/plugins/autodump.lua, test/plugins/liquids.lua in dfhack#5939, commit 934c663f5) for consistency.

@SilasD

SilasD commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

I'm fine with this now.

for whatever reason, GitHub isn't letting me resolve those two conversations. maybe after I submit this comment.

Edit: GitHub was just being slow or wonky.

@SilasD

SilasD commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What GitHub didn't do is show the approve button. maybe this time. Edit: nope. Maybe it's this pre-commit.ci workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants