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 b343379..665af44 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 @@ -219,7 +219,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga setupInput(); setupStates(); setupGui(); - // new StartMenu(this).open(); + new StartMenu(this).open(); } /** @@ -319,6 +319,13 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga return draw; } + /** + * Tries to connect + */ + public void connect() { + serverConnection.connect(); + } + /** * Handles a request to close the application. * If the request is initiated by pressing ESC, this parameter is true. 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 1bc7737..3b01dc7 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 @@ -54,7 +54,7 @@ public class StartMenu extends Dialog { startButton.setFontSize(40); // Set the font size for the button text startButton.setTextHAlignment(HAlignment.Center); // Center the text horizontally - startButton.addClickCommands(); + startButton.addClickCommands(s -> app.connect()); centerMenu.addChild(startButton); // Position the center container in the middle of the screen @@ -79,7 +79,7 @@ public class StartMenu extends Dialog { 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 -> ifTopDialog(this::close)); + settingsButton.addClickCommands(source -> new SettingsMenu(app).open()); lowerRightMenu.addChild(settingsButton); app.getGuiNode().attachChild(lowerRightMenu); @@ -133,7 +133,6 @@ public class StartMenu extends Dialog { @Override public void escape() { - // TODO Auto-generated method stub - super.escape(); + close(); } } \ No newline at end of file