From 488ae154cfcbb6ecb5b6bbe7de6c70b49fb842c2 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sat, 30 Nov 2024 23:26:37 +0100 Subject: [PATCH 1/2] fixed overlapping popups --- .../main/java/pp/monopoly/client/gui/popups/BuyCard.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuyCard.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuyCard.java index 25c6489..895b4a5 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuyCard.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/popups/BuyCard.java @@ -27,7 +27,7 @@ public class BuyCard extends Dialog { super(app.getDialogManager()); this.app = app; - //Generate the corresponfing field + //Generate the corresponding field int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID(); BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index); @@ -84,14 +84,14 @@ public class BuyCard extends Dialog { buyCardContainer.setLocalTranslation( (app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x) / 2, (app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y) / 2, - 8 + 10 ); // Zentriere das Popup backgroundContainer.setLocalTranslation( (app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x - padding) / 2, (app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y+ padding) / 2, - 7 + 9 ); app.getGuiNode().attachChild(buyCardContainer); From b89d40b39fdb98eb7e4d5c8d48d52ac108eba0a9 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Sun, 1 Dec 2024 00:14:04 +0100 Subject: [PATCH 2/2] fixed nullPointer --- .../pp/monopoly/client/gui/PropertyOverviewMenu.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java index a6dd56d..e64079a 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java @@ -95,8 +95,14 @@ public class PropertyOverviewMenu extends Dialog { // Fetch the current player Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()); - // Iterate through the player's properties - for (PropertyField property : currentPlayer.getPropertyFields()) { + // Fetch the player's properties using their indices + List fields = new ArrayList<>(); + for (Integer i : currentPlayer.getProperties()) { + fields.add((PropertyField) app.getGameLogic().getBoardManager().getFieldAtIndex(i)); + } + + // Iterate through the fetched properties + for (PropertyField property : fields) { if (property instanceof BuildingProperty) { BuildingProperty building = (BuildingProperty) property; cards.add(createBuildingCard(building));