centralized general movement

This commit is contained in:
Priec
2025-08-27 01:06:54 +02:00
parent 18393ff661
commit d641ad1bbb
9 changed files with 451 additions and 61 deletions

View File

@@ -1,4 +1,5 @@
// src/state/pages/intro.rs
use crate::movement::MovementAction;
#[derive(Default, Clone, Debug)]
pub struct IntroState {
@@ -23,3 +24,25 @@ impl IntroState {
}
}
impl IntroState {
pub fn handle_movement(&mut self, action: MovementAction) -> bool {
match action {
MovementAction::Next | MovementAction::Right | MovementAction::Down => {
self.next_option();
true
}
MovementAction::Previous | MovementAction::Left | MovementAction::Up => {
self.previous_option();
true
}
MovementAction::Select => {
// Actual selection handled in event loop (UiContext::Intro)
true
}
MovementAction::Esc => {
// Nothing special for Intro, but could be used to quit
true
}
}
}
}