mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-29 01:59:42 +01:00
set default value for drop down selection
This commit is contained in:
parent
29cc73e83b
commit
89587a4c78
@ -68,7 +68,7 @@ public class ChoosePartner extends Dialog {
|
|||||||
// Add buttons
|
// Add buttons
|
||||||
mainContainer.addChild(createButtonContainer());
|
mainContainer.addChild(createButtonContainer());
|
||||||
|
|
||||||
addSelectionActionListener(playerSelector, this::onDropdownSelectionChanged);
|
addSelectionActionListener(playerSelector, this::onDropdownSelectionChanged);
|
||||||
|
|
||||||
// Attach main container to GUI node
|
// Attach main container to GUI node
|
||||||
app.getGuiNode().attachChild(mainContainer);
|
app.getGuiNode().attachChild(mainContainer);
|
||||||
@ -104,6 +104,7 @@ public class ChoosePartner extends Dialog {
|
|||||||
dimens2.setX( dimens.getX() );
|
dimens2.setX( dimens.getX() );
|
||||||
playerSelector.getPopupContainer().setPreferredSize(new Vector3f(200,200,3));
|
playerSelector.getPopupContainer().setPreferredSize(new Vector3f(200,200,3));
|
||||||
playerSelector.setLocalTranslation(0,0,5);
|
playerSelector.setLocalTranslation(0,0,5);
|
||||||
|
onDropdownSelectionChanged(playerOptions.get(0));
|
||||||
|
|
||||||
return dropdownContainer;
|
return dropdownContainer;
|
||||||
}
|
}
|
||||||
@ -211,6 +212,7 @@ public class ChoosePartner extends Dialog {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initialize(Application app) {
|
protected void initialize(Application app) {
|
||||||
|
update(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +47,7 @@ public class LobbyMenu extends Dialog {
|
|||||||
super(app.getDialogManager());
|
super(app.getDialogManager());
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
playerInputField = new TextField("Spieler "+app.getId()+1);
|
playerInputField = new TextField("Spieler "+(app.getId()+1));
|
||||||
// Hintergrundbild laden und hinzufügen
|
// Hintergrundbild laden und hinzufügen
|
||||||
addBackgroundImage();
|
addBackgroundImage();
|
||||||
|
|
||||||
@ -120,6 +120,8 @@ public class LobbyMenu extends Dialog {
|
|||||||
figures.add("OOP");
|
figures.add("OOP");
|
||||||
figures.add("Handyholster");
|
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));
|
||||||
figureDropdown.setPreferredSize(new Vector3f(100, 20, 0));
|
figureDropdown.setPreferredSize(new Vector3f(100, 20, 0));
|
||||||
@ -128,7 +130,8 @@ public class LobbyMenu extends Dialog {
|
|||||||
Vector3f dimens2 = figureDropdown.getPopupContainer().getPreferredSize();
|
Vector3f dimens2 = figureDropdown.getPopupContainer().getPreferredSize();
|
||||||
dimens2.setX( dimens.getX() );
|
dimens2.setX( dimens.getX() );
|
||||||
figureDropdown.getPopupContainer().setPreferredSize(new Vector3f(200,200,5));
|
figureDropdown.getPopupContainer().setPreferredSize(new Vector3f(200,200,5));
|
||||||
|
figureDropdown.getSelectionModel().setSelection(0);
|
||||||
|
figure = "Laptop";
|
||||||
|
|
||||||
addSelectionActionListener(figureDropdown, this::onDropdownSelectionChanged);
|
addSelectionActionListener(figureDropdown, this::onDropdownSelectionChanged);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user