clicking through animations/intro scroll

main
Elijah C. Voigt 2 years ago
parent ca95bf46ec
commit bd303af745

@ -84,7 +84,7 @@ impl Plugin for Display3dPlugin {
setup_capture_piece.run_if(any_component_changed::<Handle<StandardMaterial>>()), setup_capture_piece.run_if(any_component_changed::<Handle<StandardMaterial>>()),
capture_piece.run_if(any_with_component::<game::Captured>()), capture_piece.run_if(any_with_component::<game::Captured>()),
skip_animation skip_animation
.run_if(just_pressed(KeyCode::Return)) .run_if(just_pressed(KeyCode::Return).or_else(just_pressed(MouseButton::Left)))
.run_if(in_state(GameState::Play)), .run_if(in_state(GameState::Play)),
), ),
) )

@ -24,7 +24,8 @@ impl Plugin for IntroPlugin {
// Updated for as long as there is scrolling text // Updated for as long as there is scrolling text
manage_scroll_text_animation.run_if( manage_scroll_text_animation.run_if(
any_component_added::<ui::TextScrollAnimation>() any_component_added::<ui::TextScrollAnimation>()
.or_else(just_pressed(KeyCode::Return)), .or_else(just_pressed(KeyCode::Return))
.or_else(just_pressed(MouseButton::Left)),
), ),
// Play intro manages playing the intro of each individual paragraph // Play intro manages playing the intro of each individual paragraph
// Runs every time the TextScroll component (managed by manage_scroll_text_animation) is updated // Runs every time the TextScroll component (managed by manage_scroll_text_animation) is updated
@ -239,6 +240,7 @@ fn scroll_text(
tweaks: Res<Assets<tweak::Tweaks>>, tweaks: Res<Assets<tweak::Tweaks>>,
time: Res<Time>, time: Res<Time>,
keys: Res<Input<KeyCode>>, keys: Res<Input<KeyCode>>,
mouse: Res<Input<MouseButton>>,
parents: Query<&Parent>, parents: Query<&Parent>,
mut commands: Commands, mut commands: Commands,
) { ) {
@ -258,7 +260,8 @@ fn scroll_text(
} }
// If user pressed enter, skip to end of paragraph // If user pressed enter, skip to end of paragraph
text_scroll.progress = if keys.just_pressed(KeyCode::Return) { text_scroll.progress =
if keys.just_pressed(KeyCode::Return) || mouse.just_pressed(MouseButton::Left) {
usize::MAX usize::MAX
} }
// Otherwise, progress by some fixed increment // Otherwise, progress by some fixed increment

@ -27,7 +27,10 @@ impl Plugin for TutorialPlugin {
// A piece is de-selected // A piece is de-selected
.or_else(any_component_removed::<game::Selected>()) .or_else(any_component_removed::<game::Selected>())
// TEMP: The user hits 'enter' // TEMP: The user hits 'enter'
.or_else(just_pressed(KeyCode::Return)), .or_else(
just_pressed(KeyCode::Return)
.or_else(just_pressed(MouseButton::Left)),
),
), ),
), ),
), ),

Loading…
Cancel
Save