From dc5ec137e9a6601d8e416d8bdcec5f61860a1d72 Mon Sep 17 00:00:00 2001 From: Yeedo Date: Thu, 25 Apr 2019 14:10:01 +0100 Subject: [PATCH] Update help window to use player's keybindings (fix #42) Former-commit-id: b5bc8a8801fd4633ec94ea53a8973bcb891a4fd6 --- voxygen/src/window.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index e3d88998c9..c8d91dc45a 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -11,6 +11,7 @@ pub struct Window { window: glutin::GlWindow, cursor_grabbed: bool, needs_refresh_resize: bool, + settings_changed: bool, key_map: HashMap, supplement_events: Vec, } @@ -60,6 +61,7 @@ impl Window { window, cursor_grabbed: false, needs_refresh_resize: false, + settings_changed: true, key_map, supplement_events: vec![], }); @@ -82,6 +84,10 @@ impl Window { self.needs_refresh_resize = false; } + if self.settings_changed { + events.push(Event::SettingsChanged); + } + // Copy data that is needed by the events closure to avoid lifetime errors // TODO: Remove this if/when the compiler permits it let cursor_grabbed = self.cursor_grabbed; @@ -212,4 +218,4 @@ pub enum Event { Ui(ui::Event), /// Game settings have changed SettingsChanged, -} \ No newline at end of file +}