|
|
|
|
@ -182,6 +182,7 @@ fn initialize_tutorial(
|
|
|
|
|
width: Val::Percent(33.0),
|
|
|
|
|
max_height: Val::Percent(100.0),
|
|
|
|
|
padding: UiRect::all(Val::Px(25.0)),
|
|
|
|
|
flex_direction: FlexDirection::Column,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
background_color: Color::hex(&background_hex).unwrap().into(),
|
|
|
|
|
@ -210,6 +211,69 @@ fn initialize_tutorial(
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
if *step == TutorialState::Outro {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(NodeBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
flex_direction: FlexDirection::Row,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn((
|
|
|
|
|
menu::ButtonAction(tutorial::TutorialState::None),
|
|
|
|
|
menu::ButtonAction(GameState::Restart),
|
|
|
|
|
menu::ButtonAction(menu::MenuState::None),
|
|
|
|
|
ButtonBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
padding: UiRect::all(Val::Px(5.0)),
|
|
|
|
|
margin: UiRect::all(Val::Px(5.0)),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
background_color: Color::ORANGE.with_a(0.5).into(),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn((TextBundle::from_section(
|
|
|
|
|
"Start Over",
|
|
|
|
|
TextStyle {
|
|
|
|
|
color: Color::BLACK,
|
|
|
|
|
font_size: 16.0,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
),));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parent
|
|
|
|
|
.spawn((
|
|
|
|
|
menu::ButtonAction(tutorial::TutorialState::None),
|
|
|
|
|
menu::ButtonAction(GameState::Play),
|
|
|
|
|
menu::ButtonAction(menu::MenuState::None),
|
|
|
|
|
ButtonBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
padding: UiRect::all(Val::Px(5.0)),
|
|
|
|
|
margin: UiRect::all(Val::Px(5.0)),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
background_color: Color::ORANGE.with_a(0.5).into(),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn((TextBundle::from_section(
|
|
|
|
|
"Continue Game",
|
|
|
|
|
TextStyle {
|
|
|
|
|
color: Color::BLACK,
|
|
|
|
|
font_size: 16.0,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
),));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
@ -305,7 +369,7 @@ fn step(
|
|
|
|
|
next_state.set(next);
|
|
|
|
|
}
|
|
|
|
|
// After the outro, we exit the tutorial
|
|
|
|
|
TutorialState::Outro => next_state.set(TutorialState::None),
|
|
|
|
|
TutorialState::Outro => error!("Press a button!"),
|
|
|
|
|
TutorialState::_Promotions => todo!("Not implemented yet!"),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|