Skip to content

Commit

Permalink
Update help window to use player's keybindings (fix #42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeedo committed Apr 28, 2019
1 parent 9f6f6d5 commit 68d6785
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion voxygen/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct Window {
window: glutin::GlWindow,
cursor_grabbed: bool,
needs_refresh_resize: bool,
settings_changed: bool,
key_map: HashMap<glutin::VirtualKeyCode, Key>,
supplement_events: Vec<Event>,
}
Expand Down Expand Up @@ -60,6 +61,7 @@ impl Window {
window,
cursor_grabbed: false,
needs_refresh_resize: false,
settings_changed: true,
key_map,
supplement_events: vec![],
});
Expand All @@ -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;
Expand Down Expand Up @@ -212,4 +218,4 @@ pub enum Event {
Ui(ui::Event),
/// Game settings have changed
SettingsChanged,
}
}

0 comments on commit 68d6785

Please sign in to comment.