mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
cleanup
This commit is contained in:
parent
acc797f2ff
commit
ed105f1b70
@ -27,7 +27,6 @@ import static pp.monopoly.Resources.lookup;
|
||||
|
||||
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;
|
||||
@ -65,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
|
||||
@ -78,7 +77,6 @@ public class CreateGameMenu extends Dialog {
|
||||
background.setLocalTranslation(0, 0, -1); // Ensure it is behind other GUI elements
|
||||
app.getGuiNode().attachChild(background);
|
||||
|
||||
|
||||
final Container input = new Container(new SpringGridLayout());
|
||||
input.addChild(new Label(lookup("host.name") + ": "));
|
||||
input.addChild(host, 1);
|
||||
@ -88,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);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,7 +146,7 @@ public class CreateGameMenu extends Dialog {
|
||||
|
||||
@Override
|
||||
public void escape() {
|
||||
close();
|
||||
new SettingsMenu(network.getApp()).open();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -218,7 +209,6 @@ public class CreateGameMenu extends Dialog {
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
connect();
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 {
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user