Merge pull request #154 from rdbtCVS/t3code/fix-world-options-menu

Fix World Options pause and Escape behavior
This commit is contained in:
Ludovic Marie
2026-10-14 19:34:26 +02:00
committed by GitHub
2 changed files with 9 additions and 4 deletions
+9 -2
View File
@@ -3101,7 +3101,11 @@ impl Game<'_> {
&& self.title.is_none()
&& (matches!(
self.screen,
Screen::Paused | Screen::Options | Screen::Stats | Screen::Advancements
Screen::Paused
| Screen::Options
| Screen::Stats
| Screen::Advancements
| Screen::WorldOptions
) || self.book.is_some())
}
fn capture(&mut self, capture: bool) {
@@ -8471,7 +8475,10 @@ impl ApplicationHandler for Game<'_> {
WindowEvent::KeyboardInput { event, .. } if self.remote_chat_open() => {
self.remote_chat_key(&event)
}
WindowEvent::KeyboardInput { event, .. } if self.screen == Screen::WorldOptions => {
WindowEvent::KeyboardInput { event, .. }
if self.screen == Screen::WorldOptions
&& !matches!(event.physical_key, PhysicalKey::Code(KeyCode::Escape)) =>
{
self.world_options_key(&event)
}
// Options consumes presses; releases still reach the bound
@@ -304,8 +304,6 @@ impl Game<'_> {
self.world_options = Some(o);
self.apply_world_options(&before, &wanted);
self.close_world_options();
self.screen = Screen::Playing;
self.capture(true);
return;
}
None => {}