Fixed: pom.xml, main.fxml, changed sidePanel now is all in main.fxml
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user