Show upload skin button for microsoft account

close #1328
This commit is contained in:
Glavo
2022-03-02 00:36:49 +08:00
committed by Yuhui Huang
parent 8b1808fa2e
commit 3334371ae3

View File

@@ -34,6 +34,7 @@ import org.jackhuang.hmcl.auth.AuthenticationException;
import org.jackhuang.hmcl.auth.CredentialExpiredException;
import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount;
import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorServer;
import org.jackhuang.hmcl.auth.microsoft.MicrosoftAccount;
import org.jackhuang.hmcl.auth.offline.OfflineAccount;
import org.jackhuang.hmcl.auth.yggdrasil.CompleteGameProfile;
import org.jackhuang.hmcl.auth.yggdrasil.TextureType;
@@ -44,6 +45,7 @@ import org.jackhuang.hmcl.task.Schedulers;
import org.jackhuang.hmcl.task.Task;
import org.jackhuang.hmcl.ui.Controllers;
import org.jackhuang.hmcl.ui.DialogController;
import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.ui.construct.MessageDialogPane.MessageType;
import org.jackhuang.hmcl.util.skin.InvalidSkinException;
import org.jackhuang.hmcl.util.skin.NormalizedSkin;
@@ -137,7 +139,7 @@ public class AccountListItem extends RadioButton {
} else {
return createBooleanBinding(() -> true);
}
} else if (account instanceof OfflineAccount) {
} else if (account instanceof OfflineAccount || account instanceof MicrosoftAccount) {
return createBooleanBinding(() -> true);
} else {
return createBooleanBinding(() -> false);
@@ -153,6 +155,10 @@ public class AccountListItem extends RadioButton {
Controllers.dialog(new OfflineAccountSkinPane((OfflineAccount) account));
return null;
}
if (account instanceof MicrosoftAccount) {
FXUtils.openLink("https://www.minecraft.net/profile/skin");
return null;
}
if (!(account instanceof YggdrasilAccount)) {
return null;
}