diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuildingPropertyCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuildingPropertyCard.java index 03bdb18..19b5344 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuildingPropertyCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuildingPropertyCard.java @@ -67,19 +67,19 @@ public class BuildingPropertyCard extends Dialog { // Beenden-Button Button quitButton = buildingPropertyContainer.addChild(new Button("Beenden", new ElementId("button"))); quitButton.setFontSize(32); - quitButton.addClickCommands(s -> ifTopDialog(() -> { + quitButton.addClickCommands(s -> { System.err.println("Button does something?"); app.getGameLogic().playSound(Sound.BUTTON); close(); - })); + }); // Kaufen-Button Button buyButton = buildingPropertyContainer.addChild(new Button("Kaufen", new ElementId("button"))); buyButton.setFontSize(32); - buyButton.addClickCommands(s -> ifTopDialog( () -> { + buyButton.addClickCommands(s -> { app.getGameLogic().playSound(Sound.BUTTON); close(); app.getGameLogic().send(new BuyPropertyResponse()); - })); + }); // Zentriere das Popup buildingPropertyContainer.setLocalTranslation( diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java index e42371c..976ace9 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/EventCardPopup.java @@ -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; /** * EventCardPopup is a popup which appears when a certain EventCard is triggered by entering a EventCardField @@ -62,7 +63,10 @@ public class EventCardPopup extends Dialog { // Beenden-Button Button quitButton = eventCardContainer.addChild(new Button("Jawohl", new ElementId("button"))); quitButton.setFontSize(32); - quitButton.addClickCommands(source -> close()); + quitButton.addClickCommands(source -> { + app.getGameLogic().playSound(Sound.BUTTON); + close(); + }); // Zentriere das Popup eventCardContainer.setLocalTranslation( diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/FoodFieldCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/FoodFieldCard.java index e0146c4..60681b7 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/FoodFieldCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/FoodFieldCard.java @@ -77,18 +77,18 @@ public class FoodFieldCard extends Dialog { // Beenden-Button Button quitButton = foodFieldContainer.addChild(new Button("Beenden", new ElementId("button"))); quitButton.setFontSize(32); - quitButton.addClickCommands(s -> ifTopDialog(() -> { + quitButton.addClickCommands(s -> { app.getGameLogic().playSound(Sound.BUTTON); close(); - })); + }); // Kaufen-Button Button buyButton = foodFieldContainer.addChild(new Button("Kaufen", new ElementId("button"))); buyButton.setFontSize(32); - buyButton.addClickCommands(s -> ifTopDialog( () -> { + buyButton.addClickCommands(s -> { app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().send(new BuyPropertyResponse()); close(); - })); + }); // Zentriere das Popup foodFieldContainer.setLocalTranslation( diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java index cb81049..5c591d6 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/GateFieldCard.java @@ -69,18 +69,18 @@ public class GateFieldCard extends Dialog { // Beenden-Button Button quitButton = gateFieldContainer.addChild(new Button("Beenden", new ElementId("button"))); quitButton.setFontSize(32); - quitButton.addClickCommands(s -> ifTopDialog(() -> { + quitButton.addClickCommands(s -> { app.getGameLogic().playSound(Sound.BUTTON); close(); - })); + }); // Kaufen-Button Button buyButton = gateFieldContainer.addChild(new Button("Kaufen", new ElementId("button"))); buyButton.setFontSize(32); - buyButton.addClickCommands(s -> ifTopDialog(() -> { + buyButton.addClickCommands(s -> { app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().send(new BuyPropertyResponse()); close(); - })); + }); // Zentriere das Popup gateFieldContainer.setLocalTranslation(