generated from GarandPLG/rust-flake-template
Add navigation and selection for skirmish cells
Reclassify Escape key as Quit and add directional actions to move the focused cell.
This commit is contained in:
1 parent
d35d803a78
commit
363baa1c1a
8 files changed
+81
-13
No files matched your search
@@ -9,6 +9,16 @@ pub fn skirmish_keybindings(app: &mut App, key_event: &KeyEvent) {
|
||||
if let Some(action) = event_to_action(&key_event) {
|
||||
common_keybindings(app, action);
|
||||
match action {
|
||||
Action::Up => {
|
||||
app.states.skirmish.focused_cell.move_up();
|
||||
|
||||
// if app.states.skirmish.horizontal_offset.get_value() {
|
||||
|
||||
// }
|
||||
}
|
||||
Action::Down => app.states.skirmish.focused_cell.move_down(),
|
||||
Action::Left => app.states.skirmish.focused_cell.move_left(),
|
||||
Action::Right => app.states.skirmish.focused_cell.move_right(),
|
||||
Action::ScrollUp => app.states.skirmish.vertical_offset.prev(),
|
||||
Action::ScrollDown => app.states.skirmish.vertical_offset.next(),
|
||||
Action::ScrollLeft => app.states.skirmish.horizontal_offset.prev(),
|
||||
|
||||
Reference in new issue
Block a user