Tweak settings change event handling in hud

Former-commit-id: 7b9a3163f2e85d202ef295cf6bd63de3ce753640
This commit is contained in:
Imbris 2019-05-17 23:01:18 -04:00
parent b6b42e1e3d
commit 9e9e8be196

View File

@ -463,6 +463,10 @@ impl Hud {
pub fn handle_event(&mut self, event: WinEvent, global_state: &mut GlobalState) -> bool {
let cursor_grabbed = global_state.window.is_cursor_grabbed();
let handled = match event {
WinEvent::SettingsChanged => {
self.settings = global_state.settings.clone();
false
}
WinEvent::Ui(event) => {
if (self.typing() && event.is_keyboard() && self.show.ui)
|| !(cursor_grabbed && event.is_keyboard_or_mouse())
@ -541,10 +545,6 @@ impl Hud {
_ => self.typing(),
},
WinEvent::Char(_) => self.typing(),
WinEvent::SettingsChanged => {
self.settings = global_state.settings.clone();
true
}
_ => false,
};
// Handle cursor grab.