Add scrolling actions and board widget

Introduce directional and scroll actions, update keybindings, add
scrollbar
state to SkirmishState, and render the board with a new BoardWidget.
Adjust CLI
defaults and layout heights accordingly.
This commit is contained in:
GarandPLG committed 2026-03-26 11:05:43 +01:00
1 parent 0577697059
commit cc179cee03
9 files changed
+205 -15

No files matched your search

+4
View File
@@ -7,6 +7,10 @@ use ratatui::crossterm::event::KeyEvent;
pub fn skirmish_keybindings(app: &mut App, key_event: &KeyEvent) {
if let Some(action) = event_to_action(&key_event) {
match action {
Action::ScrollUp => app.states.skirmish.vertical_scrollbar.prev(),
Action::ScrollDown => app.states.skirmish.vertical_scrollbar.next(),
Action::ScrollLeft => app.states.skirmish.horizontal_scrollbar.prev(),
Action::ScrollRight => app.states.skirmish.horizontal_scrollbar.next(),
Action::Quit => app.exit = true,
Action::Quit2 => app.exit = true,
Action::Esc => app.view = View::MainMenu,