diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/PlayerStatusController.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/PlayerStatusController.java
index cbee599..0252763 100644
--- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/PlayerStatusController.java
+++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/PlayerStatusController.java
@@ -20,15 +20,19 @@ public class PlayerStatusController {
private static final Logger LOGGER = Logger.getLogger(PlayerStatusController.class.getName());
- @FXML private Label playerName;
- @FXML private Label playerMoney;
- @FXML private ImageView dealerIcon;
- @FXML private Pane parent;
- @FXML private VBox playerStatusBox;
- @FXML private HBox statusInnerBoxTop;
- @FXML private HBox statusInnerBoxBottom;
+ @FXML Label playerName;
+ @FXML Label playerMoney;
+ @FXML ImageView dealerIcon;
+ @FXML ImageView playerProfileImage;
+ @FXML Pane parent;
+ @FXML VBox playerStatusBox;
+ @FXML HBox statusInnerBoxTop;
+ @FXML HBox statusInnerBoxBottom;
private Image dealerImage;
+ // Profile images (loaded from resources/images/profile-picture)
+ private Image profileUserImage;
+ private Image profileDealerImage;
private Player player;
private boolean turnHighlighted;
private static final String DEALER_IMAGE_PATH = "/images/chip-dealer-blue-5.png";
@@ -53,6 +57,26 @@ public class PlayerStatusController {
LOGGER.log(Level.SEVERE, "Error loading dealer image", e);
}
+ try {
+ var base = "/images/profile-picture/";
+ var uUser = getClass().getResource(base + "poker_user_491.png");
+ var uDealer = getClass().getResource(base + "poker_dealer_471.png");
+
+ if (uUser != null) {
+ profileUserImage = new Image(uUser.toExternalForm(), true);
+ }
+ if (uDealer != null) {
+ profileDealerImage = new Image(uDealer.toExternalForm(), true);
+ }
+
+ if (playerProfileImage != null && profileUserImage != null) {
+ playerProfileImage.setImage(profileUserImage);
+ }
+
+ } catch (Exception e) {
+ LOGGER.log(Level.FINE, "Could not load profile images", e);
+ }
+
dealerIcon.layoutXProperty().bind(parent.widthProperty().multiply(DEALER_ICON_X_FACTOR));
dealerIcon.setVisible(false);
}
@@ -160,6 +184,14 @@ public class PlayerStatusController {
if (isDealer && dealerImage != null) {
dealerIcon.setImage(dealerImage);
}
+
+ if (playerProfileImage != null) {
+ if (isDealer && profileDealerImage != null) {
+ playerProfileImage.setImage(profileDealerImage);
+ } else if (profileUserImage != null) {
+ playerProfileImage.setImage(profileUserImage);
+ }
+ }
}
/**
diff --git a/src/main/resources/images/profile-picture/poker_dealer_471.png b/src/main/resources/images/profile-picture/poker_dealer_471.png
new file mode 100644
index 0000000..6df5761
Binary files /dev/null and b/src/main/resources/images/profile-picture/poker_dealer_471.png differ
diff --git a/src/main/resources/images/profile-picture/poker_user_491.png b/src/main/resources/images/profile-picture/poker_user_491.png
new file mode 100644
index 0000000..8e0047c
Binary files /dev/null and b/src/main/resources/images/profile-picture/poker_user_491.png differ
diff --git a/src/main/resources/ui-structure/gameuicomponents/Playerstatus.fxml b/src/main/resources/ui-structure/gameuicomponents/Playerstatus.fxml
index 19e7b1f..278f3b7 100644
--- a/src/main/resources/ui-structure/gameuicomponents/Playerstatus.fxml
+++ b/src/main/resources/ui-structure/gameuicomponents/Playerstatus.fxml
@@ -4,6 +4,7 @@
+
@@ -50,6 +52,7 @@ and status displays will be dynamically populated with real-time data from the s
+
@@ -61,12 +64,28 @@ and status displays will be dynamically populated with real-time data from the s
prefWidth="40"
prefHeight="40"/>
+
+
+
+
+
+
+
+
+