From 8754ea1661eedaaa8a8eb3ad56f14967dd5e4d49 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 26 May 2019 12:10:35 -0400 Subject: [PATCH 1/2] Fix hud handle_event() match arm order Former-commit-id: 484b74fc9d82a18b5ac4d7da2dedcd426d100041 --- voxygen/src/hud/mod.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index ad6d51db3b..18831706bc 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -622,6 +622,17 @@ impl Hud { } true } + WinEvent::InputUpdate(GameInput::ToggleInterface, true) => { + self.show.toggle_ui(); + true + } + WinEvent::InputUpdate(GameInput::ToggleCursor, true) => { + self.force_ungrab = !self.force_ungrab; + if self.force_ungrab { + global_state.window.grab_cursor(false); + } + true + } _ if !self.show.ui => false, WinEvent::Zoom(_) => !cursor_grabbed && !self.ui.no_widget_capturing_mouse(), @@ -645,17 +656,6 @@ impl Hud { // Press key while not typing WinEvent::InputUpdate(key, true) if !self.typing() => match key { - GameInput::ToggleInterface => { - self.show.toggle_ui(); - true - } - GameInput::ToggleCursor => { - self.force_ungrab = !self.force_ungrab; - if self.force_ungrab { - global_state.window.grab_cursor(false); - } - true - } GameInput::Map => { self.show.toggle_map(); true From ec4bf7279a9af806589ac796589c1a36a4271c13 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 26 May 2019 12:23:24 -0400 Subject: [PATCH 2/2] Add check for typing Former-commit-id: 582d0b5894f44f8491b671823b09f064d139df02 --- voxygen/src/hud/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 18831706bc..954ed65235 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -622,11 +622,11 @@ impl Hud { } true } - WinEvent::InputUpdate(GameInput::ToggleInterface, true) => { + WinEvent::InputUpdate(GameInput::ToggleInterface, true) if !self.typing() => { self.show.toggle_ui(); true } - WinEvent::InputUpdate(GameInput::ToggleCursor, true) => { + WinEvent::InputUpdate(GameInput::ToggleCursor, true) if !self.typing() => { self.force_ungrab = !self.force_ungrab; if self.force_ungrab { global_state.window.grab_cursor(false);