|
|
|
|
@ -206,7 +206,7 @@ fn init_play_menu(
|
|
|
|
|
// Opponent button
|
|
|
|
|
parent
|
|
|
|
|
.spawn((
|
|
|
|
|
ButtonAction(ai::PlayState::AiBogo),
|
|
|
|
|
ButtonAction(ai::PlayState::Human),
|
|
|
|
|
ButtonBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
padding: UiRect::all(Val::Px(2.0)),
|
|
|
|
|
@ -224,7 +224,7 @@ fn init_play_menu(
|
|
|
|
|
parent.spawn(TextBundle {
|
|
|
|
|
text: Text {
|
|
|
|
|
sections: vec![TextSection {
|
|
|
|
|
value: "Opponent: AI".into(),
|
|
|
|
|
value: "Human Opponent".into(),
|
|
|
|
|
style: TextStyle {
|
|
|
|
|
color: Color::WHITE,
|
|
|
|
|
font_size: 12.0,
|
|
|
|
|
@ -388,7 +388,7 @@ fn handle_button_press<S: States + Clone + Component>(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn manage_ai_button(
|
|
|
|
|
mut curr: Res<State<ai::PlayState>>,
|
|
|
|
|
curr: Res<State<ai::PlayState>>,
|
|
|
|
|
mut query: Query<(&mut ButtonAction<PlayState>, &Children)>,
|
|
|
|
|
mut texts: Query<&mut Text>,
|
|
|
|
|
) {
|
|
|
|
|
@ -402,8 +402,8 @@ fn manage_ai_button(
|
|
|
|
|
texts.get_mut(*c).iter_mut().for_each(|t| {
|
|
|
|
|
t.sections.iter_mut().for_each(|s| {
|
|
|
|
|
s.value = match ba.0 {
|
|
|
|
|
PlayState::AiBogo => "Opponent: AI".into(),
|
|
|
|
|
PlayState::Human => "Opponent: Human".into()
|
|
|
|
|
PlayState::AiBogo => "AI Opponent".into(),
|
|
|
|
|
PlayState::Human => "Human Opponent".into()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|