mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
trigger Bankrupt PopUp
This commit is contained in:
parent
29e9b54cc4
commit
cfcc232432
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user