From 03571fcf74ac5d13b3944ab6ecd114c4e92553d7 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sun, 24 Nov 2024 19:24:51 +0100 Subject: [PATCH] code cleanup in der lobby --- .../pp/monopoly/client/gui/LobbyMenu.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java index c7c3059..30f8731 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java @@ -42,34 +42,33 @@ public class LobbyMenu { private Container lowerRightMenu; private ColorRGBA playerColor= ColorRGBA.Gray; - private PlayerHandler playerHandler; // Reference to PlayerHandler - private TextField startingCapital; // Reference to the starting capital input field - private TextField playerInputField; // Reference to the player name input field - private Selector figureDropdown; // Reference to the figure dropdown + private PlayerHandler playerHandler; + private TextField startingCapital; + private TextField playerInputField; + private Selector figureDropdown; public LobbyMenu(MonopolyApp app) { this.app = app; this.playerHandler = ClientGameLogic.getPlayerHandler(); // Initialize PlayerHandler - int playerID = app.getNetworkSupport().getId(); // Retrieve the player ID dynamically - assignPlayerColor(playerID); - // Entfernt das CreateGameMenu (inklusive Hintergrund) - app.getGuiNode().detachAllChildren(); + int playerID = app.getNetworkSupport().getId(); // Retrieve the player ID + assignPlayerColor(playerID); //set the Players Color - // Hintergrundbild laden und hinzufügen - addBackgroundImage(); + app.getGuiNode().detachAllChildren(); // Entfernt das CreateGameMenu (inklusive Hintergrund) + + addBackgroundImage();// Hintergrundbild laden und hinzufügen QuadBackgroundComponent translucentWhiteBackground = new QuadBackgroundComponent(new ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f)); menuContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X)); - menuContainer.setPreferredSize(new Vector3f(1000, 600, 0)); // Fixed size of the container + menuContainer.setPreferredSize(new Vector3f(1000, 600, 0)); menuContainer.setBackground(translucentWhiteBackground); // Create a smaller horizontal container for the label, input field, and spacers Container horizontalContainer = menuContainer.addChild(new Container(new SpringGridLayout(Axis.X, Axis.Y))); - horizontalContainer.setPreferredSize(new Vector3f(600, 40, 0)); // Adjust container size + horizontalContainer.setPreferredSize(new Vector3f(600, 40, 0)); horizontalContainer.setBackground(null); Label title = horizontalContainer.addChild(new Label("Startkapital:", new ElementId("label-Bold"))); @@ -109,12 +108,12 @@ public class LobbyMenu { TextField playerInputField = new TextField("Spieler 1"); playerInputField.setPreferredSize(new Vector3f(100, 20, 0)); - playerInputField.setInsets(new Insets3f(5, 10, 5, 10)); // Add padding for the text inside the field + playerInputField.setInsets(new Insets3f(5, 10, 5, 10)); playerInputField.setBackground(new QuadBackgroundComponent(ColorRGBA.Black)); playerInputContainer.addChild(playerInputField); // Spacer (Center Circle Area) Label spacer = dropdownContainer.addChild(new Label("")); - spacer.setPreferredSize(new Vector3f(200, 200, 0)); // Adjust this to fit the center graphic + spacer.setPreferredSize(new Vector3f(200, 200, 0)); // Figur Dropdown Container figureDropdownContainer = dropdownContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X)));