This commit is contained in:
Damien 2021-05-29 12:57:07 +02:00
parent 4268832cb4
commit de480704d7

View file

@ -43,6 +43,14 @@ public class SettingsScreen extends BaseScreen {
SpinnerSounded gConstField = new SpinnerSounded("G constant:", SpinnerSounded gConstField = new SpinnerSounded("G constant:",
new SimpleFloatSpinnerModel(SagittariusGame.G, 1f, 500f, 0.5f, 3)); new SimpleFloatSpinnerModel(SagittariusGame.G, 1f, 500f, 0.5f, 3));
// number players field
SpinnerSounded nbPlayersField = new SpinnerSounded("Number players:",
new SimpleFloatSpinnerModel(SagittariusGame.numberPlayers, 2, 5, 1, 1));
// number players field
SpinnerSounded nbPlanetsField = new SpinnerSounded("Number planets:",
new SimpleFloatSpinnerModel(SagittariusGame.numberPlanets, Integer.parseInt(nbPlayersField.getTextField().getText()), 10, 1, 1));
// dubug mode checkbox // dubug mode checkbox
CheckBoxSounded debugModeBox = new CheckBoxSounded("debug mode"); CheckBoxSounded debugModeBox = new CheckBoxSounded("debug mode");
debugModeBox.setChecked(SagittariusGame.debugMode); debugModeBox.setChecked(SagittariusGame.debugMode);
@ -118,6 +126,8 @@ public class SettingsScreen extends BaseScreen {
super.tap(event, x, y, count, button); super.tap(event, x, y, count, button);
SagittariusGame.G = Float.parseFloat(gConstField.getTextField().getText()); SagittariusGame.G = Float.parseFloat(gConstField.getTextField().getText());
SagittariusGame.numberPlayers = Integer.parseInt(nbPlayersField.getTextField().getText());
SagittariusGame.numberPlanets = Integer.parseInt(nbPlanetsField.getTextField().getText());
SagittariusGame.music SagittariusGame.music
.setVolume(Float.parseFloat(musicVolume.getTextField().getText())); .setVolume(Float.parseFloat(musicVolume.getTextField().getText()));
SagittariusGame.musicVolume = SagittariusGame.musicVolume =
@ -156,6 +166,10 @@ public class SettingsScreen extends BaseScreen {
// Table structure // Table structure
table.add(gConstField).width(250).colspan(2); table.add(gConstField).width(250).colspan(2);
table.row(); table.row();
table.add(nbPlayersField).width(250).colspan(2);
table.row();
table.add(nbPlanetsField).width(250).colspan(2);
table.row();
table.add(disableMusic).align(Align.left).colspan(2); table.add(disableMusic).align(Align.left).colspan(2);
table.row(); table.row();
table.add(musicVolume).width(250).colspan(2); table.add(musicVolume).width(250).colspan(2);