From 650dcb85db397c214f2830278b3f7d88b9b7c140 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sun, 8 Dec 2024 14:53:41 +0100 Subject: [PATCH 1/2] toolbar frame has playercolor --- .../java/pp/monopoly/client/gui/Toolbar.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java index f737f04..5a86ec4 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java @@ -148,58 +148,56 @@ public class Toolbar extends Dialog implements GameEventListener { Texture backgroundToolbar = app.getAssetManager().loadTexture("Pictures/toolbarbg.png"); QuadBackgroundComponent background = new QuadBackgroundComponent(backgroundToolbar); container.setBackground(background); - + // Spielerfarbe des aktuellen Spielers abrufen Player currentPlayer = playerHandler.getPlayerById(app.getId()); PlayerColor currentPlayerColor = Player.getColor(currentPlayer.getId()); - + // Oberer Balken mit der Spielerfarbe Container playerColorBar = new Container(); playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 5, 0)); // Höhe des oberen Balkens - playerColorBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); + playerColorBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color playerColorBar.setLocalTranslation(0, 205, 3); // Position über der Toolbar app.getGuiNode().attachChild(playerColorBar); - - // unterer Balken + // Unterer Balken mit der Spielerfarbe Container playerColorBarbot = new Container(); - playerColorBarbot.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 10, 0)); // Höhe des oberen Balkens - playerColorBarbot.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); + playerColorBarbot.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 10, 0)); // Höhe des unteren Balkens + playerColorBarbot.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color playerColorBarbot.setLocalTranslation(0, 5, 3); // Position über der Toolbar app.getGuiNode().attachChild(playerColorBarbot); - - - // Linker Balken + + // Linker Balken mit der Spielerfarbe Container leftBar = new Container(); - leftBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 10, Höhe 210 - leftBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); + leftBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 5, Höhe 210 + leftBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color leftBar.setLocalTranslation(0, 200, 3); // Position am linken Rand app.getGuiNode().attachChild(leftBar); - - // Rechter Balken + + // Rechter Balken mit der Spielerfarbe Container rightBar = new Container(); - rightBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 10, Höhe 210 - rightBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); + rightBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 5, Höhe 210 + rightBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color rightBar.setLocalTranslation(app.getCamera().getWidth() - 5, 200, 2); // Position am rechten Rand app.getGuiNode().attachChild(rightBar); - + // Übersicht und Konto accountContainer = container.addChild(new Container()); overviewContainer = container.addChild(new Container()); accountContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Yellow)); // Debug-Farbe overviewContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Green)); // Debug-Farbe; receivedEvent(new UpdatePlayerView()); // Initiale Aktualisierung - + // Würfel-Bereich container.addChild(createDiceSection()); - + // Aktionsmenü Container menuContainer = container.addChild(new Container()); menuContainer.addChild(createTradeButton(currentPlayerColor)); menuContainer.addChild(createPropertyMenuButton(currentPlayerColor)); menuContainer.addChild(createEndTurnButton(currentPlayerColor)); menuContainer.setBackground(null); - + return container; } From c758ba97350c9c60e919b8661c6648efd5b125ba Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sun, 8 Dec 2024 15:05:47 +0100 Subject: [PATCH 2/2] corrected toolbar labels --- .../src/main/resources/Interface/Lemur/pp-styles.groovy | 2 +- .../client/src/main/java/pp/monopoly/client/gui/Toolbar.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy index 38fa830..79f8218 100644 --- a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy +++ b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy @@ -87,7 +87,7 @@ selector("label-Bold", "pp") { selector("label-toolbar", "pp") { insets = new Insets3f(2, 2, 2, 2) font = font("Interface/Fonts/Metropolis/Metropolis-Bold-32.fnt") - fontSize = 30 + fontSize = 25 color = new ColorRGBA(ColorRGBA.White) textHAlignment = HAlignment.Center textVAlignment = VAlignment.Center diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java index 5a86ec4..4a1a08e 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java @@ -510,6 +510,8 @@ public class Toolbar extends Dialog implements GameEventListener { // Farbe setzen playerLabel.setColor(playerColor); + + playerLabel.setFontSize(20); // Label zum Container hinzufügen overviewContainer.addChild(playerLabel);