Skip to content

Commit

Permalink
add robber label
Browse files Browse the repository at this point in the history
  • Loading branch information
davi-bart committed Feb 17, 2024
1 parent 1f65c0b commit 18ac764
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/it/unibo/view/player/CurrentPlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;

/**
* View class for the current player. It shows his resources and some buttons.
Expand Down Expand Up @@ -58,7 +59,14 @@ public void draw() {
dieImages.getChildren().add(roll1);
dieImages.getChildren().add(roll2);

info.getChildren().add(new Label("Current player: " + controller.getCurrentPlayerName()));
final HBox labels = new HBox();
labels.getChildren().add(new Label("Current player: " + controller.getCurrentPlayerName()));
if (controller.mustPlaceRobber()) {
final Label robberLabel = new Label(" Click on a tile to place the robber.");
robberLabel.setTextFill(Color.RED);
labels.getChildren().add(robberLabel);
}
info.getChildren().add(labels);
info.getChildren().add(buttonsBox);
info.getChildren().add(dieImages);
super.getChildren().add(info);
Expand Down

0 comments on commit 18ac764

Please sign in to comment.