NoMoneywarning and TimeOut use Dialogmanager now

This commit is contained in:
Simon Wilkening 2024-12-06 11:57:20 +01:00
parent e65c2661f7
commit c2c22f9ae5
3 changed files with 10 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import com.simsilica.lemur.component.QuadBackgroundComponent;
import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog;
import pp.monopoly.client.MonopolyApp;
import pp.monopoly.notification.Sound;
/**
* NoMoneyWarning is a warning popup that appears when a player tries to perform
@ -77,10 +78,13 @@ public class NoMoneyWarning extends Dialog {
// Passt den textContainer an die Größe des bankruptContainers an
textContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(-250,-200,0));
// Beenden-Button
// Bestätigen-Button
Button quitButton = noMoneyWarningContainer.addChild(new Button("Bestätigen", new ElementId("button")));
quitButton.setFontSize(32);
quitButton.addClickCommands(source -> close());
quitButton.addClickCommands(source -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON);
close();
}));
// Zentriere das Popup

View File

@ -118,7 +118,6 @@ public class ReceivedRent extends Dialog {
payButton.addClickCommands(s -> ifTopDialog( () -> {
app.getGameLogic().playSound(Sound.BUTTON);
close();
}));
return container;

View File

@ -78,7 +78,10 @@ public class TimeOut extends Dialog {
// Beenden-Button
Button quitButton = timeOutContainer.addChild(new Button("Bestätigen", new ElementId("button")));
quitButton.setFontSize(32);
quitButton.addClickCommands(source -> close());
quitButton.addClickCommands(source -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON);
close();
}));
// Zentriere das Popup