Fixed: pom.xml, main.fxml, changed sidePanel now is all in main.fxml
This commit is contained in:
@@ -104,6 +104,7 @@
|
|||||||
<transformer>
|
<transformer>
|
||||||
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
|
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
|
<transformer />
|
||||||
</transformers>
|
</transformers>
|
||||||
<filters>
|
<filters>
|
||||||
<filter>
|
<filter>
|
||||||
@@ -112,6 +113,7 @@
|
|||||||
<exclude>META-INF/*.SF</exclude>
|
<exclude>META-INF/*.SF</exclude>
|
||||||
<exclude>META-INF/*.DSA</exclude>
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
<exclude>META-INF/*.RSA</exclude>
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
<exclude>META-INF/versions/9/module-info.class</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
</filters>
|
</filters>
|
||||||
|
|||||||
@@ -158,6 +158,7 @@
|
|||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
|
<mainClass>it.polimi.ingsw.gc14.ClientLauncherGUI</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||||
</transformers>
|
</transformers>
|
||||||
<filters>
|
<filters>
|
||||||
<filter>
|
<filter>
|
||||||
@@ -166,6 +167,7 @@
|
|||||||
<exclude>META-INF/*.SF</exclude>
|
<exclude>META-INF/*.SF</exclude>
|
||||||
<exclude>META-INF/*.DSA</exclude>
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
<exclude>META-INF/*.RSA</exclude>
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
<exclude>META-INF/versions/9/module-info.class</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
</filters>
|
</filters>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import javafx.geometry.Insets;
|
|||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import javafx.scene.Cursor;
|
import javafx.scene.Cursor;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
import javafx.scene.effect.ColorAdjust;
|
import javafx.scene.effect.ColorAdjust;
|
||||||
@@ -39,12 +40,16 @@ import java.util.*;
|
|||||||
|
|
||||||
public class MainFXMLController {
|
public class MainFXMLController {
|
||||||
|
|
||||||
|
@FXML private ScrollPane playerSide;
|
||||||
@FXML private HBox mainHBox;
|
@FXML private HBox mainHBox;
|
||||||
@FXML private HBox board;
|
@FXML private HBox board;
|
||||||
@FXML private HBox upperList;
|
@FXML private HBox upperList;
|
||||||
@FXML private HBox lowerList;
|
@FXML private HBox lowerList;
|
||||||
@FXML private HBox myHand;
|
@FXML private HBox myHand;
|
||||||
@FXML private VBox sidePanel;
|
@FXML private VBox sidePanel;
|
||||||
|
@FXML private HBox buttonRow;
|
||||||
|
@FXML private Button skipBtn;
|
||||||
|
@FXML private Button detailsBtn;
|
||||||
@FXML private HBox info;
|
@FXML private HBox info;
|
||||||
@FXML private Label era;
|
@FXML private Label era;
|
||||||
@FXML private Label round;
|
@FXML private Label round;
|
||||||
@@ -89,6 +94,8 @@ public class MainFXMLController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
addHoverZoom(skipBtn);
|
||||||
|
addHoverZoom(detailsBtn);
|
||||||
initPopup();
|
initPopup();
|
||||||
renderBackground();
|
renderBackground();
|
||||||
}
|
}
|
||||||
@@ -523,17 +530,6 @@ public class MainFXMLController {
|
|||||||
card.getChildren().add(overlay);
|
card.getChildren().add(overlay);
|
||||||
board.getChildren().add(card);
|
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() {
|
private void renderSlotMap() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -563,47 +559,17 @@ public class MainFXMLController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderSidePanel() {
|
private void renderSidePanel() {
|
||||||
sidePanel.getChildren().clear();
|
|
||||||
sidePanel.setSpacing(6);
|
|
||||||
|
|
||||||
era.setText(Integer.toString(controller.miniModel.currentState.getEra()));
|
era.setText(Integer.toString(controller.miniModel.currentState.getEra()));
|
||||||
round.setText(Integer.toString(controller.miniModel.currentState.getRound()));
|
round.setText(Integer.toString(controller.miniModel.currentState.getRound()));
|
||||||
player.setText(controller.miniModel.currentState.getCurrentPlayer().getUserName());
|
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));
|
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 separato solo per i player
|
||||||
VBox playerList = new VBox(6);
|
VBox playerList = new VBox(6);
|
||||||
playerList.setFillWidth(true);
|
playerList.setFillWidth(true);
|
||||||
for (Player p : controller.miniModel.players.values()) {
|
for (Player p : controller.miniModel.players.values()) {
|
||||||
renderPlayer(p, playerList); // ← passa playerList invece di sidePanel
|
renderPlayer(p, playerList); // ← passa playerList invece di sidePanel
|
||||||
}
|
}
|
||||||
|
playerSide.setContent(playerList);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==== POPUP ====
|
// ==== POPUP ====
|
||||||
@@ -676,6 +642,7 @@ public class MainFXMLController {
|
|||||||
}
|
}
|
||||||
showPopup();
|
showPopup();
|
||||||
}
|
}
|
||||||
|
@FXML
|
||||||
private void openDetailsPopup() {
|
private void openDetailsPopup() {
|
||||||
popupCards.getChildren().clear();
|
popupCards.getChildren().clear();
|
||||||
ImageView img = new ImageView(loadImage("/GUIImages/Backs/back-118.png"));
|
ImageView img = new ImageView(loadImage("/GUIImages/Backs/back-118.png"));
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.control.ScrollPane?>
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
<HBox fx:id="mainHBox"
|
<HBox fx:id="mainHBox"
|
||||||
maxHeight="Infinity" maxWidth="Infinity"
|
maxHeight="Infinity" maxWidth="Infinity"
|
||||||
prefHeight="1080.0" prefWidth="1920.0"
|
prefHeight="1080.0" prefWidth="1920.0"
|
||||||
@@ -12,7 +13,9 @@
|
|||||||
fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController"
|
fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController"
|
||||||
stylesheets="@styles.css">
|
stylesheets="@styles.css">
|
||||||
<children>
|
<children>
|
||||||
|
<HBox maxHeight="30" minHeight="30" prefHeight="30">
|
||||||
|
|
||||||
|
</HBox>
|
||||||
<!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile -->
|
<!-- VBox sinistra: si espande per riempire tutto lo spazio disponibile -->
|
||||||
<VBox alignment="CENTER"
|
<VBox alignment="CENTER"
|
||||||
fillWidth="false"
|
fillWidth="false"
|
||||||
@@ -60,36 +63,41 @@
|
|||||||
<Insets bottom="10" left="10" right="10" top="10" />
|
<Insets bottom="10" left="10" right="10" top="10" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
<children>
|
<children>
|
||||||
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" vbarPolicy="AS_NEEDED" VBox.vgrow="ALWAYS">
|
<HBox fx:id="info" prefHeight="107.0" prefWidth="483.0" styleClass="frame">
|
||||||
<content>
|
<children>
|
||||||
<VBox spacing="10">
|
<VBox alignment="CENTER" prefHeight="107.0" prefWidth="161.0" spacing="2">
|
||||||
<children>
|
<children>
|
||||||
<HBox fx:id="info" prefHeight="107.0" prefWidth="483.0" styleClass="frame">
|
<Label styleClass="label-medium" text="Era" />
|
||||||
<children>
|
<Label fx:id="era" styleClass="label-medium" text="VALORE" />
|
||||||
<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 -->
|
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</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>
|
</ScrollPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
Reference in New Issue
Block a user