removed the buttons on start

This commit is contained in:
Johannes Schmelz 2024-11-24 22:29:19 +01:00
parent 422faec281
commit 55778dbcea
4 changed files with 8 additions and 24 deletions

View File

@ -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();

View File

@ -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

View File

@ -209,7 +209,7 @@ public class LobbyMenu extends Dialog {
}
@Override
public void close() {
public void escape() {
super.close();
}

View File

@ -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");