Board layers
This commit is contained in:
+13
-5
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user