mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 04:56:15 +01:00
Merge remote-tracking branch 'origin/gui' into gui
This commit is contained in:
commit
79c96677bd
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user