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 -6
View File
@@ -112,7 +112,7 @@ pub static KEYBINDINGS: &[KeyBinding] = &[
kind: KeyEventKind::Press,
modifiers: KeyModifiers::NONE,
group: Group::Input,
symbol: "*",
symbol: "[All]",
description: "All keyboard characters",
},
];
@@ -129,11 +129,10 @@ pub fn event_to_action(event: &KeyEvent) -> Option<Action> {
return Some(b.action);
}
if KEYBINDINGS.iter().any(|b| {
matches!(b.action, Action::WildCard(_))
&& b.kind == event.kind
&& b.modifiers == event.modifiers
}) {
if KEYBINDINGS
.iter()
.any(|b| matches!(b.action, Action::WildCard(_)) && b.kind == event.kind)
{
if let KeyCode::Char(c) = event.code {
return Some(Action::WildCard(c));
}