fixed toolbar buttons

This commit is contained in:
Yvonne Schmidt 2024-11-25 21:29:54 +01:00
parent 547a4c2353
commit f67810b288
2 changed files with 16 additions and 15 deletions

View File

@ -34,13 +34,13 @@ public class ChoosePartner extends Dialog {
new QuadBackgroundComponent(new ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f)); new QuadBackgroundComponent(new ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f));
menuContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X)); menuContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X));
menuContainer.setPreferredSize(new Vector3f(1000, 600, 0)); // Fixed size of the container menuContainer.setPreferredSize(new Vector3f(1000, 600, 5)); // Fixed size of the container
menuContainer.setBackground(translucentWhiteBackground); menuContainer.setBackground(translucentWhiteBackground);
// Create a smaller horizontal container for the label, input field, and spacers // Create a smaller horizontal container for the label, input field, and spacers
Container horizontalContainer = menuContainer.addChild(new Container(new SpringGridLayout(Axis.X, Axis.Y))); Container horizontalContainer = menuContainer.addChild(new Container(new SpringGridLayout(Axis.X, Axis.Y)));
horizontalContainer.setPreferredSize(new Vector3f(600, 40, 0)); // Adjust container size horizontalContainer.setPreferredSize(new Vector3f(600, 40, 0)); // Adjust container size
horizontalContainer.setBackground(null); horizontalContainer.setBackground(translucentWhiteBackground);
Label title = horizontalContainer.addChild(new Label("Wähle deinen Handelspartner:", new ElementId("label-Bold"))); Label title = horizontalContainer.addChild(new Label("Wähle deinen Handelspartner:", new ElementId("label-Bold")));
title.setFontSize(40); title.setFontSize(40);
@ -57,7 +57,7 @@ public class ChoosePartner extends Dialog {
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, -1); // Hintergrundebene background.setLocalTranslation(0, 0, 4); // Hintergrundebene
app.getGuiNode().attachChild(background); app.getGuiNode().attachChild(background);
} }

View File

@ -165,26 +165,27 @@ public class Toolbar extends Dialog {
return tradebutton; return tradebutton;
} }
private Button addEndTurnButton() {
Button endTurnButton = new Button("Grundstücke");
endTurnButton.setPreferredSize(new Vector3f(150, 50, 0)); // Größe des Buttons
endTurnButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON);
//TODO open property dialog
}));
return endTurnButton;
}
private Button addPropertyMenuButton() { private Button addPropertyMenuButton() {
Button propertyMenuButton = new Button("Zug beenden"); Button propertyMenuButton = new Button("Grundstücke");
propertyMenuButton.setFontSize(30.0f);
propertyMenuButton.setPreferredSize(new Vector3f(150, 50, 0)); // Größe des Buttons propertyMenuButton.setPreferredSize(new Vector3f(150, 50, 0)); // Größe des Buttons
propertyMenuButton.addClickCommands(s -> ifTopDialog(() -> { propertyMenuButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
//TODO send end turn //TODO open property dialog
})); }));
return propertyMenuButton; return propertyMenuButton;
} }
private Button addEndTurnButton() {
Button endTurnButton = new Button("Zug beenden");
endTurnButton.setPreferredSize(new Vector3f(150, 50, 0)); // Größe des Buttons
endTurnButton.addClickCommands(s -> ifTopDialog(() -> {
app.getGameLogic().playSound(Sound.BUTTON);
//TODO send end turn
}));
return endTurnButton;
}
/** /**
* Erstellt die Anzeige für die aktuelle Position. * Erstellt die Anzeige für die aktuelle Position.
* *