26 lines
463 B
Rust
26 lines
463 B
Rust
// src/state/pages/intro.rs
|
|
|
|
#[derive(Default, Clone, Debug)]
|
|
pub struct IntroState {
|
|
pub selected_option: usize,
|
|
}
|
|
|
|
impl IntroState {
|
|
pub fn new() -> Self {
|
|
Self::default()
|
|
}
|
|
|
|
pub fn next_option(&mut self) {
|
|
if self.selected_option < 3 {
|
|
self.selected_option += 1;
|
|
}
|
|
}
|
|
|
|
pub fn previous_option(&mut self) {
|
|
if self.selected_option > 0 {
|
|
self.selected_option -= 1
|
|
}
|
|
}
|
|
}
|
|
|