feat: show account creation dialog when no account exists at launching game.

This commit is contained in:
huanghongxun committed 2021-09-03 03:18:33 +08:00
1 parent 981127c355
commit 57bb719cb8
2 files changed
+5 -1

No files matched your search

@@ -218,6 +218,10 @@ public class RootPage extends DecoratorTabPage {
if (checkedAccont)
return;
checkedAccont = true;
checkAccountForcibly();
}
public void checkAccountForcibly() {
if (Accounts.getAccounts().isEmpty())
Platform.runLater(this::addNewAccount);
}
@@ -215,7 +215,7 @@ public final class Versions {
private static boolean checkForLaunching(Profile profile, String id) {
if (Accounts.getSelectedAccount() == null)
Controllers.getRootPage().checkAccount();
Controllers.getRootPage().checkAccountForcibly();
else if (id == null || !profile.getRepository().isLoaded() || !profile.getRepository().hasVersion(id))
Controllers.dialog(i18n("version.empty.launch"), i18n("launch.failed"), MessageDialogPane.MessageType.ERROR, () -> {
Controllers.navigate(Controllers.getGameListPage());