Add: Added Building Icon in Player Side Panel
This commit is contained in:
@@ -236,6 +236,7 @@ public class MainFXMLController {
|
|||||||
case "builders" -> new ArrayList<>(p.builders);
|
case "builders" -> new ArrayList<>(p.builders);
|
||||||
case "shamans" -> new ArrayList<>(p.shamans);
|
case "shamans" -> new ArrayList<>(p.shamans);
|
||||||
case "hunters" -> new ArrayList<>(p.hunters);
|
case "hunters" -> new ArrayList<>(p.hunters);
|
||||||
|
case "building" -> new ArrayList<>(p.buildingCards);
|
||||||
default -> new ArrayList<>();
|
default -> new ArrayList<>();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -345,7 +346,7 @@ public class MainFXMLController {
|
|||||||
}
|
}
|
||||||
headerRow.getChildren().addAll(totem, usernameLabel);
|
headerRow.getChildren().addAll(totem, usernameLabel);
|
||||||
|
|
||||||
// Riga 2: cibo + prestigio
|
// Riga 2: cibo + prestigio + building
|
||||||
HBox statsRow = new HBox(10);
|
HBox statsRow = new HBox(10);
|
||||||
statsRow.setAlignment(Pos.CENTER);
|
statsRow.setAlignment(Pos.CENTER);
|
||||||
|
|
||||||
@@ -367,13 +368,31 @@ public class MainFXMLController {
|
|||||||
prestigeLabel.getStyleClass().add("label-small");
|
prestigeLabel.getStyleClass().add("label-small");
|
||||||
prestigeBox.getChildren().addAll(PPIcon, prestigeLabel);
|
prestigeBox.getChildren().addAll(PPIcon, prestigeLabel);
|
||||||
|
|
||||||
statsRow.getChildren().addAll(foodBox, prestigeBox);
|
ImageView icon = new ImageView();
|
||||||
|
icon.setFitWidth(28);
|
||||||
|
icon.setFitHeight(28);
|
||||||
|
icon.setPreserveRatio(true);
|
||||||
|
icon.setImage(loadImage("/GUIImages/Icons/Building.png"));
|
||||||
|
|
||||||
|
ArrayList<PlayableCard> cards = getPlayerCards(player.getUserName(), "building");
|
||||||
|
if (cards.isEmpty()) {
|
||||||
|
ColorAdjust grayscale = new ColorAdjust();
|
||||||
|
icon.setEffect(grayscale);
|
||||||
|
icon.setOpacity(0.3);
|
||||||
|
} else {
|
||||||
|
icon.setOnMouseClicked(e -> openPopup(new ArrayList<>(cards)));
|
||||||
|
addHoverZoom(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
statsRow.getChildren().addAll(foodBox, prestigeBox,icon);
|
||||||
|
|
||||||
// Righe 3-4: icone carte
|
// Righe 3-4: icone carte
|
||||||
HBox iconsRow1 = new HBox(6);
|
HBox iconsRow1 = new HBox(6);
|
||||||
|
iconsRow1.setSpacing(20);
|
||||||
iconsRow1.setAlignment(Pos.CENTER);
|
iconsRow1.setAlignment(Pos.CENTER);
|
||||||
HBox iconsRow2 = new HBox(6);
|
HBox iconsRow2 = new HBox(6);
|
||||||
iconsRow2.setAlignment(Pos.CENTER);
|
iconsRow2.setAlignment(Pos.CENTER);
|
||||||
|
iconsRow2.setSpacing(20);
|
||||||
renderIcons(iconsRow1, iconsRow2, player);
|
renderIcons(iconsRow1, iconsRow2, player);
|
||||||
|
|
||||||
card.getChildren().addAll(headerRow, statsRow, iconsRow1, iconsRow2);
|
card.getChildren().addAll(headerRow, statsRow, iconsRow1, iconsRow2);
|
||||||
|
|||||||
Reference in New Issue
Block a user