mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 04:56:15 +01:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
commit
f3ec17b0b1
@ -280,15 +280,11 @@ 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 LooserPopUp(this);
|
Dialog tmp = new NoMoneyWarning(this);
|
||||||
tmp.open();
|
tmp.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes and attaches the necessary application states for the game.
|
* Initializes and attaches the necessary application states for the game.
|
||||||
*/
|
*/
|
||||||
|
@ -12,12 +12,17 @@ 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");
|
||||||
@ -81,6 +86,7 @@ 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);
|
||||||
|
|
||||||
@ -88,7 +94,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);
|
||||||
this.close();
|
close();
|
||||||
}));
|
}));
|
||||||
overviewColumn.addChild(backButton);
|
overviewColumn.addChild(backButton);
|
||||||
|
|
||||||
@ -103,6 +109,7 @@ 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);
|
||||||
|
|
||||||
@ -110,6 +117,7 @@ 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);
|
||||||
|
|
||||||
@ -124,6 +132,7 @@ 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);
|
||||||
|
|
||||||
@ -131,6 +140,7 @@ 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);
|
||||||
|
|
||||||
@ -145,7 +155,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());
|
||||||
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);
|
||||||
@ -161,6 +171,13 @@ 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();
|
||||||
|
@ -95,8 +95,14 @@ 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());
|
||||||
|
|
||||||
// Iterate through the player's properties
|
// Fetch the player's properties using their indices
|
||||||
for (PropertyField property : currentPlayer.getPropertyFields()) {
|
List<PropertyField> 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) {
|
if (property instanceof BuildingProperty) {
|
||||||
BuildingProperty building = (BuildingProperty) property;
|
BuildingProperty building = (BuildingProperty) property;
|
||||||
cards.add(createBuildingCard(building));
|
cards.add(createBuildingCard(building));
|
||||||
|
@ -0,0 +1,120 @@
|
|||||||
|
package pp.monopoly.client.gui.popups;
|
||||||
|
|
||||||
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.material.RenderState.BlendMode;
|
||||||
|
import com.jme3.math.ColorRGBA;
|
||||||
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.scene.Geometry;
|
||||||
|
import com.jme3.scene.shape.Quad;
|
||||||
|
import com.simsilica.lemur.Button;
|
||||||
|
import com.simsilica.lemur.Container;
|
||||||
|
import com.simsilica.lemur.Label;
|
||||||
|
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||||
|
import com.simsilica.lemur.style.ElementId;
|
||||||
|
import pp.dialog.Dialog;
|
||||||
|
import pp.monopoly.client.MonopolyApp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn
|
||||||
|
*/
|
||||||
|
public class AcceptTrade extends Dialog {
|
||||||
|
private final MonopolyApp app;
|
||||||
|
private final Geometry overlayBackground;
|
||||||
|
private final Container noMoneyWarningContainer;
|
||||||
|
private final Container backgroundContainer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public AcceptTrade(MonopolyApp app) {
|
||||||
|
super(app.getDialogManager());
|
||||||
|
this.app = app;
|
||||||
|
|
||||||
|
|
||||||
|
// Halbtransparentes Overlay hinzufügen
|
||||||
|
overlayBackground = createOverlayBackground();
|
||||||
|
app.getGuiNode().attachChild(overlayBackground);
|
||||||
|
|
||||||
|
// Create the background container
|
||||||
|
backgroundContainer = new Container();
|
||||||
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
|
app.getGuiNode().attachChild(backgroundContainer);
|
||||||
|
|
||||||
|
|
||||||
|
// Hauptcontainer für die Warnung
|
||||||
|
noMoneyWarningContainer = new Container();
|
||||||
|
noMoneyWarningContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
|
noMoneyWarningContainer.setPreferredSize(new Vector3f(550,250,10));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des bankruptContainers an
|
||||||
|
backgroundContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
// Titel
|
||||||
|
Label gateFieldTitle = noMoneyWarningContainer.addChild(new Label("Handel angenommen!", new ElementId("warning-title")));
|
||||||
|
gateFieldTitle.setFontSize(48);
|
||||||
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
// Text, der im Popup steht
|
||||||
|
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
||||||
|
textContainer.addChild(new Label("Du hast Spieler XXX einen Handel vorgeschlagen", new ElementId("label-Text")));
|
||||||
|
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
||||||
|
textContainer.addChild(new Label("Der Handel wurde angenommen", new ElementId("label-Text")));
|
||||||
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
|
// Passt den textContainer an die Größe des bankruptContainers an
|
||||||
|
textContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(-250,-200,0));
|
||||||
|
|
||||||
|
// Beenden-Button
|
||||||
|
Button quitButton = noMoneyWarningContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||||
|
quitButton.setFontSize(32);
|
||||||
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
noMoneyWarningContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y) / 2,
|
||||||
|
8
|
||||||
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
backgroundContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x - padding) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
7
|
||||||
|
);
|
||||||
|
|
||||||
|
app.getGuiNode().attachChild(noMoneyWarningContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt einen halbtransparenten Hintergrund für das Menü.
|
||||||
|
*
|
||||||
|
* @return Geometrie des Overlays
|
||||||
|
*/
|
||||||
|
private Geometry createOverlayBackground() {
|
||||||
|
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
|
||||||
|
Geometry overlay = new Geometry("Overlay", quad);
|
||||||
|
Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
|
||||||
|
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
||||||
|
overlay.setMaterial(material);
|
||||||
|
overlay.setLocalTranslation(0, 0, 0);
|
||||||
|
return overlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the menu and removes the GUI elements.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
app.getGuiNode().detachChild(noMoneyWarningContainer); // Entferne das Menü
|
||||||
|
app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
|
||||||
|
app.getGuiNode().detachChild(overlayBackground); // Entferne das Overlay
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void escape() {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,7 @@ public class BuyCard extends Dialog {
|
|||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
//Generate the corresponfing field
|
//Generate the corresponding field
|
||||||
int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID();
|
int index = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID();
|
||||||
BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
BuildingProperty field = (BuildingProperty) new BoardManager().getFieldAtIndex(index);
|
||||||
|
|
||||||
@ -84,14 +84,14 @@ public class BuyCard extends Dialog {
|
|||||||
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
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere das Popup
|
// 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,
|
||||||
7
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(buyCardContainer);
|
app.getGuiNode().attachChild(buyCardContainer);
|
||||||
|
@ -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,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(buyHouseContainer);
|
app.getGuiNode().attachChild(buyHouseContainer);
|
||||||
|
@ -0,0 +1,118 @@
|
|||||||
|
package pp.monopoly.client.gui.popups;
|
||||||
|
|
||||||
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.material.RenderState.BlendMode;
|
||||||
|
import com.jme3.math.ColorRGBA;
|
||||||
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.scene.Geometry;
|
||||||
|
import com.jme3.scene.shape.Quad;
|
||||||
|
import com.simsilica.lemur.Button;
|
||||||
|
import com.simsilica.lemur.Container;
|
||||||
|
import com.simsilica.lemur.Label;
|
||||||
|
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||||
|
import com.simsilica.lemur.style.ElementId;
|
||||||
|
import pp.dialog.Dialog;
|
||||||
|
import pp.monopoly.client.MonopolyApp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn
|
||||||
|
*/
|
||||||
|
public class NoMoneyWarning extends Dialog {
|
||||||
|
private final MonopolyApp app;
|
||||||
|
private final Geometry overlayBackground;
|
||||||
|
private final Container noMoneyWarningContainer;
|
||||||
|
private final Container backgroundContainer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public NoMoneyWarning(MonopolyApp app) {
|
||||||
|
super(app.getDialogManager());
|
||||||
|
this.app = app;
|
||||||
|
|
||||||
|
|
||||||
|
// Halbtransparentes Overlay hinzufügen
|
||||||
|
overlayBackground = createOverlayBackground();
|
||||||
|
app.getGuiNode().attachChild(overlayBackground);
|
||||||
|
|
||||||
|
// Create the background container
|
||||||
|
backgroundContainer = new Container();
|
||||||
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
|
app.getGuiNode().attachChild(backgroundContainer);
|
||||||
|
|
||||||
|
|
||||||
|
// Hauptcontainer für die Warnung
|
||||||
|
noMoneyWarningContainer = new Container();
|
||||||
|
noMoneyWarningContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
|
noMoneyWarningContainer.setPreferredSize(new Vector3f(550,250,10));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des bankruptContainers an
|
||||||
|
backgroundContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
// Titel
|
||||||
|
Label gateFieldTitle = noMoneyWarningContainer.addChild(new Label("Na, schon wieder Pleite?", new ElementId("warning-title")));
|
||||||
|
gateFieldTitle.setFontSize(38);
|
||||||
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
// Text, der im Popup steht
|
||||||
|
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
||||||
|
textContainer.addChild(new Label("Du hast nicht genug Geld, um dieses Gebäude zu kaufen", new ElementId("label-Text")));
|
||||||
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
|
// Passt den textContainer an die Größe des bankruptContainers an
|
||||||
|
textContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(-250,-200,0));
|
||||||
|
|
||||||
|
// Beenden-Button
|
||||||
|
Button quitButton = noMoneyWarningContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||||
|
quitButton.setFontSize(32);
|
||||||
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
noMoneyWarningContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y) / 2,
|
||||||
|
8
|
||||||
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
backgroundContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x - padding) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
7
|
||||||
|
);
|
||||||
|
|
||||||
|
app.getGuiNode().attachChild(noMoneyWarningContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt einen halbtransparenten Hintergrund für das Menü.
|
||||||
|
*
|
||||||
|
* @return Geometrie des Overlays
|
||||||
|
*/
|
||||||
|
private Geometry createOverlayBackground() {
|
||||||
|
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
|
||||||
|
Geometry overlay = new Geometry("Overlay", quad);
|
||||||
|
Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
|
||||||
|
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
||||||
|
overlay.setMaterial(material);
|
||||||
|
overlay.setLocalTranslation(0, 0, 0);
|
||||||
|
return overlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the menu and removes the GUI elements.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
app.getGuiNode().detachChild(noMoneyWarningContainer); // Entferne das Menü
|
||||||
|
app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
|
||||||
|
app.getGuiNode().detachChild(overlayBackground); // Entferne das Overlay
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void escape() {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
package pp.monopoly.client.gui.popups;
|
||||||
|
|
||||||
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.material.RenderState.BlendMode;
|
||||||
|
import com.jme3.math.ColorRGBA;
|
||||||
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.scene.Geometry;
|
||||||
|
import com.jme3.scene.shape.Quad;
|
||||||
|
import com.simsilica.lemur.Button;
|
||||||
|
import com.simsilica.lemur.Container;
|
||||||
|
import com.simsilica.lemur.Label;
|
||||||
|
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||||
|
import com.simsilica.lemur.style.ElementId;
|
||||||
|
import pp.dialog.Dialog;
|
||||||
|
import pp.monopoly.client.MonopolyApp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bankrupt is a Warning-Popup which appears when the balance is negative at the end of a player´s turn
|
||||||
|
*/
|
||||||
|
public class RejectTrade extends Dialog {
|
||||||
|
private final MonopolyApp app;
|
||||||
|
private final Geometry overlayBackground;
|
||||||
|
private final Container noMoneyWarningContainer;
|
||||||
|
private final Container backgroundContainer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public RejectTrade(MonopolyApp app) {
|
||||||
|
super(app.getDialogManager());
|
||||||
|
this.app = app;
|
||||||
|
|
||||||
|
|
||||||
|
// Halbtransparentes Overlay hinzufügen
|
||||||
|
overlayBackground = createOverlayBackground();
|
||||||
|
app.getGuiNode().attachChild(overlayBackground);
|
||||||
|
|
||||||
|
// Create the background container
|
||||||
|
backgroundContainer = new Container();
|
||||||
|
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
||||||
|
app.getGuiNode().attachChild(backgroundContainer);
|
||||||
|
|
||||||
|
|
||||||
|
// Hauptcontainer für die Warnung
|
||||||
|
noMoneyWarningContainer = new Container();
|
||||||
|
noMoneyWarningContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
|
||||||
|
noMoneyWarningContainer.setPreferredSize(new Vector3f(550,250,10));
|
||||||
|
|
||||||
|
float padding = 10; // Passt den backgroundContainer an die Größe des bankruptContainers an
|
||||||
|
backgroundContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
|
||||||
|
// Titel
|
||||||
|
Label gateFieldTitle = noMoneyWarningContainer.addChild(new Label("Handel abgelehnt!", new ElementId("warning-title")));
|
||||||
|
gateFieldTitle.setFontSize(48);
|
||||||
|
gateFieldTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
// Text, der im Popup steht
|
||||||
|
Container textContainer = noMoneyWarningContainer.addChild(new Container());
|
||||||
|
textContainer.addChild(new Label("Du hast Spieler XXX einen Handel vorgeschlagen", new ElementId("label-Text")));
|
||||||
|
textContainer.addChild(new Label("", new ElementId("label-Text")));
|
||||||
|
textContainer.addChild(new Label("Der Handel wurde abgelehnt", new ElementId("label-Text")));
|
||||||
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
|
// Passt den textContainer an die Größe des bankruptContainers an
|
||||||
|
textContainer.setPreferredSize(noMoneyWarningContainer.getPreferredSize().addLocal(-250,-200,0));
|
||||||
|
|
||||||
|
// Beenden-Button
|
||||||
|
Button quitButton = noMoneyWarningContainer.addChild(new Button("Bestätigen", new ElementId("button")));
|
||||||
|
quitButton.setFontSize(32);
|
||||||
|
quitButton.addClickCommands(source -> close());
|
||||||
|
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
noMoneyWarningContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y) / 2,
|
||||||
|
8
|
||||||
|
);
|
||||||
|
|
||||||
|
// Zentriere das Popup
|
||||||
|
backgroundContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - noMoneyWarningContainer.getPreferredSize().x - padding) / 2,
|
||||||
|
(app.getCamera().getHeight() + noMoneyWarningContainer.getPreferredSize().y+ padding) / 2,
|
||||||
|
7
|
||||||
|
);
|
||||||
|
|
||||||
|
app.getGuiNode().attachChild(noMoneyWarningContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt einen halbtransparenten Hintergrund für das Menü.
|
||||||
|
*
|
||||||
|
* @return Geometrie des Overlays
|
||||||
|
*/
|
||||||
|
private Geometry createOverlayBackground() {
|
||||||
|
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
|
||||||
|
Geometry overlay = new Geometry("Overlay", quad);
|
||||||
|
Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
|
||||||
|
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
||||||
|
overlay.setMaterial(material);
|
||||||
|
overlay.setLocalTranslation(0, 0, 0);
|
||||||
|
return overlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the menu and removes the GUI elements.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
app.getGuiNode().detachChild(noMoneyWarningContainer); // Entferne das Menü
|
||||||
|
app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
|
||||||
|
app.getGuiNode().detachChild(overlayBackground); // Entferne das Overlay
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void escape() {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
@ -16,7 +16,7 @@ import pp.monopoly.client.MonopolyApp;
|
|||||||
import pp.monopoly.notification.Sound;
|
import pp.monopoly.notification.Sound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rent is a popup that is triggered when a player enters a field that does not belong himself and is owned by another player
|
* Rent popup is triggered when a player enters a field owned by another player and needs to pay rent.
|
||||||
*/
|
*/
|
||||||
public class Rent extends Dialog {
|
public class Rent extends Dialog {
|
||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
@ -28,93 +28,122 @@ public class Rent extends Dialog {
|
|||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
// Halbtransparentes Overlay hinzufügen
|
// Create the overlay
|
||||||
overlayBackground = createOverlayBackground();
|
overlayBackground = createOverlayBackground();
|
||||||
app.getGuiNode().attachChild(overlayBackground);
|
app.getGuiNode().attachChild(overlayBackground);
|
||||||
|
|
||||||
// Create the background container
|
// Create and position the background container
|
||||||
backgroundContainer = new Container();
|
backgroundContainer = createBackgroundContainer();
|
||||||
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Darker background
|
|
||||||
app.getGuiNode().attachChild(backgroundContainer);
|
app.getGuiNode().attachChild(backgroundContainer);
|
||||||
|
|
||||||
|
// Create and position the rent container
|
||||||
|
rentContainer = createRentContainer(playerName, amount);
|
||||||
// Hauptcontainer für die Warnung
|
|
||||||
rentContainer = new Container();
|
|
||||||
rentContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Gray));
|
|
||||||
rentContainer.setPreferredSize(new Vector3f(550,250,10));
|
|
||||||
|
|
||||||
float padding = 10; // Passt den backgroundContainer an die Größe des bankruptContainers an
|
|
||||||
backgroundContainer.setPreferredSize(rentContainer.getPreferredSize().addLocal(padding, padding, 0));
|
|
||||||
|
|
||||||
// Titel
|
|
||||||
Label gateFieldTitle = rentContainer.addChild(new Label( "Miete !", new ElementId("label-Bold")));
|
|
||||||
gateFieldTitle.setFontSize(48);
|
|
||||||
gateFieldTitle.setColor(ColorRGBA.Black);
|
|
||||||
|
|
||||||
// Text, der auf der Karte steht
|
|
||||||
Container textContainer = rentContainer.addChild(new Container());
|
|
||||||
textContainer.addChild(new Label("Du must Spieler "+ playerName + " "+ amount+" EUR Miete zahlen", new ElementId("label-Text")));
|
|
||||||
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
|
||||||
textContainer.setPreferredSize(rentContainer.getPreferredSize().addLocal(-250,-200,0));
|
|
||||||
|
|
||||||
// Beenden-Button
|
|
||||||
Button quitButton = rentContainer.addChild(new Button("Überweisen", new ElementId("button")));
|
|
||||||
quitButton.addClickCommands(s -> ifTopDialog(() -> {
|
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
|
||||||
close();
|
|
||||||
}));
|
|
||||||
quitButton.setFontSize(32);
|
|
||||||
quitButton.addClickCommands(source -> close());
|
|
||||||
|
|
||||||
|
|
||||||
// Zentriere das Popup
|
|
||||||
rentContainer.setLocalTranslation(
|
|
||||||
(app.getCamera().getWidth() - rentContainer.getPreferredSize().x) / 2,
|
|
||||||
(app.getCamera().getHeight() + rentContainer.getPreferredSize().y) / 2,
|
|
||||||
10
|
|
||||||
);
|
|
||||||
|
|
||||||
// Zentriere das Popup
|
|
||||||
backgroundContainer.setLocalTranslation(
|
|
||||||
(app.getCamera().getWidth() - rentContainer.getPreferredSize().x - padding) / 2,
|
|
||||||
(app.getCamera().getHeight() + rentContainer.getPreferredSize().y+ padding) / 2,
|
|
||||||
10
|
|
||||||
);
|
|
||||||
|
|
||||||
app.getGuiNode().attachChild(rentContainer);
|
app.getGuiNode().attachChild(rentContainer);
|
||||||
|
|
||||||
|
centerContainers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erstellt einen halbtransparenten Hintergrund für das Menü.
|
* Creates a semi-transparent overlay background.
|
||||||
*
|
*
|
||||||
* @return Geometrie des Overlays
|
* @return the overlay geometry
|
||||||
*/
|
*/
|
||||||
private Geometry createOverlayBackground() {
|
private Geometry createOverlayBackground() {
|
||||||
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
|
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight());
|
||||||
Geometry overlay = new Geometry("Overlay", quad);
|
Geometry overlay = new Geometry("Overlay", quad);
|
||||||
Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Halbtransparent
|
material.setColor("Color", new ColorRGBA(0, 0, 0, 0.5f)); // Semi-transparent black
|
||||||
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
||||||
overlay.setMaterial(material);
|
overlay.setMaterial(material);
|
||||||
overlay.setLocalTranslation(0, 0, 10);
|
overlay.setLocalTranslation(0, 0, 0);
|
||||||
return overlay;
|
return overlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schließt das Menü und entfernt die GUI-Elemente.
|
* Creates the background container with styling.
|
||||||
|
*
|
||||||
|
* @return the styled background container
|
||||||
|
*/
|
||||||
|
private Container createBackgroundContainer() {
|
||||||
|
Container container = new Container();
|
||||||
|
container.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the main rent container with title, text, and button.
|
||||||
|
*
|
||||||
|
* @param playerName the name of the player to whom the rent is owed
|
||||||
|
* @param amount the rent amount
|
||||||
|
* @return the rent container
|
||||||
|
*/
|
||||||
|
private Container createRentContainer(String playerName, int amount) {
|
||||||
|
Container container = new Container();
|
||||||
|
container.setBackground(new QuadBackgroundComponent(ColorRGBA.Gray));
|
||||||
|
container.setPreferredSize(new Vector3f(550, 250, 10));
|
||||||
|
|
||||||
|
// Title
|
||||||
|
Label title = container.addChild(new Label("Miete!", new ElementId("label-Bold")));
|
||||||
|
title.setFontSize(48);
|
||||||
|
title.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
// Rent message
|
||||||
|
Container textContainer = container.addChild(new Container());
|
||||||
|
textContainer.addChild(new Label("Du musst Spieler " + playerName + " " + amount + " EUR Miete zahlen",
|
||||||
|
new ElementId("label-Text")));
|
||||||
|
textContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
textContainer.setPreferredSize(container.getPreferredSize().addLocal(-250, -200, 0));
|
||||||
|
|
||||||
|
// Payment button
|
||||||
|
Button payButton = container.addChild(new Button("Überweisen", new ElementId("button")));
|
||||||
|
payButton.setFontSize(32);
|
||||||
|
payButton.addClickCommands(s -> ifTopDialog( () -> {
|
||||||
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
|
close();
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Centers the rent and background containers on the screen.
|
||||||
|
*/
|
||||||
|
private void centerContainers() {
|
||||||
|
float padding = 10;
|
||||||
|
|
||||||
|
// Center rent container
|
||||||
|
rentContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - rentContainer.getPreferredSize().x) / 2,
|
||||||
|
(app.getCamera().getHeight() + rentContainer.getPreferredSize().y) / 2,
|
||||||
|
8
|
||||||
|
);
|
||||||
|
|
||||||
|
// Center background container with padding
|
||||||
|
backgroundContainer.setPreferredSize(rentContainer.getPreferredSize().addLocal(padding, padding, 0));
|
||||||
|
backgroundContainer.setLocalTranslation(
|
||||||
|
(app.getCamera().getWidth() - backgroundContainer.getPreferredSize().x) / 2,
|
||||||
|
(app.getCamera().getHeight() + backgroundContainer.getPreferredSize().y) / 2,
|
||||||
|
7
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the popup and removes GUI elements.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
app.getGuiNode().detachChild(rentContainer);
|
||||||
|
app.getGuiNode().detachChild(backgroundContainer);
|
||||||
|
app.getGuiNode().detachChild(overlayBackground);
|
||||||
super.close();
|
super.close();
|
||||||
app.getGuiNode().detachChild(rentContainer); // Entferne das Menü
|
|
||||||
app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand
|
|
||||||
app.getGuiNode().detachChild(overlayBackground); // Entferne das Overlay
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the escape action to close the dialog.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void escape() {
|
public void escape() {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -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,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(repayMortageContainer);
|
app.getGuiNode().attachChild(repayMortageContainer);
|
||||||
|
@ -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,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(sellhouseContainer);
|
app.getGuiNode().attachChild(sellhouseContainer);
|
||||||
|
@ -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,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(takeMortageContainer);
|
app.getGuiNode().attachChild(takeMortageContainer);
|
||||||
|
Loading…
Reference in New Issue
Block a user