diff --git a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy index e761640..749dfdb 100644 --- a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy +++ b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy @@ -262,6 +262,16 @@ selector("settings-title", "pp") { textHAlignment = HAlignment.Center textVAlignment = VAlignment.Center } +selector("warning-title", "pp") { + def outerBackground = new QuadBackgroundComponent(color(1, 0.5, 0, 1)) // Grey inner border + def innerBackground = new QuadBackgroundComponent(buttonBgColor) // White outer border background + font = font("Interface/Fonts/Metropolis/Metropolis-Bold-42.fnt") + background = outerBackground + fontSize = 40 + insets = new Insets3f(3, 3, 3, 3) + textHAlignment = HAlignment.Center + textVAlignment = VAlignment.Center +} selector("menu-button", "pp") { fontSize = 40 // Set font size diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java index 7affb71..74b2ead 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java @@ -16,6 +16,7 @@ import com.simsilica.lemur.core.VersionedList; import com.simsilica.lemur.style.ElementId; import pp.dialog.Dialog; import pp.monopoly.client.MonopolyApp; +import pp.monopoly.game.server.Player; import pp.monopoly.model.TradeHandler; import pp.monopoly.model.fields.PropertyField; import pp.monopoly.notification.Sound; @@ -99,6 +100,7 @@ public class TradeMenu extends Dialog { column.addChild(new Label("Gebäude:")); Selector buildingSelector = createPropertySelector(isLeft); + buildingSelector.getPopupContainer().setBackground(new QuadBackgroundComponent(ColorRGBA.Orange)); column.addChild(buildingSelector); column.addChild(new Label("Währung:")); @@ -107,6 +109,7 @@ public class TradeMenu extends Dialog { column.addChild(new Label("Sonderkarten:")); Selector specialCardSelector = createSpecialCardSelector(); + specialCardSelector.getPopupContainer().setBackground(new QuadBackgroundComponent(ColorRGBA.Orange)); styleSelector(specialCardSelector); column.addChild(specialCardSelector); @@ -253,4 +256,24 @@ public class TradeMenu extends Dialog { app.getGuiNode().detachChild(mainContainer); super.close(); } + + /** + * Handles dropdown selection changes and updates the trade handler. + * + * @param selected The selected item from the dropdown. + */ + private void onDropdownSelectionChanged(String selected) { + app.getGameLogic().playSound(Sound.BUTTON); + int idStart = selected.indexOf("(ID: ") + 5; // Find start of the ID + int idEnd = selected.indexOf(")", idStart); // Find end of the ID + String idStr = selected.substring(idStart, idEnd); // Extract the ID as a string + int playerId = Integer.parseInt(idStr); // Convert the ID to an integer + + // Find the player by ID + Player selectedPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(playerId); + + if (selectedPlayer != null) { + tradeHandler.setReceiver(selectedPlayer); // Set the receiver in TradeHandler + } + } } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Bankrupt.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Bankrupt.java index 5ad93d1..4083aef 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Bankrupt.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/Bankrupt.java @@ -49,7 +49,7 @@ public class Bankrupt extends Dialog { backgroundContainer.setPreferredSize(bankruptContainer.getPreferredSize().addLocal(padding, padding, 0)); // Titel - Label gateFieldTitle = bankruptContainer.addChild(new Label("Vorsicht !", new ElementId("settings-title"))); //TODO Dicke Schrift + Label gateFieldTitle = bankruptContainer.addChild(new Label("Vorsicht !", new ElementId("warning-title"))); gateFieldTitle.setFontSize(48); gateFieldTitle.setColor(ColorRGBA.Black); diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java index 0b208f4..02dad1c 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/TimeOut.java @@ -52,7 +52,7 @@ public class TimeOut extends Dialog { backgroundContainer.setPreferredSize(timeOutContainer.getPreferredSize().addLocal(padding, padding, 0)); // Titel - Label gateFieldTitle = timeOutContainer.addChild(new Label("Vorsicht !", new ElementId("settings-title"))); //TODO dicke Schrift + Label gateFieldTitle = timeOutContainer.addChild(new Label("Vorsicht !", new ElementId("warning-title"))); gateFieldTitle.setFontSize(48); gateFieldTitle.setColor(ColorRGBA.Black);