diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java index 665af44..87e350a 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java @@ -302,7 +302,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga * * @param isPressed Indicates whether the Escape key is pressed. */ - private void escape(boolean isPressed) { + public void escape(boolean isPressed) { if (!isPressed) return; if (dialogManager.showsDialog()) dialogManager.escape(); diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java index 88d5c3a..e593ccc 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java @@ -69,7 +69,7 @@ public class CreateGameMenu extends SimpleDialog { addChild(input); // "Abbrechen"-Button cancelButton.setPreferredSize(new Vector3f(120, 40, 0)); - cancelButton.addClickCommands(source -> new StartMenu(app).open()); + cancelButton.addClickCommands(source -> close()); addChild(cancelButton); cancelButton.addClickCommands(s -> new StartMenu(app)); @@ -124,6 +124,11 @@ public class CreateGameMenu extends SimpleDialog { } } + @Override + public void escape() { + close(); + } + /** * This method is called by {@linkplain pp.dialog.DialogManager#update(float)} for periodically * updating this dialog. T 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 aea34df..3ff268e 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 @@ -209,7 +209,7 @@ public class LobbyMenu extends Dialog { } @Override - public void close() { + public void escape() { super.close(); } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java index 3b01dc7..f6505c0 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java @@ -63,27 +63,6 @@ public class StartMenu extends Dialog { 0)); app.getGuiNode().attachChild(centerMenu); - // Lower-left container for "Spiel beenden" button - Container lowerLeftMenu = new Container(); - lowerLeftMenu.setLocalTranslation(new Vector3f(100, 90, 0)); - Button quitButton = new Button("Spiel beenden"); - quitButton.setPreferredSize(new Vector3f(130, 40, 0)); // Increase button size slightly (width, height) - quitButton.setFontSize(18); - quitButton.addClickCommands(source -> ifTopDialog(app::closeApp)); - lowerLeftMenu.addChild(quitButton); - app.getGuiNode().attachChild(lowerLeftMenu); - - // Lower-right container for "Einstellungen" button - Container lowerRightMenu = new Container(); - lowerRightMenu.setLocalTranslation(new Vector3f(screenWidth - 200, 90, 0)); - Button settingsButton = new Button("Einstellungen"); - settingsButton.setPreferredSize(new Vector3f(130, 40, 0)); // Increase button size slightly (width, height) - settingsButton.setFontSize(18); // Increase the font size for the text - settingsButton.addClickCommands(source -> new SettingsMenu(app).open()); - lowerRightMenu.addChild(settingsButton); - app.getGuiNode().attachChild(lowerRightMenu); - - // Load the Monopoly logo as a texture Texture logoTexture = app.getAssetManager().loadTexture("Pictures/logo-monopoly.png");