generated from GarandPLG/rust-flake-template
Rename GameStates to States and adjust keybindings
Replace the old `GameStates` struct with a new `states` module, rename the field in `App` to `states`, and update construction to pass CLI args. Remove the now‑unused `game_states.rs` file and adjust imports accordingly. Update keybinding definitions: change the wildcard symbol to "[All]" and simplify the wildcard detection logic by dropping the modifiers check.
This commit is contained in:
@@ -12,24 +12,15 @@ pub fn settings_keybindings(app: &mut App, key_event: &KeyEvent) {
|
||||
Action::Quit => app.exit = true,
|
||||
Action::Quit2 => app.exit = true,
|
||||
Action::Esc => app.view = View::MainMenu,
|
||||
Action::Space => {
|
||||
app.game_states.settings_state.show_popup =
|
||||
!app.game_states.settings_state.show_popup
|
||||
}
|
||||
Action::Space => app.states.settings.show_popup = !app.states.settings.show_popup,
|
||||
Action::Backspace => {
|
||||
if app.game_states.settings_state.show_popup {
|
||||
app.game_states
|
||||
.settings_state
|
||||
.selected_setting_new_value
|
||||
.pop();
|
||||
if app.states.settings.show_popup {
|
||||
app.states.settings.selected_setting_new_value.pop();
|
||||
}
|
||||
}
|
||||
Action::WildCard(c) => {
|
||||
if app.game_states.settings_state.show_popup {
|
||||
app.game_states
|
||||
.settings_state
|
||||
.selected_setting_new_value
|
||||
.push(c);
|
||||
if app.states.settings.show_popup {
|
||||
app.states.settings.selected_setting_new_value.push(c);
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
|
||||
Reference in New Issue
Block a user