mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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:
commit
e186b59ddc
@ -622,6 +622,17 @@ impl Hud {
|
|||||||
}
|
}
|
||||||
true
|
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,
|
_ if !self.show.ui => false,
|
||||||
WinEvent::Zoom(_) => !cursor_grabbed && !self.ui.no_widget_capturing_mouse(),
|
WinEvent::Zoom(_) => !cursor_grabbed && !self.ui.no_widget_capturing_mouse(),
|
||||||
|
|
||||||
@ -645,17 +656,6 @@ impl Hud {
|
|||||||
|
|
||||||
// Press key while not typing
|
// Press key while not typing
|
||||||
WinEvent::InputUpdate(key, true) if !self.typing() => match key {
|
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 => {
|
GameInput::Map => {
|
||||||
self.show.toggle_map();
|
self.show.toggle_map();
|
||||||
true
|
true
|
||||||
|
Loading…
Reference in New Issue
Block a user