Fixed: Totem CHoice fxml and controller labels color

This commit is contained in:
rubenpirreram
2026-05-15 15:32:25 +02:00
parent dbcefe254b
commit a6b9b1b931
2 changed files with 10 additions and 26 deletions
@@ -23,7 +23,6 @@ public class TotemFXMLController {
public ImageView backgroundImage; public ImageView backgroundImage;
@FXML private HBox mainHBox; @FXML private HBox mainHBox;
@FXML private Label turnBanner; @FXML private Label turnBanner;
@FXML private Label selectedLabel;
@FXML private Button confirmButton; @FXML private Button confirmButton;
private ClientController controller; private ClientController controller;
@@ -47,7 +46,6 @@ public class TotemFXMLController {
mainHBox.getChildren().clear(); mainHBox.getChildren().clear();
selectedIndex = -1; selectedIndex = -1;
selectedFrame = null; selectedFrame = null;
selectedLabel.setText("");
String chooser = controller.miniModel.currentState.getCurrentPlayer().getUserName(); // adatta al tuo campo String chooser = controller.miniModel.currentState.getCurrentPlayer().getUserName(); // adatta al tuo campo
boolean myTurn = chooser.equals(controller.myUsername); boolean myTurn = chooser.equals(controller.myUsername);
@@ -79,9 +77,9 @@ public class TotemFXMLController {
turnBanner.setText("✦ It's your turn to choice ✦"); turnBanner.setText("✦ It's your turn to choice ✦");
turnBanner.setStyle( turnBanner.setStyle(
"-fx-font-family: 'Cinzel'; -fx-font-size: 13; -fx-letter-spacing: 3;" + "-fx-font-family: 'Cinzel'; -fx-font-size: 13; -fx-letter-spacing: 3;" +
"-fx-text-fill: #f4c05a;" + "-fx-text-fill: #000000;" +
"-fx-background-color: rgba(244,192,90,0.1);" + "-fx-background-color: linear-gradient(to right, #f4c05a, #c8791a, #f4c05a);" +
"-fx-border-color: rgba(244,192,90,0.45); -fx-border-width: 1;" + "-fx-border-color: #000000; -fx-border-width: 1;" +
"-fx-border-radius: 3; -fx-background-radius: 3;" + "-fx-border-radius: 3; -fx-background-radius: 3;" +
"-fx-padding: 10 28 10 28;" + "-fx-padding: 10 28 10 28;" +
"-fx-effect: dropshadow(gaussian, rgba(244,192,90,0.3), 18, 0, 0, 0);" "-fx-effect: dropshadow(gaussian, rgba(244,192,90,0.3), 18, 0, 0, 0);"
@@ -90,9 +88,9 @@ public class TotemFXMLController {
turnBanner.setText("Waiting " + chooser + " chooses his totem…"); turnBanner.setText("Waiting " + chooser + " chooses his totem…");
turnBanner.setStyle( turnBanner.setStyle(
"-fx-font-family: 'Cinzel'; -fx-font-size: 11; -fx-letter-spacing: 2;" + "-fx-font-family: 'Cinzel'; -fx-font-size: 11; -fx-letter-spacing: 2;" +
"-fx-text-fill: rgba(200,155,90,0.6);" + "-fx-text-fill: #000000;" +
"-fx-background-color: rgba(120,60,10,0.18);" + "-fx-background-color: linear-gradient(to right, #f4c05a, #c8791a, #f4c05a)" +
"-fx-border-color: rgba(200,120,20,0.22); -fx-border-width: 1;" + "-fx-border-color: #000000; -fx-border-width: 1;" +
"-fx-border-radius: 3; -fx-background-radius: 3;" + "-fx-border-radius: 3; -fx-background-radius: 3;" +
"-fx-padding: 10 28 10 28;" "-fx-padding: 10 28 10 28;"
); );
@@ -161,7 +159,6 @@ public class TotemFXMLController {
pop.setToX(1.08); pop.setToY(1.08); pop.setToX(1.08); pop.setToY(1.08);
pop.setAutoReverse(true); pop.setCycleCount(2); pop.play(); pop.setAutoReverse(true); pop.setCycleCount(2); pop.play();
selectedLabel.setText(capitalize(totem).toUpperCase() + " choice");
updateConfirmButton(true); updateConfirmButton(true);
}); });
@@ -181,8 +178,7 @@ public class TotemFXMLController {
} }
private String frameStyle(boolean selected) { private String frameStyle(boolean selected) {
return " " + return "-fx-border-color: " + (selected ? "#f4c05a" : "rgba(200,120,20,0.28)") + ";" +
"-fx-border-color: " + (selected ? "#f4c05a" : "rgba(200,120,20,0.28)") + ";" +
"-fx-border-width: " + (selected ? "2" : "0") + ";" + "-fx-border-width: " + (selected ? "2" : "0") + ";" +
"-fx-border-radius: 4 4 0 0; -fx-background-radius: 4 4 0 0;" + "-fx-border-radius: 4 4 0 0; -fx-background-radius: 4 4 0 0;" +
(selected ? "-fx-effect: dropshadow(gaussian, rgba(244,192,90,0.35), 22, 0, 0, 0);" : ""); (selected ? "-fx-effect: dropshadow(gaussian, rgba(244,192,90,0.35), 22, 0, 0, 0);" : "");
@@ -190,7 +186,7 @@ public class TotemFXMLController {
private String nameStyle(boolean selected) { private String nameStyle(boolean selected) {
return "-fx-font-family: 'Cinzel'; -fx-font-size: 10; -fx-letter-spacing: 2;" + return "-fx-font-family: 'Cinzel'; -fx-font-size: 10; -fx-letter-spacing: 2;" +
"-fx-text-fill: " + (selected ? "#f4c05a" : "rgba(200,175,130,0.65)") + ";"; "-fx-text-fill: " + (selected ? "#f4c05a" : "ffffff") + ";";
} }
private String capitalize(Totems t) { private String capitalize(Totems t) {
@@ -198,11 +194,6 @@ public class TotemFXMLController {
return Character.toUpperCase(s.charAt(0)) + s.substring(1); return Character.toUpperCase(s.charAt(0)) + s.substring(1);
} }
private String totemElement(Totems t) {
return switch (t) {
default -> t.name();
};
}
@FXML @FXML
private void onConfirm() { private void onConfirm() {
+2 -9
View File
@@ -41,13 +41,11 @@
<!-- Banner turno --> <!-- Banner turno -->
<Label fx:id="turnBanner" maxWidth="640" wrapText="true" textAlignment="CENTER" <Label fx:id="turnBanner" maxWidth="640" wrapText="true" textAlignment="CENTER"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12; -fx-letter-spacing: 3; style="-fx-font-family: 'Cinzel'; -fx-font-size: 12; -fx-letter-spacing: 3;
-fx-padding: 10 28 10 28; -fx-background-radius: 3; -fx-border-radius: 3;"> -fx-padding: 10 28 10 28; -fx-background-radius: 3; -fx-border-radius: 3;
-fx-background-color: linear-gradient(to right, #f4c05a, #c8791a, #f4c05a)">
<VBox.margin><Insets bottom="20"/></VBox.margin> <VBox.margin><Insets bottom="20"/></VBox.margin>
</Label> </Label>
<Label text="Pre game totem choosing stage"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 10; -fx-text-fill: #9a5c14;
-fx-letter-spacing: 5;"/>
<Label text="Choice your totem" <Label text="Choice your totem"
style="-fx-font-family: 'Cinzel Decorative'; -fx-font-size: 30; -fx-font-weight: bold; style="-fx-font-family: 'Cinzel Decorative'; -fx-font-size: 30; -fx-font-weight: bold;
@@ -65,11 +63,6 @@
<VBox.margin><Insets bottom="18"/></VBox.margin> <VBox.margin><Insets bottom="18"/></VBox.margin>
</HBox> </HBox>
<Label fx:id="selectedLabel" text=""
style="-fx-font-family: 'Cinzel'; -fx-font-size: 10; -fx-text-fill: rgba(200,120,20,0.75);
-fx-letter-spacing: 3;">
<VBox.margin><Insets bottom="10"/></VBox.margin>
</Label>
<Button fx:id="confirmButton" text="CONFIRM" onAction="#onConfirm" disable="true" <Button fx:id="confirmButton" text="CONFIRM" onAction="#onConfirm" disable="true"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12; -fx-font-weight: bold; style="-fx-font-family: 'Cinzel'; -fx-font-size: 12; -fx-font-weight: bold;