diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dbacfb7c4..fd43ba4018 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- Fixed a bug where leaving the Settings menu by pressing "N" in single player kept the game paused ### Removed diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8bfc23d35c..bf52c29b1e 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -457,10 +457,20 @@ impl Show { } } - fn toggle_settings(&mut self) { + fn toggle_settings(&mut self, global_state: &GlobalState) { match self.open_windows { - Windows::Settings => self.settings(false), - _ => self.settings(true), + Windows::Settings => { + #[cfg(feature = "singleplayer")] + global_state.unpause(); + + self.settings(false); + }, + _ => { + #[cfg(feature = "singleplayer")] + global_state.pause(); + + self.settings(true) + }, }; } @@ -1615,7 +1625,7 @@ impl Hud { .set(self.ids.buttons, ui_widgets) { Some(buttons::Event::ToggleBag) => self.show.toggle_bag(), - Some(buttons::Event::ToggleSettings) => self.show.toggle_settings(), + Some(buttons::Event::ToggleSettings) => self.show.toggle_settings(global_state), Some(buttons::Event::ToggleSocial) => self.show.toggle_social(), Some(buttons::Event::ToggleSpell) => self.show.toggle_spell(), Some(buttons::Event::ToggleMap) => self.show.toggle_map(), @@ -2294,7 +2304,7 @@ impl Hud { true }, GameInput::Settings if state => { - self.show.toggle_settings(); + self.show.toggle_settings(global_state); true }, GameInput::Help if state => {