mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 20:29:44 +01:00
dynamically allocate values
This commit is contained in:
parent
b24c14900c
commit
62ec6f6bef
@ -12,6 +12,7 @@ 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.model.fields.GateField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsMenu ist ein Overlay-Menü, das durch ESC aufgerufen werden kann.
|
* 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 Geometry overlayBackground;
|
||||||
private final Container settingsContainer;
|
private final Container settingsContainer;
|
||||||
private final Container backgroundContainer;
|
private final Container backgroundContainer;
|
||||||
|
private int index;
|
||||||
|
|
||||||
public GateFieldCard(MonopolyApp app) {
|
public GateFieldCard(MonopolyApp app) {
|
||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
|
//Generate the corresponfing field
|
||||||
|
GateField field = (GateField) app.getBoardManager().getFieldAtIndex(index);
|
||||||
|
|
||||||
// Halbtransparentes Overlay hinzufügen
|
// Halbtransparentes Overlay hinzufügen
|
||||||
overlayBackground = createOverlayBackground();
|
overlayBackground = createOverlayBackground();
|
||||||
app.getGuiNode().attachChild(overlayBackground);
|
app.getGuiNode().attachChild(overlayBackground);
|
||||||
@ -42,16 +47,16 @@ public class GateFieldCard extends Dialog {
|
|||||||
|
|
||||||
|
|
||||||
// Titel
|
// 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.setFontSize(48);
|
||||||
settingsTitle.setColor(ColorRGBA.Black);
|
settingsTitle.setColor(ColorRGBA.Black);
|
||||||
|
|
||||||
|
|
||||||
// Effekt-Sound: Slider und Checkbox
|
// Effekt-Sound: Slider und Checkbox
|
||||||
Container propertyValuesContainer = settingsContainer.addChild(new Container());
|
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("„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)));
|
propertyValuesContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||||
|
|
||||||
// Beenden-Button
|
// Beenden-Button
|
||||||
@ -111,5 +116,7 @@ public class GateFieldCard extends Dialog {
|
|||||||
System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
|
System.out.println("SettingsMenu geschlossen."); // Debugging-Ausgabe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user