input_mode_during
This commit is contained in:
@@ -25,8 +25,8 @@ pub enum InputMode {
|
||||
Scroll,
|
||||
/// A menu overlay is active; all input is captured for menu navigation.
|
||||
Menu,
|
||||
/// An animation is running; all input is discarded.
|
||||
Animating,
|
||||
/// An animation is running and has not claimed any input mode; all input is discarded.
|
||||
Ignore,
|
||||
/// Reserved for a post-transition freeze; nothing currently produces this mode.
|
||||
#[allow(dead_code)]
|
||||
Frozen,
|
||||
@@ -34,10 +34,11 @@ pub enum InputMode {
|
||||
|
||||
/// Determines the current input mode from game and UI state.
|
||||
pub(crate) fn current_input_mode(game: &GameState, ui: &Ui) -> InputMode {
|
||||
// Any active animation (or a pending transition waiting for its area) blocks input.
|
||||
if ui.active_animation.is_some() || ui.pending_transition.is_some() {
|
||||
return InputMode::Animating;
|
||||
// An active animation declares its own input mode; pending transitions ignore input.
|
||||
if let Some(anim) = &ui.active_animation {
|
||||
return anim.input_mode_during();
|
||||
}
|
||||
if ui.pending_transition.is_some() { return InputMode::Ignore; }
|
||||
if ui.menu.is_some() { return InputMode::Menu; }
|
||||
if game.active_scroll.is_some() { InputMode::Scroll } else { InputMode::Board }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user