TopDialog in Propertyoverview eingefügt

This commit is contained in:
Simon Wilkening 2024-12-06 13:17:57 +01:00
parent 3c6e519e77
commit 9e81fb8549

View File

@ -17,6 +17,7 @@ import pp.monopoly.model.fields.BuildingProperty;
import pp.monopoly.model.fields.FoodField; import pp.monopoly.model.fields.FoodField;
import pp.monopoly.model.fields.GateField; import pp.monopoly.model.fields.GateField;
import pp.monopoly.model.fields.PropertyField; import pp.monopoly.model.fields.PropertyField;
import pp.monopoly.notification.Sound;
import java.text.Collator; import java.text.Collator;
import java.util.ArrayList; import java.util.ArrayList;
@ -78,7 +79,11 @@ public class PropertyOverviewMenu extends Dialog {
// Add the "Zurück" button at the bottom // Add the "Zurück" button at the bottom
Button backButton = mainContainer.addChild(new Button("Zurück", new ElementId("button"))); Button backButton = mainContainer.addChild(new Button("Zurück", new ElementId("button")));
backButton.setPreferredSize(new Vector3f(200, 60, 0)); backButton.setPreferredSize(new Vector3f(200, 60, 0));
backButton.addClickCommands(source -> this.close()); backButton.addClickCommands(source -> ifTopDialog( () -> {
app.getGameLogic().playSound(Sound.BUTTON);
close();
}));
// Attach the main container to the GUI node // Attach the main container to the GUI node
app.getGuiNode().attachChild(mainContainer); app.getGuiNode().attachChild(mainContainer);