mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-01 06:27:40 +02:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
@@ -165,7 +165,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
||||
* Constructs a new {@code MonopolyApp} instance.
|
||||
* Initializes the configuration, server connection, and game logic listeners.
|
||||
*/
|
||||
private MonopolyApp() {
|
||||
public MonopolyApp() {
|
||||
config = new MonopolyAppConfig();
|
||||
config.readFromIfExists(CONFIG_FILE);
|
||||
serverConnection = makeServerConnection();
|
||||
|
@@ -370,6 +370,10 @@ public class TestWorld implements GameEventListener {
|
||||
new TimeOut(app).open();
|
||||
} else if (event.msg().equals("tradeRequest")) {
|
||||
new ConfirmTrade(app).open();
|
||||
} else if (event.msg().equals("goingToJail")) {
|
||||
new Gulag(app).open();
|
||||
} else if (event.msg().equals("NoMoneyWarning")) {
|
||||
new NoMoneyWarning(app).open();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ import com.simsilica.lemur.style.ElementId;
|
||||
|
||||
import pp.dialog.Dialog;
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
import pp.monopoly.client.gui.popups.Bankrupt;
|
||||
import pp.monopoly.game.server.Player;
|
||||
import pp.monopoly.game.server.PlayerHandler;
|
||||
import pp.monopoly.message.client.EndTurn;
|
||||
@@ -185,8 +186,12 @@ public class Toolbar extends Dialog implements GameEventListener {
|
||||
endTurnButton.setPreferredSize(new Vector3f(150, 50, 0));
|
||||
endTurnButton.addClickCommands(s -> ifTopDialog(() -> {
|
||||
app.getGameLogic().playSound(Sound.BUTTON);
|
||||
app.getGameLogic().send(new EndTurn());
|
||||
receivedEvent(new ButtonStatusEvent(false));
|
||||
if (app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getAccountBalance() < 0) {
|
||||
new Bankrupt(app).open();
|
||||
} else {
|
||||
app.getGameLogic().send(new EndTurn());
|
||||
receivedEvent(new ButtonStatusEvent(false));
|
||||
}
|
||||
}));
|
||||
return endTurnButton;
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ public class Bankrupt extends Dialog {
|
||||
// Beenden-Button
|
||||
Button quitButton = bankruptContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||
quitButton.setFontSize(32);
|
||||
quitButton.addClickCommands(source -> close());
|
||||
quitButton.addClickCommands(source -> ifTopDialog(this::close));
|
||||
|
||||
|
||||
// Zentriere das Popup
|
||||
|
@@ -68,14 +68,14 @@ public class EventCardPopup extends Dialog {
|
||||
eventCardContainer.setLocalTranslation(
|
||||
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x) / 2,
|
||||
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y) / 2,
|
||||
8
|
||||
10
|
||||
);
|
||||
|
||||
// Zentriere das Popup
|
||||
backgroundContainer.setLocalTranslation(
|
||||
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x - padding) / 2,
|
||||
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y+ padding) / 2,
|
||||
7
|
||||
9
|
||||
);
|
||||
|
||||
app.getGuiNode().attachChild(eventCardContainer);
|
||||
|
Reference in New Issue
Block a user