Compare commits

..

No commits in common. "f3ec17b0b1efbec07f1ab3296d4c7a885cc91279" and "488ae154cfcbb6ecb5b6bbe7de6c70b49fb842c2" have entirely different histories.

7 changed files with 17 additions and 61 deletions

View File

@ -12,17 +12,12 @@ import com.simsilica.lemur.component.SpringGridLayout;
import com.simsilica.lemur.style.ElementId; import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog; import pp.dialog.Dialog;
import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.MonopolyApp;
import pp.monopoly.client.gui.popups.BuyHouse;
import pp.monopoly.client.gui.popups.RepayMortage;
import pp.monopoly.client.gui.popups.SellHouse;
import pp.monopoly.client.gui.popups.TakeMortage;
import pp.monopoly.notification.Sound; import pp.monopoly.notification.Sound;
public class BuildingAdminMenu extends Dialog { public class BuildingAdminMenu extends Dialog {
private final MonopolyApp app; private final MonopolyApp app;
private final Container mainContainer; private final Container mainContainer;
private Geometry background;
private final Button backButton = new Button("Zurück"); private final Button backButton = new Button("Zurück");
private final Button buildButton = new Button("Bauen"); private final Button buildButton = new Button("Bauen");
private final Button demolishButton = new Button("Abriss"); private final Button demolishButton = new Button("Abriss");
@ -86,7 +81,6 @@ public class BuildingAdminMenu extends Dialog {
overviewButton.setPreferredSize(new Vector3f(200, 50, 0)); overviewButton.setPreferredSize(new Vector3f(200, 50, 0));
overviewButton.addClickCommands(s -> ifTopDialog(() -> { overviewButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
new PropertyOverviewMenu(app).open();
})); }));
overviewColumn.addChild(overviewButton); overviewColumn.addChild(overviewButton);
@ -94,7 +88,7 @@ public class BuildingAdminMenu extends Dialog {
backButton.setPreferredSize(new Vector3f(200, 50, 0)); backButton.setPreferredSize(new Vector3f(200, 50, 0));
backButton.addClickCommands(s -> ifTopDialog(() -> { backButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
close(); this.close();
})); }));
overviewColumn.addChild(backButton); overviewColumn.addChild(backButton);
@ -109,7 +103,6 @@ public class BuildingAdminMenu extends Dialog {
buildButton.setPreferredSize(new Vector3f(200, 50, 0)); buildButton.setPreferredSize(new Vector3f(200, 50, 0));
buildButton.addClickCommands(s -> ifTopDialog(() -> { buildButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
new BuyHouse(app).open();
})); }));
buildColumn.addChild(buildButton); buildColumn.addChild(buildButton);
@ -117,7 +110,6 @@ public class BuildingAdminMenu extends Dialog {
demolishButton.setPreferredSize(new Vector3f(200, 50, 0)); demolishButton.setPreferredSize(new Vector3f(200, 50, 0));
demolishButton.addClickCommands(s -> ifTopDialog(() -> { demolishButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
new SellHouse(app).open();
})); }));
buildColumn.addChild(demolishButton); buildColumn.addChild(demolishButton);
@ -132,7 +124,6 @@ public class BuildingAdminMenu extends Dialog {
takeMortgageButton.setPreferredSize(new Vector3f(200, 50, 0)); takeMortgageButton.setPreferredSize(new Vector3f(200, 50, 0));
takeMortgageButton.addClickCommands(s -> ifTopDialog(() -> { takeMortgageButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
new TakeMortage(app).open();
})); }));
mortgageColumn.addChild(takeMortgageButton); mortgageColumn.addChild(takeMortgageButton);
@ -140,7 +131,6 @@ public class BuildingAdminMenu extends Dialog {
payMortgageButton.setPreferredSize(new Vector3f(200, 50, 0)); payMortgageButton.setPreferredSize(new Vector3f(200, 50, 0));
payMortgageButton.addClickCommands(s -> ifTopDialog(() -> { payMortgageButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
new RepayMortage(app).open();
})); }));
mortgageColumn.addChild(payMortgageButton); mortgageColumn.addChild(payMortgageButton);
@ -155,7 +145,7 @@ public class BuildingAdminMenu extends Dialog {
private void addBackgroundImage() { private void addBackgroundImage() {
Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png"); Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png");
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
background = new Geometry("Background", quad); Geometry background = new Geometry("Background", quad);
Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
backgroundMaterial.setTexture("ColorMap", backgroundImage); backgroundMaterial.setTexture("ColorMap", backgroundImage);
background.setMaterial(backgroundMaterial); background.setMaterial(backgroundMaterial);
@ -171,13 +161,6 @@ public class BuildingAdminMenu extends Dialog {
close(); close();
} }
@Override
public void close() {
app.getGuiNode().detachChild(mainContainer);
app.getGuiNode().detachChild(background);
super.close();
}
@Override @Override
public void escape() { public void escape() {
handleBack(); handleBack();

View File

@ -95,14 +95,8 @@ public class PropertyOverviewMenu extends Dialog {
// Fetch the current player // Fetch the current player
Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()); Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId());
// Fetch the player's properties using their indices // Iterate through the player's properties
List<PropertyField> fields = new ArrayList<>(); for (PropertyField property : currentPlayer.getPropertyFields()) {
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) { if (property instanceof BuildingProperty) {
BuildingProperty building = (BuildingProperty) property; BuildingProperty building = (BuildingProperty) property;
cards.add(createBuildingCard(building)); cards.add(createBuildingCard(building));

View File

@ -15,6 +15,7 @@ import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog; import pp.dialog.Dialog;
import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.MonopolyApp;
import pp.monopoly.game.server.Player; import pp.monopoly.game.server.Player;
import pp.monopoly.game.server.PlayerColor;
import pp.monopoly.game.server.PlayerHandler; import pp.monopoly.game.server.PlayerHandler;
import pp.monopoly.message.client.EndTurn; import pp.monopoly.message.client.EndTurn;
import pp.monopoly.message.client.RollDice; import pp.monopoly.message.client.RollDice;
@ -62,35 +63,13 @@ public class Toolbar extends Dialog implements GameEventListener {
Player currentPlayer = playerHandler.getPlayerById(app.getId()); Player currentPlayer = playerHandler.getPlayerById(app.getId());
ColorRGBA playerColor = currentPlayer.getColor().getColor(); ColorRGBA playerColor = currentPlayer.getColor().getColor();
// Oberer Balken // Füge einen farbigen Balken hinzu
Container playerColorBar = new Container(); Container playerColorBar = new Container();
playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 15, 0)); // Höhe des oberen Balkens playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 40, 0)); // Höhe des Balkens auf 10 festlegen
playerColorBar.setBackground(new QuadBackgroundComponent(playerColor)); playerColorBar.setBackground(new QuadBackgroundComponent(playerColor));
playerColorBar.setLocalTranslation(0, 210, 1); // Position über der Toolbar playerColorBar.setLocalTranslation(0, 220, 1); // Positioniere ihn an der oberen Kante der Toolbar
app.getGuiNode().attachChild(playerColorBar); app.getGuiNode().attachChild(playerColorBar);
// unterer Balken
Container playerColorBarbot = new Container();
playerColorBarbot.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 10, 0)); // Höhe des oberen Balkens
playerColorBarbot.setBackground(new QuadBackgroundComponent(playerColor));
playerColorBarbot.setLocalTranslation(0, 10, 3); // Position über der Toolbar
app.getGuiNode().attachChild(playerColorBarbot);
// Linker Balken
Container leftBar = new Container();
leftBar.setPreferredSize(new Vector3f(10, 210, 0)); // Breite 10, Höhe 210
leftBar.setBackground(new QuadBackgroundComponent(playerColor));
leftBar.setLocalTranslation(0, 200, 3); // Position am linken Rand
app.getGuiNode().attachChild(leftBar);
// Rechter Balken
Container rightBar = new Container();
rightBar.setPreferredSize(new Vector3f(10, 210, 0)); // Breite 10, Höhe 210
rightBar.setBackground(new QuadBackgroundComponent(playerColor));
rightBar.setLocalTranslation(app.getCamera().getWidth() - 10, 200, 2); // Position am rechten Rand
app.getGuiNode().attachChild(rightBar);
// Übersicht und Konto // Übersicht und Konto
accountContainer = container.addChild(new Container()); accountContainer = container.addChild(new Container());
overviewContainer = container.addChild(new Container()); overviewContainer = container.addChild(new Container());

View File

@ -125,14 +125,14 @@ public class BuyHouse extends Dialog {
buyHouseContainer.setLocalTranslation( buyHouseContainer.setLocalTranslation(
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x) / 2, (app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x) / 2,
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y) / 2, (app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y) / 2,
9 8
); );
// Zentriere das Popup // Zentriere das Popup
backgroundContainer.setLocalTranslation( backgroundContainer.setLocalTranslation(
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x - padding) / 2, (app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x - padding) / 2,
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y+ padding) / 2, (app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y+ padding) / 2,
8 7
); );
app.getGuiNode().attachChild(buyHouseContainer); app.getGuiNode().attachChild(buyHouseContainer);

View File

@ -125,14 +125,14 @@ public class RepayMortage extends Dialog {
repayMortageContainer.setLocalTranslation( repayMortageContainer.setLocalTranslation(
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x) / 2, (app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x) / 2,
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y) / 2, (app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y) / 2,
9 8
); );
// Zentriere das Popup // Zentriere das Popup
backgroundContainer.setLocalTranslation( backgroundContainer.setLocalTranslation(
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x - padding) / 2, (app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x - padding) / 2,
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y+ padding) / 2, (app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y+ padding) / 2,
8 7
); );
app.getGuiNode().attachChild(repayMortageContainer); app.getGuiNode().attachChild(repayMortageContainer);

View File

@ -129,14 +129,14 @@ public class SellHouse extends Dialog {
sellhouseContainer.setLocalTranslation( sellhouseContainer.setLocalTranslation(
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x) / 2, (app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x) / 2,
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y) / 2, (app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y) / 2,
9 8
); );
// Zentriere das Popup // Zentriere das Popup
backgroundContainer.setLocalTranslation( backgroundContainer.setLocalTranslation(
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x - padding) / 2, (app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x - padding) / 2,
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y+ padding) / 2, (app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y+ padding) / 2,
8 7
); );
app.getGuiNode().attachChild(sellhouseContainer); app.getGuiNode().attachChild(sellhouseContainer);

View File

@ -125,14 +125,14 @@ public class TakeMortage extends Dialog {
takeMortageContainer.setLocalTranslation( takeMortageContainer.setLocalTranslation(
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x) / 2, (app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x) / 2,
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y) / 2, (app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y) / 2,
9 8
); );
// Zentriere das Popup // Zentriere das Popup
backgroundContainer.setLocalTranslation( backgroundContainer.setLocalTranslation(
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x - padding) / 2, (app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x - padding) / 2,
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y+ padding) / 2, (app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y+ padding) / 2,
8 7
); );
app.getGuiNode().attachChild(takeMortageContainer); app.getGuiNode().attachChild(takeMortageContainer);