refactor: drop forced authlib account on first run and unofficial-build hint
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b79945391
commit
0f85782312
2 files changed
+1
-24
No files matched your search
@@ -39,7 +39,6 @@ import org.jackhuang.hmcl.ui.Controllers;
|
||||
import org.jackhuang.hmcl.ui.FXUtils;
|
||||
import org.jackhuang.hmcl.ui.SVG;
|
||||
import org.jackhuang.hmcl.ui.construct.*;
|
||||
import org.jackhuang.hmcl.upgrade.IntegrityChecker;
|
||||
import org.jackhuang.hmcl.util.StringUtils;
|
||||
import org.jackhuang.hmcl.util.javafx.BindingMapping;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -340,15 +339,6 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
|
||||
|
||||
int rowIndex = 0;
|
||||
|
||||
if (!IntegrityChecker.isOfficial() && !(factory instanceof OfflineAccountFactory)) {
|
||||
HintPane hintPane = new HintPane(MessageDialogPane.MessageType.WARNING);
|
||||
hintPane.setSegment(i18n("unofficial.hint"));
|
||||
GridPane.setColumnSpan(hintPane, 2);
|
||||
add(hintPane, 0, rowIndex);
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
if (factory instanceof BoundAuthlibInjectorAccountFactory) {
|
||||
this.server = ((BoundAuthlibInjectorAccountFactory) factory).getServer();
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import javafx.application.Platform;
|
||||
import javafx.stage.FileChooser;
|
||||
import org.jackhuang.hmcl.Metadata;
|
||||
import org.jackhuang.hmcl.auth.Account;
|
||||
import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount;
|
||||
import org.jackhuang.hmcl.download.DefaultDependencyManager;
|
||||
import org.jackhuang.hmcl.download.game.GameAssetDownloadTask;
|
||||
import org.jackhuang.hmcl.download.game.GameDownloadTask;
|
||||
@@ -363,19 +362,7 @@ public final class Instances {
|
||||
|
||||
private static void ensureSelectedAccount(Consumer<Account> action) {
|
||||
Account account = Accounts.getSelectedAccount();
|
||||
if (SettingsManager.isNewlyCreated() && !AuthlibInjectorServers.getServers().isEmpty() &&
|
||||
!(account instanceof AuthlibInjectorAccount && AuthlibInjectorServers.getServers().contains(((AuthlibInjectorAccount) account).getServer()))) {
|
||||
CreateAccountPane dialog = new CreateAccountPane(AuthlibInjectorServers.getServers().iterator().next());
|
||||
dialog.addEventHandler(DialogCloseEvent.CLOSE, e -> {
|
||||
Account newAccount = Accounts.getSelectedAccount();
|
||||
if (newAccount == null) {
|
||||
// user cancelled operation
|
||||
} else {
|
||||
Platform.runLater(() -> action.accept(newAccount));
|
||||
}
|
||||
});
|
||||
Controllers.dialog(dialog);
|
||||
} else if (account == null) {
|
||||
if (account == null) {
|
||||
CreateAccountPane dialog = new CreateAccountPane();
|
||||
dialog.addEventHandler(DialogCloseEvent.CLOSE, e -> {
|
||||
Account newAccount = Accounts.getSelectedAccount();
|
||||
|
||||
Reference in new issue
Block a user