From 7a62c6f4a7edacaee9dac576bb766c8f7bc0feaa Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:46:23 +0100 Subject: [PATCH] Give the capture test's fixture the pack prompt capture() now asks the server pack prompt and the dialog; the fixture gets both, and the prompt's own case: it keeps the pointer. Co-Authored-By: Claude Opus 5.5 --- tests/test_world_input_capture.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_world_input_capture.py b/tests/test_world_input_capture.py index 5607c3684..e9a93ee4e 100644 --- a/tests/test_world_input_capture.py +++ b/tests/test_world_input_capture.py @@ -86,25 +86,39 @@ impl Window { struct Mouse { ignore_first: bool } impl Mouse { fn set_ignore_first_move(&mut self) { self.ignore_first = true; } } struct Remote; +#[derive(Default)] +struct ServerPacks { prompt: Option<()> } struct Game { focused: bool, agent_pointer: bool, window: Option, mouse: Mouse, captured: bool, title: Option<()>, screen: Screen, remote: Option, mining: bool, lan_acting: Option, renderer: Option, cursor: (f32, f32), + server_packs: ServerPacks, } impl Default for Game { fn default() -> Self { Self { focused: true, agent_pointer: false, window: Some(Window::default()), mouse: Mouse::default(), captured: false, title: None, screen: Screen::Playing, remote: None, mining: false, lan_acting: None, - renderer: None, cursor: (0.0, 0.0) } + renderer: None, cursor: (0.0, 0.0), server_packs: ServerPacks::default() } } } impl Game { fn stop_mining(&mut self) { self.mining = false; } fn reset_inventory_clicks(&mut self) {} + fn dialog_open(&self) -> bool { false } METHODS } fn main() { + // The server pack prompt keeps the pointer: nothing grabs it while it is open. + { + let mut game = Game::default(); + game.server_packs.prompt = Some(()); + game.capture(true); + assert!(!game.captured); + game.server_packs.prompt = None; + game.capture(true); + assert!(game.captured); + } // New and existing worlds, returning to title, and reopening a world. for remote in [false, true] { let mut game = Game::default();