Fix World Options pause and Escape behavior

This commit is contained in:
rdbtCVS
2026-10-14 18:05:30 +01:00
parent 52975ad988
commit 90115e5574
2 changed files with 9 additions and 4 deletions
+9 -2
View File
@@ -3084,7 +3084,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) {
@@ -8355,7 +8359,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)
}
WindowEvent::KeyboardInput { event, .. } if self.screen == Screen::Options => {
@@ -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 => {}