mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 06:06: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
4a882bc4ac
@ -31,6 +31,9 @@ public class LobbyMenu {
|
|||||||
private final MonopolyApp app;
|
private final MonopolyApp app;
|
||||||
private final Container menuContainer;
|
private final Container menuContainer;
|
||||||
private Geometry background;
|
private Geometry background;
|
||||||
|
private Geometry circle;
|
||||||
|
private Container lowerLeftMenu;
|
||||||
|
private Container lowerRightMenu;
|
||||||
|
|
||||||
public LobbyMenu(MonopolyApp app) {
|
public LobbyMenu(MonopolyApp app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
@ -61,7 +64,7 @@ public class LobbyMenu {
|
|||||||
spacerBeforeInput.setPreferredSize(new Vector3f(20, 1, 0)); // Width of the spacer
|
spacerBeforeInput.setPreferredSize(new Vector3f(20, 1, 0)); // Width of the spacer
|
||||||
|
|
||||||
// Add an input field (TextField)
|
// Add an input field (TextField)
|
||||||
TextField startingCapital = horizontalContainer.addChild(new TextField(""));
|
TextField startingCapital = horizontalContainer.addChild(new TextField("15 000"));
|
||||||
startingCapital.setPreferredWidth(100); // Set the width of the input field
|
startingCapital.setPreferredWidth(100); // Set the width of the input field
|
||||||
startingCapital.setPreferredSize(new Vector3f(150, 50, 0));
|
startingCapital.setPreferredSize(new Vector3f(150, 50, 0));
|
||||||
startingCapital.setInsets(new Insets3f(5, 10, 5, 10)); // Add padding around the text inside the field
|
startingCapital.setInsets(new Insets3f(5, 10, 5, 10)); // Add padding around the text inside the field
|
||||||
@ -88,7 +91,7 @@ public class LobbyMenu {
|
|||||||
playerInputContainer.setBackground(null);
|
playerInputContainer.setBackground(null);
|
||||||
|
|
||||||
|
|
||||||
TextField playerInputField = new TextField("");
|
TextField playerInputField = new TextField("Spieler 1");
|
||||||
playerInputField.setPreferredSize(new Vector3f(100, 20, 0));
|
playerInputField.setPreferredSize(new Vector3f(100, 20, 0));
|
||||||
playerInputField.setInsets(new Insets3f(5, 10, 5, 10)); // Add padding for the text inside the field
|
playerInputField.setInsets(new Insets3f(5, 10, 5, 10)); // Add padding for the text inside the field
|
||||||
playerInputField.setBackground(new QuadBackgroundComponent(ColorRGBA.Black));
|
playerInputField.setBackground(new QuadBackgroundComponent(ColorRGBA.Black));
|
||||||
@ -103,10 +106,12 @@ public class LobbyMenu {
|
|||||||
figureDropdownContainer.setBackground(null);
|
figureDropdownContainer.setBackground(null);
|
||||||
|
|
||||||
VersionedList<String> figures = new VersionedList<>();
|
VersionedList<String> figures = new VersionedList<>();
|
||||||
figures.add("Hund");
|
figures.add("Laptop");
|
||||||
|
figures.add("Flugzeug");
|
||||||
|
figures.add("Jägermeister");
|
||||||
figures.add("Katze");
|
figures.add("Katze");
|
||||||
figures.add("Panzer");
|
figures.add("OOP");
|
||||||
figures.add("Pot");
|
figures.add("Handyholster");
|
||||||
|
|
||||||
Selector<String> figureDropdown = new Selector<>(figures, "glass");
|
Selector<String> figureDropdown = new Selector<>(figures, "glass");
|
||||||
figureDropdown.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray));
|
figureDropdown.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray));
|
||||||
@ -120,7 +125,7 @@ public class LobbyMenu {
|
|||||||
buttonContainer.setInsets(new Insets3f(20, 0, 10, 0)); // Add spacing above the buttons
|
buttonContainer.setInsets(new Insets3f(20, 0, 10, 0)); // Add spacing above the buttons
|
||||||
buttonContainer.setBackground(null);
|
buttonContainer.setBackground(null);
|
||||||
// Lower-left container for "Abbrechen" button
|
// Lower-left container for "Abbrechen" button
|
||||||
Container lowerLeftMenu = new Container();
|
lowerLeftMenu = new Container();
|
||||||
Button cancelButton = new Button("Abbrechen");
|
Button cancelButton = new Button("Abbrechen");
|
||||||
cancelButton.setPreferredSize(new Vector3f(200, 60, 0)); // Set size to match the appearance in the image
|
cancelButton.setPreferredSize(new Vector3f(200, 60, 0)); // Set size to match the appearance in the image
|
||||||
cancelButton.setFontSize(18); // Adjust font size
|
cancelButton.setFontSize(18); // Adjust font size
|
||||||
@ -132,7 +137,7 @@ public class LobbyMenu {
|
|||||||
app.getGuiNode().attachChild(lowerLeftMenu);
|
app.getGuiNode().attachChild(lowerLeftMenu);
|
||||||
|
|
||||||
// Lower-right container for "Bereit" button
|
// Lower-right container for "Bereit" button
|
||||||
Container lowerRightMenu = new Container();
|
lowerRightMenu = new Container();
|
||||||
Button readyButton = new Button("Bereit");
|
Button readyButton = new Button("Bereit");
|
||||||
readyButton.setPreferredSize(new Vector3f(200, 60, 0)); // Set size to match the appearance in the image
|
readyButton.setPreferredSize(new Vector3f(200, 60, 0)); // Set size to match the appearance in the image
|
||||||
readyButton.setFontSize(18); // Adjust font size
|
readyButton.setFontSize(18); // Adjust font size
|
||||||
@ -145,7 +150,7 @@ public class LobbyMenu {
|
|||||||
app.getGuiNode().attachChild(lowerRightMenu);
|
app.getGuiNode().attachChild(lowerRightMenu);
|
||||||
|
|
||||||
// Add a colored circle between the input field and the dropdown menu
|
// Add a colored circle between the input field and the dropdown menu
|
||||||
Geometry circle = createCircle( ColorRGBA.Red); // 50 is the diameter, Red is the color
|
circle = createCircle( ColorRGBA.Red); // 50 is the diameter, Red is the color
|
||||||
circle.setLocalTranslation(new Vector3f(
|
circle.setLocalTranslation(new Vector3f(
|
||||||
(app.getCamera().getWidth()) / 2, // Center horizontally
|
(app.getCamera().getWidth()) / 2, // Center horizontally
|
||||||
(app.getCamera().getHeight() / 2) - 90, // Adjust Y position
|
(app.getCamera().getHeight() / 2) - 90, // Adjust Y position
|
||||||
@ -205,7 +210,10 @@ public class LobbyMenu {
|
|||||||
*/
|
*/
|
||||||
private void goBackToCreateGame() {
|
private void goBackToCreateGame() {
|
||||||
app.getGuiNode().detachChild(menuContainer);
|
app.getGuiNode().detachChild(menuContainer);
|
||||||
app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild
|
app.getGuiNode().detachChild(background);
|
||||||
|
app.getGuiNode().detachChild(circle);
|
||||||
|
app.getGuiNode().detachChild(lowerLeftMenu);
|
||||||
|
app.getGuiNode().detachChild(lowerRightMenu);
|
||||||
new CreateGameMenu(app);
|
new CreateGameMenu(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user