Merge remote-tracking branch 'origin/connect' into connect

# Conflicts:
#	Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java
This commit is contained in:
Yvonne Schmidt 2024-11-25 02:48:26 +01:00
commit 7b3f31f099
6 changed files with 13 additions and 27 deletions

View File

@ -25,10 +25,8 @@ import com.simsilica.lemur.component.SpringGridLayout;
import static pp.monopoly.Resources.lookup;
import com.simsilica.lemur.style.ElementId;
import pp.monopoly.client.MonopolyApp;
import pp.monopoly.client.NetworkSupport;
import pp.monopoly.notification.Sound;
import pp.monopoly.server.MonopolyServer;
import pp.dialog.Dialog;
import pp.dialog.DialogBuilder;
@ -66,7 +64,7 @@ public class CreateGameMenu extends Dialog {
final MonopolyApp app = network.getApp();
int screenWidth = app.getContext().getSettings().getWidth();
int screenWidth = app.getContext().getSettings().getWidth();
int screenHeight = app.getContext().getSettings().getHeight();
// Set up the background image
@ -79,7 +77,6 @@ public class CreateGameMenu extends Dialog {
background.setLocalTranslation(0, 0, -1); // Ensure it is behind other GUI elements
app.getGuiNode().attachChild(background);
addChild(new Label("Spiel erstellen",new ElementId("header")));
final Container input = new Container(new SpringGridLayout());
input.addChild(new Label(lookup("host.name") + ": "));
input.addChild(host, 1);
@ -89,27 +86,20 @@ public class CreateGameMenu extends Dialog {
addChild(input);
// "Abbrechen"-Button
cancelButton.setPreferredSize(new Vector3f(120, 40, 0));
cancelButton.addClickCommands(source -> close());
addChild(cancelButton);
cancelButton.addClickCommands(s -> ifTopDialog(() -> {
this.close();
new StartMenu(app);
app.getGameLogic().playSound(Sound.BUTTON);
new StartMenu(network.getApp()).open();
}));
addChild(cancelButton);
// "Selber hosten"-Button
addChild(serverButton).addClickCommands(s -> ifTopDialog(() -> {
startServerInThread();
app.getGameLogic().playSound(Sound.BUTTON);
}));
serverButton.addClickCommands(s -> ifTopDialog(this::startServerInThread));
addChild(serverButton);
// "Beitreten"-Button
joinButton.setPreferredSize(new Vector3f(120, 40, 0));
joinButton.addClickCommands(s -> ifTopDialog(this::connect));
addChild(joinButton);
joinButton.addClickCommands(s -> ifTopDialog(() -> {
connect();
app.getGameLogic().playSound(Sound.BUTTON);
}));
}
/**
@ -156,7 +146,7 @@ public class CreateGameMenu extends Dialog {
@Override
public void escape() {
close();
new SettingsMenu(network.getApp()).open();
}
/**
@ -219,7 +209,6 @@ public class CreateGameMenu extends Dialog {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
connect();

View File

@ -131,11 +131,11 @@ public class LobbyMenu extends Dialog {
buttonContainer.setBackground(null);
// Lower-left container for "Abbrechen" button
lowerLeftMenu = new Container();
Button cancelButton = new Button("Abbrechen");
Button cancelButton = new Button("Beenden");
cancelButton.setPreferredSize(new Vector3f(200, 60, 0)); // Set size to match the appearance in the image
cancelButton.setFontSize(18); // Adjust font size
cancelButton.addClickCommands(s -> ifTopDialog(() -> {
this.close();
app.closeApp();
app.getGameLogic().playSound(Sound.BUTTON);
}));
lowerLeftMenu.addChild(cancelButton);
@ -217,7 +217,7 @@ public class LobbyMenu extends Dialog {
@Override
public void escape() {
super.close();
new SettingsMenu(app).open();
}
/**

View File

@ -1,7 +1,6 @@
package pp.monopoly.client.gui;
import com.simsilica.lemur.Slider;
import pp.monopoly.client.GameMusic;
import pp.monopoly.client.GameSound;
public class SoundSlider extends Slider {

View File

@ -22,8 +22,6 @@ import pp.monopoly.client.gui.GameMenu;
*/
public class StartMenu extends Dialog {
private final MonopolyApp app;
private Container logoContainer;
private Container unibwLogoContainer;
/**
* Constructs the Startup Menu dialog for the Monopoly application.

View File

@ -3,10 +3,11 @@ package pp.monopoly.client.gui.popups;
import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Quad;
import com.simsilica.lemur.*;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog;

View File

@ -5,7 +5,6 @@ import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Quad;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.QuadBackgroundComponent;