mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 23:59:44 +01:00
Compare commits
6 Commits
44c55ce3a6
...
4a8304ee4f
Author | SHA1 | Date | |
---|---|---|---|
|
4a8304ee4f | ||
|
7fe9604338 | ||
|
7f09a6dae8 | ||
|
270129bc97 | ||
|
62ec6f6bef | ||
|
b24c14900c |
@ -160,17 +160,17 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
||||
//logik zum wechselnden erscheinen und verschwinden beim drücken von B //TODO süäter entfernen
|
||||
private void handleB(boolean isPressed) {
|
||||
if (isPressed) {
|
||||
if (gateField != null && isBuyCardPopupOpen) {
|
||||
if (foodField != null && isBuyCardPopupOpen) {
|
||||
// Schließe das SettingsMenu
|
||||
System.out.println("Schließe BuyCardPopup...");
|
||||
gateField.close();
|
||||
gateField = null;
|
||||
foodField.close();
|
||||
foodField = null;
|
||||
setBuyCardPopupOpen(false);
|
||||
} else {
|
||||
// Öffne das SettingsMenu
|
||||
System.out.println("Öffne BuyCardPopup...");
|
||||
gateField = new GateFieldCard(this);
|
||||
gateField.open();
|
||||
foodField = new FoodFieldCard(this);
|
||||
foodField.open();
|
||||
setBuyCardPopupOpen(true);
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,10 @@ 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;
|
||||
import pp.monopoly.model.fields.FoodField;
|
||||
|
||||
/**
|
||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
||||
@ -21,11 +23,15 @@ public class FoodFieldCard extends Dialog {
|
||||
private final Geometry overlayBackground;
|
||||
private final Container settingsContainer;
|
||||
private final Container backgroundContainer;
|
||||
private int index = 12;
|
||||
|
||||
public FoodFieldCard(MonopolyApp app) {
|
||||
super(app.getDialogManager());
|
||||
this.app = app;
|
||||
|
||||
//Generate the corresponfing field
|
||||
FoodField field = (FoodField) app.getBoardManager().getFieldAtIndex(index);
|
||||
|
||||
// Halbtransparentes Overlay hinzufügen
|
||||
overlayBackground = createOverlayBackground();
|
||||
app.getGuiNode().attachChild(overlayBackground);
|
||||
@ -42,18 +48,18 @@ public class FoodFieldCard extends Dialog {
|
||||
|
||||
|
||||
// Titel
|
||||
Label settingsTitle = settingsContainer.addChild(new Label("Gebäude 30", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
|
||||
Label settingsTitle = settingsContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
||||
settingsTitle.setFontSize(48);
|
||||
|
||||
int i = 0;
|
||||
int a = 10;
|
||||
int b = -45;
|
||||
|
||||
// Effekt-Sound: Slider und Checkbox
|
||||
Container propertyValuesContainer = settingsContainer.addChild(new Container());
|
||||
propertyValuesContainer.addChild(new Label("„Preis:" + i, new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
propertyValuesContainer.addChild(new Label("„Miete:" + a, new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
propertyValuesContainer.addChild(new Label("„Hypothek:" + b, new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
propertyValuesContainer.addChild(new Label("„Preis: " + field.getPrice() + " EUR", new ElementId("label-Text")));
|
||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text"))); // Leerzeile
|
||||
propertyValuesContainer.addChild(new Label("„Wenn man Besitzer des\n" +field.getName()+" ist, so ist die\nMiete 40-mal so hoch, wie\nAugen auf den zwei Würfeln sind.", new ElementId("label-Text")));
|
||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text"))); // Leerzeile
|
||||
propertyValuesContainer.addChild(new Label("„Wenn man Besitzer beider \nRestaurants ist, so ist die\nMiete 100-mal so hoch, wie\nAugen auf den zwei Würfeln sind.", new ElementId("label-Text")));
|
||||
propertyValuesContainer.addChild(new Label("", new ElementId("label-Text"))); // Leerzeile
|
||||
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)));
|
||||
|
||||
// Beenden-Button
|
||||
@ -113,5 +119,8 @@ public class FoodFieldCard extends Dialog {
|
||||
System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||
import com.simsilica.lemur.style.ElementId;
|
||||
import pp.dialog.Dialog;
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
import pp.monopoly.model.fields.GateField;
|
||||
|
||||
/**
|
||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
||||
@ -21,11 +22,15 @@ public class GateFieldCard extends Dialog {
|
||||
private final Geometry overlayBackground;
|
||||
private final Container settingsContainer;
|
||||
private final Container backgroundContainer;
|
||||
private int index;
|
||||
|
||||
public GateFieldCard(MonopolyApp app) {
|
||||
super(app.getDialogManager());
|
||||
this.app = app;
|
||||
|
||||
//Generate the corresponfing field
|
||||
GateField field = (GateField) app.getBoardManager().getFieldAtIndex(index);
|
||||
|
||||
// Halbtransparentes Overlay hinzufügen
|
||||
overlayBackground = createOverlayBackground();
|
||||
app.getGuiNode().attachChild(overlayBackground);
|
||||
@ -42,16 +47,16 @@ public class GateFieldCard extends Dialog {
|
||||
|
||||
|
||||
// Titel
|
||||
Label settingsTitle = settingsContainer.addChild(new Label("Gebäude 30", new ElementId("settings-title"))); //TODO Dynamische Gebäudezahl einfügen
|
||||
Label settingsTitle = settingsContainer.addChild(new Label(field.getName(), new ElementId("settings-title")));
|
||||
settingsTitle.setFontSize(48);
|
||||
settingsTitle.setColor(ColorRGBA.Black);
|
||||
|
||||
|
||||
// Effekt-Sound: Slider und Checkbox
|
||||
Container propertyValuesContainer = settingsContainer.addChild(new Container());
|
||||
propertyValuesContainer.addChild(new Label("„Preis:", new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
propertyValuesContainer.addChild(new Label("„Preis: " + field.getPrice() + " EUR", new ElementId("label-Text")));
|
||||
propertyValuesContainer.addChild(new Label("„Miete:", new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
propertyValuesContainer.addChild(new Label("„Hypothek:", new ElementId("label-Text")));//TODO Variable hier einsetzen
|
||||
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)));
|
||||
|
||||
// Beenden-Button
|
||||
@ -111,5 +116,7 @@ public class GateFieldCard extends Dialog {
|
||||
System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
|
||||
}
|
||||
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user