Fixed: pom.xml, main.fxml, changed sidePanel now is all in main.fxml

This commit is contained in:
rubenpirreram
2026-05-20 22:59:07 +02:00
parent 1d9b3e8caa
commit 131bd10e6d
4 changed files with 48 additions and 69 deletions
+2
View File
@@ -104,6 +104,7 @@
<transformer>
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
</transformer>
<transformer />
</transformers>
<filters>
<filter>
@@ -112,6 +113,7 @@
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/versions/9/module-info.class</exclude>
</excludes>
</filter>
</filters>
+2
View File
@@ -158,6 +158,7 @@
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
@@ -166,6 +167,7 @@
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/versions/9/module-info.class</exclude>
</excludes>
</filter>
</filters>
@@ -20,6 +20,7 @@ import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.effect.ColorAdjust;
@@ -39,12 +40,16 @@ import java.util.*;
public class MainFXMLController {
@FXML private ScrollPane playerSide;
@FXML private HBox mainHBox;
@FXML private HBox board;
@FXML private HBox upperList;
@FXML private HBox lowerList;
@FXML private HBox myHand;
@FXML private VBox sidePanel;
@FXML private HBox buttonRow;
@FXML private Button skipBtn;
@FXML private Button detailsBtn;
@FXML private HBox info;
@FXML private Label era;
@FXML private Label round;
@@ -89,6 +94,8 @@ public class MainFXMLController {
}
}
});
addHoverZoom(skipBtn);
addHoverZoom(detailsBtn);
initPopup();
renderBackground();
}
@@ -523,17 +530,6 @@ public class MainFXMLController {
card.getChildren().add(overlay);
board.getChildren().add(card);
}
private Color totemColor(Totems totem) {
return switch (totem) {
case ORANGE -> Color.rgb(223, 76, 17);
case BLUE -> Color.rgb(42, 155, 179);
case PURPLE -> Color.rgb(65, 20, 42);
case YELLOW -> Color.rgb(248, 201, 57);
case WHITE -> Color.rgb(232, 232, 231);
// aggiungi i tuoi valori reali
default -> Color.GRAY;
};
}
private void renderSlotMap() {
int i = 0;
@@ -563,47 +559,17 @@ public class MainFXMLController {
}
private void renderSidePanel() {
sidePanel.getChildren().clear();
sidePanel.setSpacing(6);
era.setText(Integer.toString(controller.miniModel.currentState.getEra()));
round.setText(Integer.toString(controller.miniModel.currentState.getRound()));
player.setText(controller.miniModel.currentState.getCurrentPlayer().getUserName());
VBox.setMargin(info, new Insets(5, 5, 5, 5));
sidePanel.getChildren().add(info);
HBox buttonRow = new HBox(8);
buttonRow.setAlignment(Pos.CENTER);
VBox.setMargin(buttonRow, new Insets(0, 5, 5, 5));
javafx.scene.control.Button skipBtn = new javafx.scene.control.Button("Skip Turn");
skipBtn.getStyleClass().add("action-button");
skipBtn.setOnAction(e -> controller.skipTurn(controller.myUsername));
addHoverZoom(skipBtn);
javafx.scene.control.Button detailsBtn = new javafx.scene.control.Button("Ending Details");
detailsBtn.getStyleClass().add("action-button");
detailsBtn.setOnAction(e -> openDetailsPopup());
addHoverZoom(detailsBtn);
buttonRow.getChildren().addAll(skipBtn, detailsBtn);
sidePanel.getChildren().add(buttonRow);
// ← VBox separato solo per i player
VBox playerList = new VBox(6);
playerList.setFillWidth(true);
for (Player p : controller.miniModel.players.values()) {
renderPlayer(p, playerList); // ← passa playerList invece di sidePanel
}
ScrollPane scrollPane = new ScrollPane(playerList);
scrollPane.setFitToWidth(true);
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
scrollPane.setStyle("-fx-background: transparent; -fx-background-color: transparent;");
VBox.setVgrow(scrollPane, Priority.ALWAYS);
sidePanel.getChildren().add(scrollPane);
playerSide.setContent(playerList);
}
// ==== POPUP ====
@@ -676,6 +642,7 @@ public class MainFXMLController {
}
showPopup();
}
@FXML
private void openDetailsPopup() {
popupCards.getChildren().clear();
ImageView img = new ImageView(loadImage("/GUIImages/Backs/back-118.png"));
+35 -27
View File
@@ -4,6 +4,7 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Button?>
<HBox fx:id="mainHBox"
maxHeight="Infinity" maxWidth="Infinity"
prefHeight="1080.0" prefWidth="1920.0"
@@ -12,7 +13,9 @@
fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController"
stylesheets="@styles.css">
<children>
<HBox maxHeight="30" minHeight="30" prefHeight="30">
</HBox>
<!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile -->
<VBox alignment="CENTER"
fillWidth="false"
@@ -60,36 +63,41 @@
<Insets bottom="10" left="10" right="10" top="10" />
</HBox.margin>
<children>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" vbarPolicy="AS_NEEDED" VBox.vgrow="ALWAYS">
<content>
<VBox spacing="10">
<HBox fx:id="info" prefHeight="107.0" prefWidth="483.0" styleClass="frame">
<children>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<HBox fx:id="info" prefHeight="107.0" prefWidth="483.0" styleClass="frame">
<children>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<Label styleClass="label-medium" text="Era" />
<Label fx:id="era" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<Label styleClass="label-medium" text="Round" />
<Label fx:id="round" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<Label styleClass="label-medium" text="Player" />
<Label fx:id="player" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
</children>
</HBox>
<!-- altri elementi qui sotto -->
<Label styleClass="label-medium" text="Era" />
<Label fx:id="era" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
</content>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<Label styleClass="label-medium" text="Round" />
<Label fx:id="round" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
<children>
<Label styleClass="label-medium" text="Player" />
<Label fx:id="player" styleClass="label-medium" text="VALORE" />
</children>
</VBox>
</children>
</HBox>
<HBox alignment="CENTER" fx:id="buttonRow" >
<HBox spacing="10">
<Button fx:id="skipBtn" styleClass="action-button" text="Skip Turn"/>
<Button fx:id="detailsBtn" styleClass="action-button" onAction="#openDetailsPopup" text="Ending Details"/>
</HBox>
<VBox.margin>
<Insets top="5" right="5" bottom="5" left="5"/>
</VBox.margin>
</HBox>
<ScrollPane fx:id="playerSide" fitToWidth="true"
style="-fx-background: transparent; -fx-background-color: transparent;" hbarPolicy="NEVER"
vbarPolicy="AS_NEEDED" VBox.vgrow="ALWAYS">
</ScrollPane>
</children>
</VBox>