fix: slight improvments

This commit is contained in:
Laureηt 2021-04-16 13:48:57 +02:00
parent 91008f575b
commit 0355d98baf

View file

@ -24,18 +24,19 @@ public class SettingsScreen extends BaseScreen {
VisTable table = new VisTable(true); VisTable table = new VisTable(true);
table.setFillParent(true); table.setFillParent(true);
mainStage.addActor(table); mainStage.addActor(table);
VisLabel errorLabel = new VisLabel(); VisLabel errorLabel = new VisLabel();
errorLabel.setColor(Color.RED); errorLabel.setColor(Color.RED);
VisValidatableTextField gConstField = new VisValidatableTextField(); VisValidatableTextField gConstField = new VisValidatableTextField();
gConstField.setText(Float.toString(GameScreen.G));
VisTextButton saveButton = new VisTextButton("Save"); VisTextButton saveButton = new VisTextButton("Save");
saveButton.addListener(new ActorGestureListener() { saveButton.addListener(new ActorGestureListener() {
@Override @Override
public void tap(InputEvent event, float x, float y, int count, int button) { public void tap(InputEvent event, float x, float y, int count, int button) {
super.tap(event, x, y, count, button); super.tap(event, x, y, count, button);
GameScreen.G = Float.parseFloat(gConstField.getText()); GameScreen.G = Float.parseFloat(gConstField.getText());
} }
@ -62,9 +63,9 @@ public class SettingsScreen extends BaseScreen {
table.add(new VisLabel("G constant:")); table.add(new VisLabel("G constant:"));
table.add(gConstField); table.add(gConstField);
table.row(); table.row();
table.add(saveButton); table.add(saveButton).colspan(2);
table.row(); table.row();
table.add(returnButton); table.add(returnButton).colspan(2);
} }
@Override @Override