diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8af320fcea..6779f9a099 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -480,7 +480,11 @@ pub struct Hud { mana_percentage: f64, inventorytest_button: bool, settings_tab: SettingsTab, +<<<<<<< HEAD settings: Settings, +======= + help_text: String, +>>>>>>> Update help window to use player's keybindings (fix #42) } //#[inline] @@ -532,7 +536,11 @@ impl Hud { xp_percentage: 0.4, hp_percentage: 1.0, mana_percentage: 1.0, +<<<<<<< HEAD settings: settings, +======= + help_text: get_help_text(&Settings::default().controls), +>>>>>>> Update help window to use player's keybindings (fix #42) } } @@ -1764,7 +1772,11 @@ impl Hud { }, WinEvent::Char(_) => self.typing(), WinEvent::SettingsChanged => { +<<<<<<< HEAD self.settings = global_state.settings.clone(); +======= + self.help_text = get_help_text(&global_state.settings.controls); +>>>>>>> Update help window to use player's keybindings (fix #42) true }, _ => false, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index e3d88998c9..89eb7268bc 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,8 @@ pub enum Event { Ui(ui::Event), /// Game settings have changed SettingsChanged, -} \ No newline at end of file +<<<<<<< HEAD +} +======= +} +>>>>>>> Update help window to use player's keybindings (fix #42)