/// Update text with the correct turn
Update text with the correct turn
Update text with the correct turn
fn next_move_text_update(turn: Res<PlayerTurn>, mut query: Query<(&mut Text, &NextMoveText)>) {
    if !turn.is_changed() {
        return;
    }
    for (mut text, _tag) in query.iter_mut() {
        text.sections[0].value = format!(
            "Next move: {}",
            match turn.0 {
                PieceColor::White => "White",
                PieceColor::Black => "Black",
            }
        );
    }
}
fn next_move_text_update ( turn : Res < PlayerTurn > , mut query : Query < ( & mut Text , & NextMoveText ) > ) { if ! turn . is_changed ( ) { return ; } for ( mut text , _tag ) in query . iter_mut ( ) { text . sections [ 0 ] . value = format ! ( " " match turn 0 { PieceColor White " " PieceColor Black " " } ) ; } }
Update text with the correct turn
Update text with the correct turn
turn
Res<PlayerTurn>
query
Query<(&mut Text, &NextMoveText)>