Don't allow empty game name
@@ -158,6 +158,9 @@ public String get() {
});
WidgetUtil.trySubscribe(this, "play", button -> {
+ if(gameName.getText().isEmpty()) {
+ getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Error", "Game name cannot be empty");
+ } else {
GameManifest gameManifest = new GameManifest();
gameManifest.setTitle(gameName.getText());
@@ -183,6 +186,7 @@ public String get() {
(long) (WorldTime.DAY_LENGTH * timeOffset), uri);
gameManifest.addWorld(worldInfo);
gameEngine.changeState(new StateLoading(gameManifest, (isLoadingAsServer()) ? NetworkMode.DEDICATED_SERVER : NetworkMode.NONE));
+ }
});
WidgetUtil.trySubscribe(this, "close", button ->
