alt: navigate to game version list when no versions exist
This commit is contained in:
@@ -18,11 +18,9 @@
|
|||||||
package org.jackhuang.hmcl.ui.main;
|
package org.jackhuang.hmcl.ui.main;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.geometry.Insets;
|
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.SkinBase;
|
import javafx.scene.control.SkinBase;
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.StackPane;
|
|
||||||
import org.jackhuang.hmcl.event.EventBus;
|
import org.jackhuang.hmcl.event.EventBus;
|
||||||
import org.jackhuang.hmcl.event.RefreshedVersionsEvent;
|
import org.jackhuang.hmcl.event.RefreshedVersionsEvent;
|
||||||
import org.jackhuang.hmcl.game.HMCLGameRepository;
|
import org.jackhuang.hmcl.game.HMCLGameRepository;
|
||||||
@@ -182,6 +180,26 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
return profileListPage;
|
return profileListPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Tab getMainTab() {
|
||||||
|
return mainTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tab getSettingsTab() {
|
||||||
|
return settingsTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tab getGameTab() {
|
||||||
|
return gameTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tab getAccountTab() {
|
||||||
|
return accountTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tab getProfileTab() {
|
||||||
|
return profileTab;
|
||||||
|
}
|
||||||
|
|
||||||
private static class Skin extends SkinBase<RootPage> {
|
private static class Skin extends SkinBase<RootPage> {
|
||||||
|
|
||||||
protected Skin(RootPage control) {
|
protected Skin(RootPage control) {
|
||||||
|
|||||||
@@ -19,16 +19,17 @@ package org.jackhuang.hmcl.ui.versions;
|
|||||||
|
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import org.jackhuang.hmcl.download.game.GameAssetDownloadTask;
|
import org.jackhuang.hmcl.download.game.GameAssetDownloadTask;
|
||||||
|
import org.jackhuang.hmcl.game.GameDirectoryType;
|
||||||
import org.jackhuang.hmcl.game.GameRepository;
|
import org.jackhuang.hmcl.game.GameRepository;
|
||||||
import org.jackhuang.hmcl.game.LauncherHelper;
|
import org.jackhuang.hmcl.game.LauncherHelper;
|
||||||
import org.jackhuang.hmcl.setting.Accounts;
|
import org.jackhuang.hmcl.setting.Accounts;
|
||||||
import org.jackhuang.hmcl.game.GameDirectoryType;
|
|
||||||
import org.jackhuang.hmcl.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hmcl.task.Schedulers;
|
import org.jackhuang.hmcl.task.Schedulers;
|
||||||
import org.jackhuang.hmcl.task.Task;
|
import org.jackhuang.hmcl.task.Task;
|
||||||
import org.jackhuang.hmcl.task.TaskExecutor;
|
import org.jackhuang.hmcl.task.TaskExecutor;
|
||||||
import org.jackhuang.hmcl.ui.Controllers;
|
import org.jackhuang.hmcl.ui.Controllers;
|
||||||
import org.jackhuang.hmcl.ui.FXUtils;
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
|
import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
|
||||||
import org.jackhuang.hmcl.ui.construct.PromptDialogPane;
|
import org.jackhuang.hmcl.ui.construct.PromptDialogPane;
|
||||||
import org.jackhuang.hmcl.ui.construct.Validator;
|
import org.jackhuang.hmcl.ui.construct.Validator;
|
||||||
import org.jackhuang.hmcl.ui.download.ModpackInstallWizardProvider;
|
import org.jackhuang.hmcl.ui.download.ModpackInstallWizardProvider;
|
||||||
@@ -150,7 +151,9 @@ public class Versions {
|
|||||||
if (Accounts.getSelectedAccount() == null)
|
if (Accounts.getSelectedAccount() == null)
|
||||||
Controllers.getRootPage().checkAccount();
|
Controllers.getRootPage().checkAccount();
|
||||||
else if (id == null || !profile.getRepository().isLoaded() || !profile.getRepository().hasVersion(id))
|
else if (id == null || !profile.getRepository().isLoaded() || !profile.getRepository().hasVersion(id))
|
||||||
Controllers.dialog(i18n("version.empty.launch"));
|
Controllers.dialog(i18n("version.empty.launch"), i18n("launch.failed"), MessageDialogPane.MessageType.ERROR, () -> {
|
||||||
|
Controllers.getRootPage().getSelectionModel().select(Controllers.getRootPage().getGameTab());
|
||||||
|
});
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user