Board layers

This commit is contained in:
2026-06-15 23:35:18 -05:00
parent d1d0824d37
commit 01cd73ca3b
29 changed files with 2166 additions and 2051 deletions
+13 -5
View File
@@ -107,13 +107,21 @@ impl Ui {
return; // no mode tick during any animation (even when just ended)
}
// The game only advances during normal play (InputMode::Board). While a
// scroll or menu overlay is open the input mode is Scroll/Menu, so the game
// is paused — otherwise `game.tick` would call `handle_scroll`, clearing the
// scroll the instant its open animation finished.
let input_mode = crate::input::current_input_mode(mode, self);
match mode {
// Play: tick the game, then check whether a scroll overlay appeared.
// Play: tick the game (only in Board mode), then check whether a scroll
// overlay appeared as a result of this tick.
Mode::Play(game) => {
game.tick(dt);
if let Some(scroll) = &game.active_scroll {
let lines = scroll.lines.clone();
self.active_animation = Some(Box::new(ScrollOpenAnimation::new(lines)));
if matches!(input_mode, crate::input::InputMode::Board) {
game.tick(dt);
if let Some(scroll) = &game.active_scroll {
let lines = scroll.lines.clone();
self.active_animation = Some(Box::new(ScrollOpenAnimation::new(lines)));
}
}
}
// Edit: only the cursor blink advances; the game does not exist here.