Merge branch 'hud_match' into 'master'

Fix hud handle_event() match arm order

See merge request veloren/veloren!180

Former-commit-id: bbc80c47c48239610fc8872f19d9a8ec8ca5afaf
This commit is contained in:
Timo Koesters 2019-05-26 16:33:25 +00:00
commit e186b59ddc

View File

@ -622,6 +622,17 @@ impl Hud {
}
true
}
WinEvent::InputUpdate(GameInput::ToggleInterface, true) if !self.typing() => {
self.show.toggle_ui();
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);
}
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