mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-04-17 12:40:59 +02:00
Compare commits
12 Commits
1438ae5e4f
...
ecf227daa6
Author | SHA1 | Date | |
---|---|---|---|
|
ecf227daa6 | ||
|
4b5a156865 | ||
|
cfae369fd3 | ||
|
b05eabbbf8 | ||
|
fd178eee43 | ||
|
aef2ef34fb | ||
|
fcbffa1189 | ||
|
0d8240381e | ||
|
77da6679ef | ||
|
5845254caa | ||
|
5d92d7cfcc | ||
|
67f6649242 |
@ -262,6 +262,16 @@ selector("settings-title", "pp") {
|
|||||||
textHAlignment = HAlignment.Center
|
textHAlignment = HAlignment.Center
|
||||||
textVAlignment = VAlignment.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") {
|
selector("menu-button", "pp") {
|
||||||
fontSize = 40 // Set font size
|
fontSize = 40 // Set font size
|
||||||
|
@ -124,7 +124,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
|||||||
private final ActionListener escapeListener = (name, isPressed, tpf) -> escape(isPressed);
|
private final ActionListener escapeListener = (name, isPressed, tpf) -> escape(isPressed);
|
||||||
|
|
||||||
//TODO temp for testing
|
//TODO temp for testing
|
||||||
private EventCard eventCard;
|
private EventCardPopup eventCard;
|
||||||
private BuildingPropertyCard buildingProperty;
|
private BuildingPropertyCard buildingProperty;
|
||||||
private FoodFieldCard foodField;
|
private FoodFieldCard foodField;
|
||||||
private GateFieldCard gateField;
|
private GateFieldCard gateField;
|
||||||
@ -274,7 +274,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
|||||||
//logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO süäter entfernen
|
//logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO süäter entfernen
|
||||||
private void handleB(boolean isPressed) {
|
private void handleB(boolean isPressed) {
|
||||||
if (isPressed) {
|
if (isPressed) {
|
||||||
Dialog tmp = new Bankrupt(this);
|
Dialog tmp = new TimeOut(this);
|
||||||
tmp.open();
|
tmp.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ public class BuildingAdminMenu extends Dialog {
|
|||||||
private final Button takeMortgageButton = new Button("Hypothek aufnehmen");
|
private final Button takeMortgageButton = new Button("Hypothek aufnehmen");
|
||||||
private final Button payMortgageButton = new Button("Hypothek bezahlen");
|
private final Button payMortgageButton = new Button("Hypothek bezahlen");
|
||||||
private final Button overviewButton = new Button("Übersicht");
|
private final Button overviewButton = new Button("Übersicht");
|
||||||
|
private Geometry background;
|
||||||
|
|
||||||
public BuildingAdminMenu(MonopolyApp app) {
|
public BuildingAdminMenu(MonopolyApp app) {
|
||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
@ -42,7 +43,7 @@ public class BuildingAdminMenu extends Dialog {
|
|||||||
// Add content
|
// Add content
|
||||||
mainContainer.addChild(createContent());
|
mainContainer.addChild(createContent());
|
||||||
// Attach main container to GUI node
|
// Attach main container to GUI node
|
||||||
app.getGuiNode().attachChild(mainContainer);
|
attachChild(mainContainer);
|
||||||
mainContainer.setLocalTranslation(
|
mainContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - mainContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - mainContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + mainContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + mainContainer.getPreferredSize().y) / 2,
|
||||||
@ -146,29 +147,23 @@ 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());
|
||||||
Geometry background = new Geometry("Background", quad);
|
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);
|
||||||
background.setLocalTranslation(0, 0, 6); // Position behind other GUI elements
|
background.setLocalTranslation(0, 0, 6); // Position behind other GUI elements
|
||||||
app.getGuiNode().attachChild(background);
|
attachChild(background);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the "Zurück" action.
|
|
||||||
*/
|
|
||||||
private void handleBack() {
|
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void escape() {
|
public void escape() {
|
||||||
handleBack();
|
new SettingsMenu(app).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(float delta) {
|
public void close() {
|
||||||
// Periodic updates if necessary
|
detachChild(background);
|
||||||
|
detachChild(mainContainer);
|
||||||
|
super.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -93,7 +93,7 @@ public class PropertyOverviewMenu extends Dialog {
|
|||||||
*/
|
*/
|
||||||
private void populatePlayerProperties() {
|
private void populatePlayerProperties() {
|
||||||
// Fetch the current player
|
// Fetch the current player
|
||||||
Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayers().get(0);
|
Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId());
|
||||||
|
|
||||||
// Iterate through the player's properties
|
// Iterate through the player's properties
|
||||||
for (PropertyField property : currentPlayer.getPropertyFields()) {
|
for (PropertyField property : currentPlayer.getPropertyFields()) {
|
||||||
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import pp.monopoly.client.MonopolyApp;
|
import pp.monopoly.client.MonopolyApp;
|
||||||
import pp.monopoly.client.gui.popups.BuyCard;
|
import pp.monopoly.client.gui.popups.BuyCard;
|
||||||
import pp.monopoly.client.gui.popups.EventCard;
|
import pp.monopoly.client.gui.popups.EventCardPopup;
|
||||||
import pp.monopoly.client.gui.popups.FoodFieldCard;
|
import pp.monopoly.client.gui.popups.FoodFieldCard;
|
||||||
import pp.monopoly.client.gui.popups.GateFieldCard;
|
import pp.monopoly.client.gui.popups.GateFieldCard;
|
||||||
import pp.monopoly.client.gui.popups.LooserPopUp;
|
import pp.monopoly.client.gui.popups.LooserPopUp;
|
||||||
@ -98,12 +98,17 @@ public class TestWorld implements GameEventListener{
|
|||||||
Player player = players.get(i);
|
Player player = players.get(i);
|
||||||
try {
|
try {
|
||||||
// Lade das 3D-Modell der Spielfigur
|
// Lade das 3D-Modell der Spielfigur
|
||||||
com.jme3.scene.Spatial model = app.getAssetManager().loadModel("Models/" + player.getFigure().getType() + ".j3O");
|
com.jme3.scene.Spatial model = app.getAssetManager().loadModel("Models/" + player.getFigure().getType() + "/" + player.getFigure().getType() + ".j3o");
|
||||||
model.setLocalScale(0.5f); // Skaliere das Modell
|
model.setLocalScale(0.5f); // Skaliere das Modell
|
||||||
model.setLocalTranslation(0, 0, -i * 2); // Positioniere die Figur auf dem Startfeld
|
|
||||||
|
// Positioniere die Figur unten rechts
|
||||||
|
float startX = 9.1f; // X-Koordinate für die Ecke unten rechts
|
||||||
|
float startZ = -9.1f; // Z-Koordinate für die Ecke unten rechts
|
||||||
|
float spacing = 0.4f; // Abstand zwischen den Figuren
|
||||||
|
model.setLocalTranslation(startX, 0, startZ - (i * spacing)); // Position anpassen
|
||||||
|
|
||||||
app.getRootNode().attachChild(model);
|
app.getRootNode().attachChild(model);
|
||||||
System.out.println("Figur für Spieler " + player.getId() + " hinzugefügt.");
|
System.out.println("Figur für Spieler " + player.getId() + " positioniert bei (" + startX + ", 0, " + (startZ - (i * spacing)) + ")");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Fehler beim Laden des Modells für Spieler " + player.getId() + ": " + e.getMessage());
|
System.err.println("Fehler beim Laden des Modells für Spieler " + player.getId() + ": " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -152,6 +157,6 @@ public class TestWorld implements GameEventListener{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(EventCardEvent event) {
|
public void receivedEvent(EventCardEvent event) {
|
||||||
new EventCard(app, event.description()).open();
|
new EventCardPopup(app, event.description()).open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,15 @@ 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;
|
||||||
import pp.monopoly.notification.*;
|
import pp.monopoly.notification.ButtonStatusEvent;
|
||||||
|
import pp.monopoly.notification.DiceRollEvent;
|
||||||
|
import pp.monopoly.notification.GameEventListener;
|
||||||
|
import pp.monopoly.notification.Sound;
|
||||||
|
import pp.monopoly.notification.UpdatePlayerView;
|
||||||
|
|
||||||
public class Toolbar extends Dialog implements GameEventListener {
|
public class Toolbar extends Dialog implements GameEventListener {
|
||||||
|
|
||||||
@ -49,19 +54,31 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Container createToolbarContainer() {
|
private Container createToolbarContainer() {
|
||||||
|
// Erstelle den Hauptcontainer
|
||||||
Container container = new Container(new SpringGridLayout(Axis.X, Axis.Y), "toolbar");
|
Container container = new Container(new SpringGridLayout(Axis.X, Axis.Y), "toolbar");
|
||||||
container.setLocalTranslation(0, 200, 0);
|
container.setLocalTranslation(0, 200, 0);
|
||||||
container.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 200, 0));
|
container.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 200, 0));
|
||||||
|
|
||||||
// Create account and overview containers
|
// Spielerfarbe abrufen
|
||||||
|
Player currentPlayer = playerHandler.getPlayerById(app.getId());
|
||||||
|
ColorRGBA playerColor = convertPlayerColor(currentPlayer.getColor());
|
||||||
|
|
||||||
|
// Füge einen farbigen Balken hinzu
|
||||||
|
Container playerColorBar = new Container();
|
||||||
|
playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 40, 0)); // Höhe des Balkens auf 10 festlegen
|
||||||
|
playerColorBar.setBackground(new QuadBackgroundComponent(playerColor));
|
||||||
|
playerColorBar.setLocalTranslation(0, 220, 1); // Positioniere ihn an der oberen Kante der Toolbar
|
||||||
|
app.getGuiNode().attachChild(playerColorBar);
|
||||||
|
|
||||||
|
// Übersicht und Konto
|
||||||
accountContainer = container.addChild(new Container());
|
accountContainer = container.addChild(new Container());
|
||||||
overviewContainer = container.addChild(new Container());
|
overviewContainer = container.addChild(new Container());
|
||||||
receivedEvent(new UpdatePlayerView());
|
receivedEvent(new UpdatePlayerView()); // Initiale Aktualisierung
|
||||||
|
|
||||||
// Dice section
|
// Würfel-Bereich
|
||||||
container.addChild(createDiceSection());
|
container.addChild(createDiceSection());
|
||||||
|
|
||||||
// Action menu
|
// Aktionsmenü
|
||||||
Container menuContainer = container.addChild(new Container());
|
Container menuContainer = container.addChild(new Container());
|
||||||
menuContainer.addChild(createTradeButton());
|
menuContainer.addChild(createTradeButton());
|
||||||
menuContainer.addChild(createPropertyMenuButton());
|
menuContainer.addChild(createPropertyMenuButton());
|
||||||
@ -71,6 +88,19 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ColorRGBA convertPlayerColor(PlayerColor color) {
|
||||||
|
switch (color) {
|
||||||
|
case CYAN: return new ColorRGBA(0f, 1f, 1f, 1f); // Cyan
|
||||||
|
case YELLOW: return ColorRGBA.Yellow;
|
||||||
|
case RED: return ColorRGBA.Red;
|
||||||
|
case PINK: return new ColorRGBA(1f, 0.75f, 0.8f, 1f); // Pink
|
||||||
|
case GREEN: return ColorRGBA.Green;
|
||||||
|
case PURPLE: return new ColorRGBA(0.5f, 0f, 0.5f, 1f); // Purple
|
||||||
|
default: return ColorRGBA.Gray; // Fallback
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private Container createDiceSection() {
|
private Container createDiceSection() {
|
||||||
Container diceContainer = new Container(new SpringGridLayout(Axis.X, Axis.Y));
|
Container diceContainer = new Container(new SpringGridLayout(Axis.X, Axis.Y));
|
||||||
diceContainer.addChild(createDiceDisplay());
|
diceContainer.addChild(createDiceDisplay());
|
||||||
@ -171,7 +201,7 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
|
|
||||||
private void animateDice(long startTime) throws InterruptedException {
|
private void animateDice(long startTime) throws InterruptedException {
|
||||||
int[] currentFace = {1};
|
int[] currentFace = {1};
|
||||||
while (System.currentTimeMillis() - startTime < 2500) { // Animation duration
|
while (System.currentTimeMillis() - startTime < 2000) { // Animation duration
|
||||||
currentFace[0] = (currentFace[0] % 6) + 1;
|
currentFace[0] = (currentFace[0] % 6) + 1;
|
||||||
|
|
||||||
String rotatingImage1 = diceToString(currentFace[0]);
|
String rotatingImage1 = diceToString(currentFace[0]);
|
||||||
@ -190,7 +220,6 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
app.enqueue(() -> {
|
app.enqueue(() -> {
|
||||||
setDiceIcon(imageLabel, diceToString(event.a()));
|
setDiceIcon(imageLabel, diceToString(event.a()));
|
||||||
setDiceIcon(imageLabel2, diceToString(event.b()));
|
setDiceIcon(imageLabel2, diceToString(event.b()));
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,6 +249,8 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(UpdatePlayerView event) {
|
public void receivedEvent(UpdatePlayerView event) {
|
||||||
|
|
||||||
|
System.out.println("Update Player View");
|
||||||
accountContainer.clearChildren();
|
accountContainer.clearChildren();
|
||||||
overviewContainer.clearChildren();
|
overviewContainer.clearChildren();
|
||||||
|
|
||||||
@ -238,10 +269,20 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
overviewContainer.addChild(new Label("Übersicht", new ElementId("label-Bold")));
|
overviewContainer.addChild(new Label("Übersicht", new ElementId("label-Bold")));
|
||||||
for (Player player : playerHandler.getPlayers()) {
|
for (Player player : playerHandler.getPlayers()) {
|
||||||
if (player.getId() != app.getId()) {
|
if (player.getId() != app.getId()) {
|
||||||
overviewContainer.addChild(new Label(
|
// Spielerfarbe abrufen
|
||||||
|
ColorRGBA playerColor = convertPlayerColor(player.getColor());
|
||||||
|
|
||||||
|
// Label für den Spieler erstellen
|
||||||
|
Label playerLabel = new Label(
|
||||||
player.getName() + ": " + player.getAccountBalance() + " EUR",
|
player.getName() + ": " + player.getAccountBalance() + " EUR",
|
||||||
new ElementId("label-Text")
|
new ElementId("label-Text")
|
||||||
));
|
);
|
||||||
|
|
||||||
|
// Farbe setzen
|
||||||
|
playerLabel.setColor(playerColor);
|
||||||
|
|
||||||
|
// Label zum Container hinzufügen
|
||||||
|
overviewContainer.addChild(playerLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
overviewContainer.setBackground(createBackground());
|
overviewContainer.setBackground(createBackground());
|
||||||
@ -266,4 +307,10 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
public void escape() {
|
public void escape() {
|
||||||
new SettingsMenu(app).open();
|
new SettingsMenu(app).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update() {
|
||||||
|
receivedEvent(new UpdatePlayerView());
|
||||||
|
super.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,17 @@ import com.simsilica.lemur.*;
|
|||||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||||
import com.simsilica.lemur.component.SpringGridLayout;
|
import com.simsilica.lemur.component.SpringGridLayout;
|
||||||
import com.simsilica.lemur.core.VersionedList;
|
import com.simsilica.lemur.core.VersionedList;
|
||||||
|
import com.simsilica.lemur.core.VersionedReference;
|
||||||
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.game.server.Player;
|
||||||
import pp.monopoly.model.TradeHandler;
|
import pp.monopoly.model.TradeHandler;
|
||||||
import pp.monopoly.model.fields.PropertyField;
|
import pp.monopoly.model.fields.PropertyField;
|
||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class TradeMenu extends Dialog {
|
public class TradeMenu extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
private final TradeHandler tradeHandler;
|
private final TradeHandler tradeHandler;
|
||||||
@ -29,6 +33,11 @@ public class TradeMenu extends Dialog {
|
|||||||
private Selector<String> rightBuildingSelector, rightSpecialCardSelector;
|
private Selector<String> rightBuildingSelector, rightSpecialCardSelector;
|
||||||
private TextField leftSelectionsField, rightSelectionsField;
|
private TextField leftSelectionsField, rightSelectionsField;
|
||||||
private TextField leftCurrencyInput, rightCurrencyInput;
|
private TextField leftCurrencyInput, rightCurrencyInput;
|
||||||
|
private VersionedReference<Set<Integer>> selectionRef; // Reference to track selector changes
|
||||||
|
private String valueSelected = ""; // To keep track of the last selected value
|
||||||
|
private String buildingSelected = "";
|
||||||
|
private String specialCardSelected = "";
|
||||||
|
|
||||||
|
|
||||||
private static final ColorRGBA TRANSLUCENT_WHITE = new ColorRGBA(1, 1, 1, 0.5f);
|
private static final ColorRGBA TRANSLUCENT_WHITE = new ColorRGBA(1, 1, 1, 0.5f);
|
||||||
|
|
||||||
@ -99,6 +108,7 @@ public class TradeMenu extends Dialog {
|
|||||||
|
|
||||||
column.addChild(new Label("Gebäude:"));
|
column.addChild(new Label("Gebäude:"));
|
||||||
Selector<String> buildingSelector = createPropertySelector(isLeft);
|
Selector<String> buildingSelector = createPropertySelector(isLeft);
|
||||||
|
buildingSelector.getPopupContainer().setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
|
||||||
column.addChild(buildingSelector);
|
column.addChild(buildingSelector);
|
||||||
|
|
||||||
column.addChild(new Label("Währung:"));
|
column.addChild(new Label("Währung:"));
|
||||||
@ -107,6 +117,7 @@ public class TradeMenu extends Dialog {
|
|||||||
|
|
||||||
column.addChild(new Label("Sonderkarten:"));
|
column.addChild(new Label("Sonderkarten:"));
|
||||||
Selector<String> specialCardSelector = createSpecialCardSelector();
|
Selector<String> specialCardSelector = createSpecialCardSelector();
|
||||||
|
specialCardSelector.getPopupContainer().setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
|
||||||
styleSelector(specialCardSelector);
|
styleSelector(specialCardSelector);
|
||||||
column.addChild(specialCardSelector);
|
column.addChild(specialCardSelector);
|
||||||
|
|
||||||
@ -253,4 +264,42 @@ public class TradeMenu extends Dialog {
|
|||||||
app.getGuiNode().detachChild(mainContainer);
|
app.getGuiNode().detachChild(mainContainer);
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the dialog periodically, called by the dialog manager.
|
||||||
|
*
|
||||||
|
* @param delta The time elapsed since the last update.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void update(float delta) {
|
||||||
|
// Check if the selection has changed
|
||||||
|
// if (selectionRef.update()) {
|
||||||
|
// String selected = playerSelector.getSelectedItem();
|
||||||
|
// if (!selected.equals(lastSelected)) {
|
||||||
|
// lastSelected = selected;
|
||||||
|
// onDropdownSelectionChanged(selected);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import pp.dialog.Dialog;
|
|||||||
import pp.monopoly.client.MonopolyApp;
|
import pp.monopoly.client.MonopolyApp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bankrupt is a Warning-Popup, which appears, if the balance is negative at the end of a player´s turn // TODO welche menü-Klasse
|
* Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn
|
||||||
*/
|
*/
|
||||||
public class Bankrupt extends Dialog {
|
public class Bankrupt extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -49,7 +49,7 @@ public class Bankrupt extends Dialog {
|
|||||||
backgroundContainer.setPreferredSize(bankruptContainer.getPreferredSize().addLocal(padding, padding, 0));
|
backgroundContainer.setPreferredSize(bankruptContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
// Titel
|
// 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.setFontSize(48);
|
||||||
gateFieldTitle.setColor(ColorRGBA.Black);
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
@ -67,14 +67,14 @@ public class Bankrupt extends Dialog {
|
|||||||
quitButton.addClickCommands(source -> close());
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
|
|
||||||
// Zentriere den Container
|
// Zentriere das Popup
|
||||||
bankruptContainer.setLocalTranslation(
|
bankruptContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - bankruptContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - bankruptContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + bankruptContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + bankruptContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere den Container
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - bankruptContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - bankruptContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + bankruptContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + bankruptContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -16,8 +16,7 @@ import pp.monopoly.client.gui.SettingsMenu;
|
|||||||
import pp.monopoly.model.fields.BuildingProperty;
|
import pp.monopoly.model.fields.BuildingProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Kommentare fixen
|
* BuildingPropertyCard creates the popup for field information
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
|
||||||
*/
|
*/
|
||||||
public class BuildingPropertyCard extends Dialog {
|
public class BuildingPropertyCard extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -46,6 +45,9 @@ public class BuildingPropertyCard extends Dialog {
|
|||||||
buildingPropertyContainer = new Container();
|
buildingPropertyContainer = new Container();
|
||||||
buildingPropertyContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
|
buildingPropertyContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des buildingPropertyContainer an
|
||||||
|
backgroundContainer.setPreferredSize(buildingPropertyContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
|
||||||
Label settingsTitle = buildingPropertyContainer.addChild(new Label( field.getName(), new ElementId("settings-title")));
|
Label settingsTitle = buildingPropertyContainer.addChild(new Label( field.getName(), new ElementId("settings-title")));
|
||||||
settingsTitle.setFontSize(48);
|
settingsTitle.setFontSize(48);
|
||||||
@ -66,28 +68,14 @@ public class BuildingPropertyCard extends Dialog {
|
|||||||
propertyValuesContainer.addChild(new Label("„Hypothek: " + field.getHypo() + " EUR", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("„Hypothek: " + field.getHypo() + " EUR", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
//TODO eventuell diese Stelle löschen, da nur die BuyCard Kaufen und beenden hat
|
// Zentriere das Popup
|
||||||
|
|
||||||
/*
|
|
||||||
// Beenden-Button
|
|
||||||
Button quitButton = foodFieldContainer.addChild(new Button("Beenden", new ElementId("button")));
|
|
||||||
quitButton.setFontSize(32);
|
|
||||||
// Kaufen-Button
|
|
||||||
Button buyButton = foodFieldContainer.addChild(new Button("Kaufen", new ElementId("button")));
|
|
||||||
buyButton.setFontSize(32);
|
|
||||||
*/
|
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
|
||||||
backgroundContainer.setPreferredSize(buildingPropertyContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
buildingPropertyContainer.setLocalTranslation(
|
buildingPropertyContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buildingPropertyContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - buildingPropertyContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + buildingPropertyContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + buildingPropertyContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buildingPropertyContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - buildingPropertyContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + buildingPropertyContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + buildingPropertyContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -15,7 +15,7 @@ import pp.monopoly.model.fields.BuildingProperty;
|
|||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* BuyCard is a popup that appears when a player lands on a field that is still available for purchase.
|
||||||
*/
|
*/
|
||||||
public class BuyCard extends Dialog {
|
public class BuyCard extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -28,7 +28,7 @@ public class BuyCard extends Dialog {
|
|||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
//Generate the corresponfing field
|
||||||
int index = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID();;
|
int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID();
|
||||||
BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
||||||
|
|
||||||
// Create the background container
|
// Create the background container
|
||||||
@ -39,12 +39,15 @@ public class BuyCard extends Dialog {
|
|||||||
// Hauptcontainer für die Gebäudekarte
|
// Hauptcontainer für die Gebäudekarte
|
||||||
buyCardContainer = new Container();
|
buyCardContainer = new Container();
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des buyCardContainers an
|
||||||
|
backgroundContainer.setPreferredSize(buyCardContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
// Titel
|
||||||
Label title = buyCardContainer.addChild(new Label( field.getName(), new ElementId("label-Bold")));
|
Label title = buyCardContainer.addChild(new Label( field.getName(), new ElementId("label-Bold")));
|
||||||
title.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
|
title.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
|
||||||
title.setFontSize(48);
|
title.setFontSize(48);
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
// Text, der auf dem Popup steht
|
||||||
// Die Preise werden dynamisch dem BoardManager entnommen
|
// Die Preise werden dynamisch dem BoardManager entnommen
|
||||||
Container propertyValuesContainer = buyCardContainer.addChild(new Container());
|
Container propertyValuesContainer = buyCardContainer.addChild(new Container());
|
||||||
propertyValuesContainer.addChild(new Label("„Grundstückswert: " + field.getPrice() + " EUR", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("„Grundstückswert: " + field.getPrice() + " EUR", new ElementId("label-Text")));
|
||||||
@ -77,17 +80,14 @@ public class BuyCard extends Dialog {
|
|||||||
app.getGameLogic().send(new BuyPropertyResponse());
|
app.getGameLogic().send(new BuyPropertyResponse());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
// Zentriere das Popup
|
||||||
backgroundContainer.setPreferredSize(buyCardContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
buyCardContainer.setLocalTranslation(
|
buyCardContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - buyCardContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + buyCardContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -12,7 +12,7 @@ import pp.monopoly.client.gui.SettingsMenu;
|
|||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* ConfirmTrade is a popup which appears when a trade is proposed to this certain player.
|
||||||
*/
|
*/
|
||||||
public class ConfirmTrade extends Dialog {
|
public class ConfirmTrade extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -24,25 +24,24 @@ public class ConfirmTrade extends Dialog {
|
|||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
|
||||||
//int index = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID();;
|
|
||||||
// BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
|
||||||
|
|
||||||
// Create the background container
|
// Create the background container
|
||||||
backgroundContainer = new Container();
|
backgroundContainer = new Container();
|
||||||
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
attachChild(backgroundContainer);
|
attachChild(backgroundContainer);
|
||||||
|
|
||||||
// Hauptcontainer für die Gebäudekarte
|
// Hauptcontainer für das Bestätigungspopup
|
||||||
confirmTradeContainer = new Container();
|
confirmTradeContainer = new Container();
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des confirmTradeContainer an
|
||||||
|
backgroundContainer.setPreferredSize(confirmTradeContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
Label title = confirmTradeContainer.addChild(new Label( "Handel", new ElementId("label-Bold"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
// Titel
|
||||||
|
Label title = confirmTradeContainer.addChild(new Label( "Handel", new ElementId("label-Bold")));
|
||||||
title.setFontSize(48);
|
title.setFontSize(48);
|
||||||
title.setColor(ColorRGBA.Black);
|
title.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
// Text, der auf der Karte steht
|
||||||
// Die Preise werden dynamisch dem BoardManager entnommen
|
// Die Werte werden dem Handel entnommen (Iwas auch immer da dann ist)
|
||||||
Container propertyValuesContainer = confirmTradeContainer.addChild(new Container());
|
Container propertyValuesContainer = confirmTradeContainer.addChild(new Container());
|
||||||
propertyValuesContainer.addChild(new Label("„Spieler XXX möchte:", new ElementId("label-Text"))); //TODO hier überall die entsprechenden Variablen einfügen
|
propertyValuesContainer.addChild(new Label("„Spieler XXX möchte:", new ElementId("label-Text"))); //TODO hier überall die entsprechenden Variablen einfügen
|
||||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
@ -59,30 +58,26 @@ public class ConfirmTrade extends Dialog {
|
|||||||
propertyValuesContainer.addChild(new Label("tauschen, willst du das Angebot annehmen?", new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label("tauschen, willst du das Angebot annehmen?", new ElementId("label-Text")));
|
||||||
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
// Beenden-Button
|
// Ablehnen-Button
|
||||||
Button declineButton = confirmTradeContainer.addChild(new Button("Ablehnen", new ElementId("button"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
Button declineButton = confirmTradeContainer.addChild(new Button("Ablehnen", new ElementId("button")));
|
||||||
declineButton.setFontSize(32);
|
declineButton.setFontSize(32);
|
||||||
declineButton.addClickCommands(s -> ifTopDialog(() -> {
|
declineButton.addClickCommands(s -> ifTopDialog(() -> { //TODO Buttonfunktion prüfen
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
close();
|
close();
|
||||||
}));
|
}));
|
||||||
// Kaufen-Button
|
// Verhandeln-Button
|
||||||
Button negotiateButton = confirmTradeContainer.addChild(new Button("Verhandeln", new ElementId("button"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
Button negotiateButton = confirmTradeContainer.addChild(new Button("Verhandeln", new ElementId("button")));
|
||||||
negotiateButton.setFontSize(32);
|
negotiateButton.setFontSize(32);
|
||||||
negotiateButton.addClickCommands(s -> ifTopDialog( () -> { //TODO Buttonfunktion prüfen
|
negotiateButton.addClickCommands(s -> ifTopDialog( () -> { //TODO Buttonfunktion prüfen
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
}));
|
}));
|
||||||
// Kaufen-Button
|
// Confirm-Button
|
||||||
Button confirmButton = confirmTradeContainer.addChild(new Button("Bestätigen", new ElementId("button"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
Button confirmButton = confirmTradeContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||||
confirmButton.setFontSize(32);
|
confirmButton.setFontSize(32);
|
||||||
confirmButton.addClickCommands(s -> ifTopDialog( () -> {
|
confirmButton.addClickCommands(s -> ifTopDialog( () -> { //TODO Buttonfunktion prüfen
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
|
||||||
backgroundContainer.setPreferredSize(confirmTradeContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
// Zentriere das Menü
|
||||||
confirmTradeContainer.setLocalTranslation(
|
confirmTradeContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x) / 2,
|
||||||
@ -90,6 +85,7 @@ public class ConfirmTrade extends Dialog {
|
|||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Menü
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + confirmTradeContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + confirmTradeContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -13,11 +13,11 @@ import com.simsilica.lemur.component.QuadBackgroundComponent;
|
|||||||
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.SettingsMenu;
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* EventCardPopup is a popup which appears when a certain EventCard is triggered by entering a EventCardField
|
||||||
*/
|
*/
|
||||||
public class EventCard extends Dialog {
|
public class EventCardPopup extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
private final Geometry overlayBackground;
|
private final Geometry overlayBackground;
|
||||||
private final Container eventCardContainer;
|
private final Container eventCardContainer;
|
||||||
@ -25,7 +25,7 @@ public class EventCard extends Dialog {
|
|||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
|
||||||
public EventCard(MonopolyApp app, String description) {
|
public EventCardPopup(MonopolyApp app, String description) {
|
||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
@ -39,19 +39,21 @@ public class EventCard extends Dialog {
|
|||||||
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
app.getGuiNode().attachChild(backgroundContainer);
|
app.getGuiNode().attachChild(backgroundContainer);
|
||||||
|
|
||||||
// Hauptcontainer für die Gebäudekarte
|
// Hauptcontainer für die Eventcard
|
||||||
eventCardContainer = new Container();
|
eventCardContainer = new Container();
|
||||||
eventCardContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
eventCardContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
eventCardContainer.setPreferredSize(new Vector3f(550,400,10));
|
eventCardContainer.setPreferredSize(new Vector3f(550,400,10));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des eventCardContainers an
|
||||||
|
backgroundContainer.setPreferredSize(eventCardContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
// Titel
|
// Titel
|
||||||
// Die Namen werden dynamisch dem BoardManager entnommen
|
|
||||||
Label gateFieldTitle = eventCardContainer.addChild(new Label("Ereigniskarte", new ElementId("settings-title")));
|
Label gateFieldTitle = eventCardContainer.addChild(new Label("Ereigniskarte", new ElementId("settings-title")));
|
||||||
gateFieldTitle.setFontSize(48);
|
gateFieldTitle.setFontSize(48);
|
||||||
gateFieldTitle.setColor(ColorRGBA.Black);
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
// Text, der auf der Karte steht
|
||||||
// Die Preise werden dynamisch dem BoardManager entnommen
|
// Die Erklärungsfelder werden automatisch den descriptions der Message entnommen
|
||||||
Container propertyValuesContainer = eventCardContainer.addChild(new Container());
|
Container propertyValuesContainer = eventCardContainer.addChild(new Container());
|
||||||
propertyValuesContainer.addChild(new Label(description, new ElementId("label-Text")));
|
propertyValuesContainer.addChild(new Label(description, new ElementId("label-Text")));
|
||||||
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
@ -62,17 +64,14 @@ public class EventCard extends Dialog {
|
|||||||
quitButton.setFontSize(32);
|
quitButton.setFontSize(32);
|
||||||
quitButton.addClickCommands(source -> close());
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
// Zentriere das Popup
|
||||||
backgroundContainer.setPreferredSize(eventCardContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
eventCardContainer.setLocalTranslation(
|
eventCardContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - eventCardContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + eventCardContainer.getPreferredSize().y+ padding) / 2,
|
@ -19,7 +19,7 @@ import pp.monopoly.model.fields.FoodField;
|
|||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FoodFieldCard erstellt die Geböudekarte vom Brandl und der Truppenküche
|
* FoodFieldCard creates the popup for field information
|
||||||
*/
|
*/
|
||||||
public class FoodFieldCard extends Dialog {
|
public class FoodFieldCard extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -32,7 +32,7 @@ public class FoodFieldCard extends Dialog {
|
|||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
//Generate the corresponfing field
|
||||||
int index = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID();
|
int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID();
|
||||||
FoodField field = (FoodField) app.getGameLogic().getBoardManager().getFieldAtIndex(index);
|
FoodField field = (FoodField) app.getGameLogic().getBoardManager().getFieldAtIndex(index);
|
||||||
|
|
||||||
// Halbtransparentes Overlay hinzufügen
|
// Halbtransparentes Overlay hinzufügen
|
||||||
@ -48,7 +48,8 @@ public class FoodFieldCard extends Dialog {
|
|||||||
foodFieldContainer = new Container();
|
foodFieldContainer = new Container();
|
||||||
foodFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f)));
|
foodFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f)));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des foodFieldContainers an
|
||||||
|
backgroundContainer.setPreferredSize(foodFieldContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
// Titel, bestehend aus dynamischen Namen anhand der ID und der Schriftfarbe/größe
|
// Titel, bestehend aus dynamischen Namen anhand der ID und der Schriftfarbe/größe
|
||||||
Label settingsTitle = foodFieldContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
Label settingsTitle = foodFieldContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
||||||
@ -86,16 +87,14 @@ public class FoodFieldCard extends Dialog {
|
|||||||
app.getGameLogic().send(new BuyPropertyResponse());
|
app.getGameLogic().send(new BuyPropertyResponse());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
// Zentriere das Popup
|
||||||
backgroundContainer.setPreferredSize(foodFieldContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
foodFieldContainer.setLocalTranslation(
|
foodFieldContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - foodFieldContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - foodFieldContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + foodFieldContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + foodFieldContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - foodFieldContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - foodFieldContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + foodFieldContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + foodFieldContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -18,7 +18,7 @@ import pp.monopoly.model.fields.GateField;
|
|||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* GateFieldCard creates the popup for field information
|
||||||
*/
|
*/
|
||||||
public class GateFieldCard extends Dialog {
|
public class GateFieldCard extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -31,7 +31,7 @@ public class GateFieldCard extends Dialog {
|
|||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
//Generate the corresponfing field
|
||||||
int index = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID();
|
int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID();
|
||||||
GateField field = (GateField) app.getGameLogic().getBoardManager().getFieldAtIndex(index);
|
GateField field = (GateField) app.getGameLogic().getBoardManager().getFieldAtIndex(index);
|
||||||
|
|
||||||
// Halbtransparentes Overlay hinzufügen
|
// Halbtransparentes Overlay hinzufügen
|
||||||
@ -47,6 +47,10 @@ public class GateFieldCard extends Dialog {
|
|||||||
gateFieldContainer = new Container();
|
gateFieldContainer = new Container();
|
||||||
gateFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
gateFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des gateFieldContainers an
|
||||||
|
backgroundContainer.setPreferredSize(gateFieldContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
|
||||||
// Titel
|
// Titel
|
||||||
// Die Namen werden dynamisch dem BoardManager entnommen
|
// Die Namen werden dynamisch dem BoardManager entnommen
|
||||||
Label gateFieldTitle = gateFieldContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
Label gateFieldTitle = gateFieldContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
||||||
@ -82,17 +86,14 @@ public class GateFieldCard extends Dialog {
|
|||||||
close();
|
close();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
// Zentriere das Popup
|
||||||
backgroundContainer.setPreferredSize(gateFieldContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
gateFieldContainer.setLocalTranslation(
|
gateFieldContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - gateFieldContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - gateFieldContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + gateFieldContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + gateFieldContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - gateFieldContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - gateFieldContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + gateFieldContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + gateFieldContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* SellHouse is a popup which appears when a player clicks on the demolish-button in the BuildingAdminMenu
|
||||||
*/
|
*/
|
||||||
public class SellHouse extends Dialog {
|
public class SellHouse extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -37,64 +37,41 @@ public class SellHouse extends Dialog {
|
|||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
|
||||||
//int index = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID();;
|
|
||||||
// BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
|
||||||
|
|
||||||
// Create the background container
|
// Create the background container
|
||||||
backgroundContainer = new Container();
|
backgroundContainer = new Container();
|
||||||
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
attachChild(backgroundContainer);
|
attachChild(backgroundContainer);
|
||||||
|
|
||||||
// Hauptcontainer für die Gebäudekarte
|
// Hauptcontainer für das Menü
|
||||||
sellhouseContainer = new Container();
|
sellhouseContainer = new Container();
|
||||||
sellhouseContainer.setPreferredSize(new Vector3f(800, 600, 0));
|
sellhouseContainer.setPreferredSize(new Vector3f(800, 600, 0));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des sellhouseContainers an
|
||||||
|
backgroundContainer.setPreferredSize(sellhouseContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
Label title = sellhouseContainer.addChild(new Label( "Gebäude Abreißen", new ElementId("label-Bold"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
// Titel
|
||||||
|
Label title = sellhouseContainer.addChild(new Label( "Gebäude Abreißen", new ElementId("warining-Bold")));
|
||||||
title.setFontSize(48);
|
title.setFontSize(48);
|
||||||
title.setColor(ColorRGBA.Black);
|
title.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
//Unterteilund des sellHouseContainer in drei "Untercontainer"
|
||||||
Container upContainer = sellhouseContainer.addChild(new Container());
|
Container upContainer = sellhouseContainer.addChild(new Container());
|
||||||
Container middleContainer = sellhouseContainer.addChild(new Container());
|
Container middleContainer = sellhouseContainer.addChild(new Container());
|
||||||
Container downContainer = sellhouseContainer.addChild(new Container());
|
Container downContainer = sellhouseContainer.addChild(new Container());
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
// Text, der auf der Karte steht
|
||||||
// Die Preise werden dynamisch dem BoardManager entnommen
|
|
||||||
upContainer.addChild(new Label("„Grundstück wählen:", new ElementId("label-Text"))); //TODO hier überall die entsprechenden Variablen einfügen
|
upContainer.addChild(new Label("„Grundstück wählen:", new ElementId("label-Text"))); //TODO hier überall die entsprechenden Variablen einfügen
|
||||||
upContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
upContainer.addChild(new Label("", new ElementId("label-Text")));// Leerzeile
|
||||||
upContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
upContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
middleContainer.setPreferredSize(new Vector3f(100, 150, 0));
|
middleContainer.setPreferredSize(new Vector3f(100, 150, 0));
|
||||||
middleContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
|
middleContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
|
||||||
/*
|
|
||||||
// Create a VersionedList for the ListBox model
|
|
||||||
VersionedList<String> checkboxListModel = new VersionedList<>();
|
|
||||||
for (int i = 1; i <= 10; i++) {
|
|
||||||
checkboxListModel.add("Option " + i); // Add items to the list
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a ListBox with the "glass" style and the model
|
|
||||||
ListBox<String> checkboxListBox = new ListBox<>(checkboxListModel, "glass");
|
|
||||||
checkboxListBox.setPreferredSize(new Vector3f(300, 200, 0)); // Adjust size as needed
|
|
||||||
|
|
||||||
// Add the ListBox to the middle container
|
|
||||||
middleContainer.addChild(checkboxListBox);
|
|
||||||
|
|
||||||
// If you need separate checkboxes (optional), render them separately
|
|
||||||
for (String option : checkboxListModel) {
|
|
||||||
Checkbox checkbox = new Checkbox(option);
|
|
||||||
checkbox.setFontSize(16); // Optional: adjust font size
|
|
||||||
middleContainer.addChild(checkbox); // Add it to the middle container
|
|
||||||
}
|
|
||||||
// Add the ListBox to the middle container
|
|
||||||
middleContainer.addChild(checkboxListBox); */
|
|
||||||
|
|
||||||
// Create a VersionedList for the ListBox model
|
// Create a VersionedList for the ListBox model
|
||||||
VersionedList<BuildingProperty> listModel = new VersionedList<>();
|
VersionedList<BuildingProperty> listModel = new VersionedList<>();
|
||||||
|
|
||||||
// Retrieve current player and their properties
|
// Retrieve current player and their properties
|
||||||
Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayers().get(0);
|
Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId());
|
||||||
BoardManager boardManager = app.getGameLogic().getBoardManager();
|
BoardManager boardManager = app.getGameLogic().getBoardManager();
|
||||||
|
|
||||||
List<BuildingProperty> playerProperties = boardManager.getPropertyFields(
|
List<BuildingProperty> playerProperties = boardManager.getPropertyFields(
|
||||||
@ -129,14 +106,14 @@ public class SellHouse extends Dialog {
|
|||||||
downContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
downContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
// Beenden-Button
|
// Beenden-Button
|
||||||
Button cancelButton = sellhouseContainer.addChild(new Button("Abbrechen", new ElementId("button"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
Button cancelButton = sellhouseContainer.addChild(new Button("Abbrechen", new ElementId("button")));
|
||||||
cancelButton.setFontSize(32);
|
cancelButton.setFontSize(32);
|
||||||
cancelButton.addClickCommands(s -> ifTopDialog(() -> {
|
cancelButton.addClickCommands(s -> ifTopDialog(() -> {
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
close();
|
close();
|
||||||
}));
|
}));
|
||||||
// Kaufen-Button
|
// Kaufen-Button
|
||||||
Button confirmButton = sellhouseContainer.addChild(new Button("Bestätigen", new ElementId("button"))); //TODO ggf die Buttons Sprachabhängig von den Properties machen
|
Button confirmButton = sellhouseContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||||
confirmButton.setFontSize(32);
|
confirmButton.setFontSize(32);
|
||||||
confirmButton.addClickCommands(s -> ifTopDialog( () -> {
|
confirmButton.addClickCommands(s -> ifTopDialog( () -> {
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
@ -148,19 +125,14 @@ public class SellHouse extends Dialog {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
|
||||||
float padding = 10; // Padding around the settingsContainer for the background
|
|
||||||
backgroundContainer.setPreferredSize(sellhouseContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Menü
|
|
||||||
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,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 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,
|
||||||
|
@ -52,7 +52,7 @@ public class TimeOut extends Dialog {
|
|||||||
backgroundContainer.setPreferredSize(timeOutContainer.getPreferredSize().addLocal(padding, padding, 0));
|
backgroundContainer.setPreferredSize(timeOutContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
// Titel
|
// 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.setFontSize(48);
|
||||||
gateFieldTitle.setColor(ColorRGBA.Black);
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
@ -68,14 +68,14 @@ public class TimeOut extends Dialog {
|
|||||||
quitButton.addClickCommands(source -> close());
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
|
|
||||||
// Zentriere den Container
|
// Zentriere das Popup
|
||||||
timeOutContainer.setLocalTranslation(
|
timeOutContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - timeOutContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - timeOutContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + timeOutContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + timeOutContainer.getPreferredSize().y) / 2,
|
||||||
8
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere den Container
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - timeOutContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - timeOutContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + timeOutContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + timeOutContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
@ -269,6 +269,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
|||||||
@Override
|
@Override
|
||||||
public void received(PlayerStatusUpdate msg) {
|
public void received(PlayerStatusUpdate msg) {
|
||||||
playerHandler = msg.getPlayerHandler();
|
playerHandler = msg.getPlayerHandler();
|
||||||
|
System.out.println("Update Player");
|
||||||
notifyListeners(new UpdatePlayerView());
|
notifyListeners(new UpdatePlayerView());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +152,7 @@ public class ServerGameLogic implements ClientInterpreter {
|
|||||||
System.out.println("Properties:" +player.getProperties().toString());
|
System.out.println("Properties:" +player.getProperties().toString());
|
||||||
LOGGER.log(Level.INFO, "Player {0} bought property {1}", player.getName(), property.getName());
|
LOGGER.log(Level.INFO, "Player {0} bought property {1}", player.getName(), property.getName());
|
||||||
}
|
}
|
||||||
|
updateAllPlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,6 +174,7 @@ public class ServerGameLogic implements ClientInterpreter {
|
|||||||
send(player, new PlayerStatusUpdate(playerHandler));
|
send(player, new PlayerStatusUpdate(playerHandler));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateAllPlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -218,6 +220,7 @@ public class ServerGameLogic implements ClientInterpreter {
|
|||||||
if (player != null) {
|
if (player != null) {
|
||||||
send(player, player.rollDice());
|
send(player, player.rollDice());
|
||||||
}
|
}
|
||||||
|
updateAllPlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -266,11 +269,15 @@ public class ServerGameLogic implements ClientInterpreter {
|
|||||||
if (sender != null) {
|
if (sender != null) {
|
||||||
LOGGER.log(Level.DEBUG, "Processing ViewAssetsRequest for player {0}", sender.getName());
|
LOGGER.log(Level.DEBUG, "Processing ViewAssetsRequest for player {0}", sender.getName());
|
||||||
send(sender, new ViewAssetsResponse(boardManager));
|
send(sender, new ViewAssetsResponse(boardManager));
|
||||||
|
updateAllPlayers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateAllPlayers() {
|
||||||
for (Player player : playerHandler.getPlayers()) {
|
for (Player player : playerHandler.getPlayers()) {
|
||||||
send(player, new PlayerStatusUpdate(playerHandler));
|
send(player, new PlayerStatusUpdate(playerHandler));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the board manager, which manages the game board.
|
* Retrieves the board manager, which manages the game board.
|
||||||
|
Loading…
Reference in New Issue
Block a user