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:
2026-03-16 10:27:44 +01:00
parent 2dbe378470
commit fd0f6defea
8 changed files with 71 additions and 88 deletions
+5 -14
View File
@@ -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);
}
}
_ => (),