From 465aef567eaaf2dc824c2ff341da4d1dc6c0aaf7 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Mon, 18 Nov 2024 03:50:54 +0000 Subject: [PATCH] Gui --- .../Interface/Lemur/pp-styles.groovy | 156 +----- .../java/pp/monopoly/client/GameSound.java | 62 ++- .../main/java/pp/monopoly/client/Menu.java | 10 +- .../java/pp/monopoly/client/MonopolyApp.java | 476 +++++------------- .../pp/monopoly/client/MonopolyAppConfig.java | 10 +- .../pp/monopoly/client/MonopolyAppState.java | 40 +- .../pp/monopoly/client/NetworkDialog.java | 121 +++-- .../pp/monopoly/client/NetworkSupport.java | 64 ++- .../java/pp/monopoly/client/StartMenu.java | 162 +++--- .../client/gui/BoardSynchronizer.java | 49 +- .../monopoly/client/gui/CreateGameMenu.java | 129 +++++ .../java/pp/monopoly/client/gui/GameMenu.java | 1 + .../java/pp/monopoly/client/gui/MapView.java | 146 +----- .../client/gui/MapViewSynchronizer.java | 57 +-- .../pp/monopoly/client/gui/SettingsMenu.java | 95 ++++ .../pp/monopoly/client/gui/TestWorld.java | 39 ++ .../client/gui/TestWorldWithMenu.java | 80 +++ .../src/main/resources/Pictures/board.png | Bin 0 -> 877559 bytes .../src/main/resources/Pictures/unibw-Bib.png | Bin 0 -> 768333 bytes .../main/resources/Pictures/unibw-Bib2.png | Bin 0 -> 7451361 bytes .../client/src/main/resources/icons/test.ico | Bin 0 -> 4286 bytes .../monopoly/game/client/ClientGameLogic.java | 9 +- .../game/client/MonopolyClientConfig.java | 8 +- .../monopoly/game/server/ServerGameLogic.java | 4 + .../main/java/pp/monopoly/model/Board.java | 13 +- .../main/java/pp/monopoly/model/IntPoint.java | 4 +- .../monopoly/notification/ItemAddedEvent.java | 48 +- .../notification/ItemRemovedEvent.java | 28 +- .../java/pp/monopoly/notification/Sound.java | 2 +- .../pp/monopoly/notification/SoundEvent.java | 29 +- .../src/main/resources/monopoly.properties | 1 + 31 files changed, 834 insertions(+), 1009 deletions(-) create mode 100644 Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java create mode 100644 Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/SettingsMenu.java create mode 100644 Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java create mode 100644 Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorldWithMenu.java create mode 100644 Projekte/monopoly/client/src/main/resources/Pictures/board.png create mode 100644 Projekte/monopoly/client/src/main/resources/Pictures/unibw-Bib.png create mode 100644 Projekte/monopoly/client/src/main/resources/Pictures/unibw-Bib2.png create mode 100644 Projekte/monopoly/client/src/main/resources/icons/test.ico 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 55ef6cb..957bc68 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 @@ -1,14 +1,9 @@ // Styling of Lemur components -// For documentation, see +// For documentation, see: // https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling -import com.simsilica.lemur.Button -import com.simsilica.lemur.Button.ButtonAction -import com.simsilica.lemur.Command -import com.simsilica.lemur.HAlignment -import com.simsilica.lemur.Insets3f +import com.simsilica.lemur.* import com.simsilica.lemur.component.QuadBackgroundComponent -import com.simsilica.lemur.component.TbtQuadBackgroundComponent def bgColor = color(1, 1, 1, 1) def buttonEnabledColor = color(0.8, 0.9, 1, 1) @@ -16,8 +11,10 @@ def buttonDisabledColor = color(0.8, 0.9, 1, 0.2) //def buttonBgColor = color(0, 0.75, 0.75, 1) def sliderColor = color(0.6, 0.8, 0.8, 1) def sliderBgColor = color(0.5, 0.75, 0.75, 1) -def gradientColor = color(0.5, 0.75, 0.85, 0.5) +def gradientColor = color(1, 1, 1, 1) def tabbuttonEnabledColor = color(0.4, 0.45, 0.5, 1) +def playButtonBorderColor = color(1, 0.6, 0, 1) // For "Spielen" button +def blackColor = color(0, 0, 0, 1) // Define black color for border def playButtonBorderColor = color(1, 0.6, 0, 1) // Orange border for "Spielen" button def playButtonTextColor = color(0, 0, 0, 1) // Black text color for "Spielen" button @@ -27,39 +24,35 @@ def borderColor = color(0, 0, 0, 1) // Black border for "Spiel beenden" and "Ein def gradient = TbtQuadBackgroundComponent.create( - texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", - generateMips: false), - 1, 1, 1, 126, 126, - 1f, false) + texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", generateMips: false), + 1, 1, 1, 126, 126, 1f, false) def doubleGradient = new QuadBackgroundComponent(gradientColor) -doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png", - generateMips: false) +doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png", generateMips: false) +// Hauptstil für die Schriftart selector("pp") { font = font("Interface/Fonts/Metropolis/Metropolis-Regular-32.fnt") } -selector("label", "pp") { - insets = new Insets3f(2, 2, 2, 2) - color = buttonEnabledColor -} - -selector("header", "pp") { - font = font("Interface/Fonts/Metropolis/Metropolis-Bold-42.fnt") - insets = new Insets3f(2, 2, 2, 2) - color = color(1, 0.5, 0, 1) +// Titel für "Einstellungen" +selector("settings-title", "pp") { + color = color(1, 1, 1, 1) + fontSize = 48 textHAlignment = HAlignment.Center + insets = new Insets3f(5, 5, 5, 5) } +// Container Stil selector("container", "pp") { background = gradient.clone() background.setColor(bgColor) } +// Slider Stil selector("slider", "pp") { - background = gradient.clone() - background.setColor(bgColor) + insets = new Insets3f(5, 10, 5, 10) // Abstand + background = new QuadBackgroundComponent(sliderBgColor) } selector("play-button", "pp") { @@ -98,30 +91,6 @@ def enabledCommand = new Command