From f2fd283d065b8d4069072900fa80caceb34f0169 Mon Sep 17 00:00:00 2001 From: Luca Puderbach Date: Fri, 15 Nov 2024 05:04:25 +0100 Subject: [PATCH] Positionierung StartMenu Buttons & SettingsMenu --- .../Interface/Lemur/pp-styles.groovy | 203 ++++-------------- .../java/pp/monopoly/client/StartMenu.java | 80 ++++--- .../pp/monopoly/client/gui/SettingsMenu.java | 81 +++---- 3 files changed, 134 insertions(+), 230 deletions(-) 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..d3e7e71 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,85 +1,83 @@ // 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.component.QuadBackgroundComponent -import com.simsilica.lemur.component.TbtQuadBackgroundComponent +import com.simsilica.lemur.* +// Farben und allgemeine Stile def bgColor = color(1, 1, 1, 1) def buttonEnabledColor = color(0.8, 0.9, 1, 1) 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 tabbuttonEnabledColor = color(0.4, 0.45, 0.5, 1) +def playButtonBorderColor = color(1, 0.6, 0, 1) // For "Spielen" button -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 -def buttonBgColor = color(1, 1, 1, 1) // White background for "Spiel beenden" and "Einstellungen" buttons -def buttonTextColor = color(0, 0, 0, 1) // Black text color for "Spiel beenden" and "Einstellungen" buttons -def borderColor = color(0, 0, 0, 1) // Black border for "Spiel beenden" and "Einstellungen" - - +// Hintergrundverläufe 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") { - color = playButtonTextColor // Black text color - background = new QuadBackgroundComponent(playButtonBorderColor) // Orange border background - insets = new Insets3f(15, 25, 15, 25) // Padding for larger button size - background.setMargin(5, 5) // Thin border effect around the background color - fontSize = 36 // Larger font size for prominence +// Slider-Thumb Stil +selector("slider.thumb.button", "pp") { + text = "[]" // Symbol für den Thumb + color = sliderColor + insets = new Insets3f(2, 2, 2, 2) } +// Slider links/rechts Buttons +selector("slider.left.button", "pp") { + text = "-" + color = sliderColor + background = doubleGradient.clone() + insets = new Insets3f(5, 5, 5, 5) +} + +selector("slider.right.button", "pp") { + text = "+" + color = sliderColor + background = doubleGradient.clone() + insets = new Insets3f(5, 5, 5, 5) +} + +// Style für alle Buttons im Menü selector("menu-button", "pp") { - color = buttonTextColor // Black text color - background = new QuadBackgroundComponent(buttonBgColor) // White background - insets = new Insets3f(10, 20, 10, 20) // Padding - background.setMargin(1, 1) // Thin black border - background.setColor(borderColor) // Set black border color - - fontSize = 24 // Standard font size + color = color(0, 0, 0, 1) // Schwarzer Text + background = new QuadBackgroundComponent(bgColor) + insets = new Insets3f(10, 20, 10, 20) + fontSize = 24 } +// Standard Button Commands (Animationseffekt) def pressedCommand = new Command