Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改微软登录页面 #3192

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -288,41 +288,46 @@ private void initDetailsPane() {
VBox vbox = new VBox(8);
if (!Accounts.OAUTH_CALLBACK.getClientId().isEmpty()) {
HintPane hintPane = new HintPane(MessageDialogPane.MessageType.INFO);
FlowPane box = new FlowPane();
box.setHgap(8);
JFXHyperlink purchaseLink = new JFXHyperlink(i18n("account.methods.microsoft.purchase"));
purchaseLink.setExternalLink(YggdrasilService.PURCHASE_URL);
JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth"));
birthLink.setExternalLink("https://support.microsoft.com/account-billing/837badbc-999e-54d2-2617-d19206b9540a");
JFXHyperlink deauthorizeLink = new JFXHyperlink(i18n("account.methods.microsoft.deauthorize"));
deauthorizeLink.setExternalLink("https://account.live.com/consent/Edit?client_id=000000004C794E0A");
JFXHyperlink loginwithpasswordLink = new JFXHyperlink(i18n("account.methods.login_with_password"));
loginwithpasswordLink.setExternalLink("https://docs.hmcl.net/launcher/use-password-login-microsoft-account.html");
JFXHyperlink createProfileLink = new JFXHyperlink(i18n("account.methods.microsoft.makegameidsettings"));
createProfileLink.setExternalLink("https://www.minecraft.net/msaprofile/mygames/editprofile");
box.getChildren().setAll(purchaseLink, birthLink, deauthorizeLink, loginwithpasswordLink, createProfileLink);
GridPane.setColumnSpan(box, 2);

FXUtils.onChangeAndOperate(deviceCode, deviceCode -> {
if (deviceCode != null) {
FXUtils.copyText(deviceCode.getUserCode());
hintPane.setSegment(i18n("account.methods.microsoft.manual", deviceCode.getUserCode(), deviceCode.getVerificationUri()));
JFXHyperlink qrCodeLoginLink = new JFXHyperlink(i18n("account.methods.qrcodelogin"));
qrCodeLoginLink.setExternalLink("https://docs.hmcl.net/qr-login.html?verificationUri=" + deviceCode.getVerificationUri() + "&userCode=" + deviceCode.getUserCode());
box.getChildren().setAll(purchaseLink, birthLink, deauthorizeLink, loginwithpasswordLink, createProfileLink, qrCodeLoginLink);
if (!IntegrityChecker.isOfficial())
box.getChildren().remove(deauthorizeLink);
} else {
hintPane.setSegment(i18n("account.methods.microsoft.hint"));
}
});
hintPane.setOnMouseClicked(e -> {
if (deviceCode.get() != null) {
FXUtils.openLink(deviceCode.get().getVerificationUri());
FXUtils.copyText(deviceCode.get().getUserCode());
}
});

holder.add(Accounts.OAUTH_CALLBACK.onGrantDeviceCode.registerWeak(value -> {
runInFX(() -> deviceCode.set(value));
}));
FlowPane box = new FlowPane();
box.setHgap(8);
JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth"));
birthLink.setExternalLink("https://support.microsoft.com/account-billing/837badbc-999e-54d2-2617-d19206b9540a");
JFXHyperlink profileLink = new JFXHyperlink(i18n("account.methods.microsoft.profile"));
profileLink.setExternalLink("https://account.live.com/editprof.aspx");
JFXHyperlink purchaseLink = new JFXHyperlink(i18n("account.methods.microsoft.purchase"));
purchaseLink.setExternalLink(YggdrasilService.PURCHASE_URL);
JFXHyperlink deauthorizeLink = new JFXHyperlink(i18n("account.methods.microsoft.deauthorize"));
deauthorizeLink.setExternalLink("https://account.live.com/consent/Edit?client_id=000000004C794E0A");
JFXHyperlink forgotpasswordLink = new JFXHyperlink(i18n("account.methods.forgot_password"));
forgotpasswordLink.setExternalLink("https://www.minecraft.net/password/forgot");
JFXHyperlink createProfileLink = new JFXHyperlink(i18n("account.methods.microsoft.makegameidsettings"));
createProfileLink.setExternalLink("https://www.minecraft.net/msaprofile/mygames/editprofile");
box.getChildren().setAll(profileLink, birthLink, purchaseLink, deauthorizeLink, forgotpasswordLink, createProfileLink);
GridPane.setColumnSpan(box, 2);

if (!IntegrityChecker.isOfficial()) {
box.getChildren().remove(deauthorizeLink);
HintPane unofficialHint = new HintPane(MessageDialogPane.MessageType.WARNING);
unofficialHint.setText(i18n("unofficial.hint"));
vbox.getChildren().add(unofficialHint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ public OAuthAccountLoginDialog(OAuthAccount account, Consumer<AuthInfo> success,
});

HBox box = new HBox(8);
JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth"));
birthLink.setOnAction(e -> FXUtils.openLink("https://support.microsoft.com/account-billing/how-to-change-a-birth-date-on-a-microsoft-account-837badbc-999e-54d2-2617-d19206b9540a"));
JFXHyperlink profileLink = new JFXHyperlink(i18n("account.methods.microsoft.profile"));
profileLink.setOnAction(e -> FXUtils.openLink("https://account.live.com/editprof.aspx"));
JFXHyperlink purchaseLink = new JFXHyperlink(i18n("account.methods.microsoft.purchase"));
purchaseLink.setOnAction(e -> FXUtils.openLink(YggdrasilService.PURCHASE_URL));
box.getChildren().setAll(profileLink, birthLink, purchaseLink);
purchaseLink.setExternalLink(YggdrasilService.PURCHASE_URL);
JFXHyperlink birthLink = new JFXHyperlink(i18n("account.methods.microsoft.birth"));
birthLink.setExternalLink("https://support.microsoft.com/account-billing/837badbc-999e-54d2-2617-d19206b9540a");
JFXHyperlink deauthorizeLink = new JFXHyperlink(i18n("account.methods.microsoft.deauthorize"));
deauthorizeLink.setExternalLink("https://account.live.com/consent/Edit?client_id=000000004C794E0A");
JFXHyperlink loginwithpasswordLink = new JFXHyperlink(i18n("account.methods.login_with_password"));
loginwithpasswordLink.setExternalLink("https://docs.hmcl.net/launcher/use-password-login-microsoft-account.html");
JFXHyperlink createProfileLink = new JFXHyperlink(i18n("account.methods.microsoft.makegameidsettings"));
createProfileLink.setExternalLink("https://www.minecraft.net/msaprofile/mygames/editprofile");
box.getChildren().setAll(purchaseLink, birthLink, deauthorizeLink, loginwithpasswordLink, createProfileLink);
GridPane.setColumnSpan(box, 2);

vbox.getChildren().setAll(usernameLabel, hintPane, box);
Expand Down
16 changes: 5 additions & 11 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,11 @@ account.methods.microsoft.error.country_unavailable=Xbox Live is not available i
account.methods.microsoft.error.missing_xbox_account=Your Microsoft account does not have a linked Xbox account yet. Please create one before continuing.
account.methods.microsoft.error.no_character=Your account does not own the Minecraft Java Edition.\nThe game profile may not have been created,\nplease click the link above to create it.
account.methods.microsoft.error.unknown=Failed to log in, error: %d.
account.methods.microsoft.error.wrong_verify_method=Please log in using your account & password on the Microsoft account login page. Please do not use a verification code to log in.
account.methods.microsoft.error.wrong_verify_method=Please log in using your account & password on the Microsoft account login page. Please do not use a verification code to log in. See "Login with password".
account.methods.microsoft.logging_in=Logging in...
account.methods.microsoft.hint=Please click on the "login" button, and copy the code shown here later to finish the login process in the opened browser window.\n\
\n\
If the token used to log in to the Microsoft account is leaked, you can click on "Deauthorize" to deauthorize it.\n\
If you encounter any problems, you can click the help button in the upper right corner for help.
account.methods.microsoft.manual=Your device code is <b>%1$s</b>, please click here to copy. After clicking on the "Login" button, you should finish the login process in the opened browser window. If it did not show, you can go to %2$s manually.\n\
\n\
If the token used to log in to the Microsoft account is leaked, you can click on "Deauthorize" to deauthorize it.\n\
If you encounter any problems, you can click the help button in the upper right corner for help.
account.methods.microsoft.hint=Click "Login" to get started.
account.methods.microsoft.manual=[Click here] or scan the QR code to open %2$s, then paste or enter the <b>%1$s</b> code to log in.
account.methods.microsoft.makegameidsettings=Create Profile / Edit Profile Name
account.methods.microsoft.profile=Account Profile
account.methods.microsoft.purchase=Buy Minecraft
account.methods.microsoft.snapshot=You are using an unofficial build of HMCL. Please download the official build for login.
account.methods.microsoft.snapshot.website=Official Website
Expand All @@ -133,7 +126,8 @@ account.methods.offline.uuid.hint=UUID is the unique identifier for the game cha
\n\
This option is for advanced users only. We do not recommend modifying this option unless you know what you are doing.
account.methods.offline.uuid.malformed=Invalid Format
account.methods.forgot_password=Forgot Password
account.methods.login_with_password=Login with password
account.methods.qrcodelogin=Scan QR code to log in
account.missing=No Accounts
account.missing.add=Click here to add one.
account.move_to_global=Convert to global account
Expand Down
13 changes: 3 additions & 10 deletions HMCL/src/main/resources/assets/lang/I18N_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,9 @@ account.methods.microsoft.error.missing_xbox_account=Tu cuenta Microsoft aún no
account.methods.microsoft.error.no_character=Tu cuenta no posee la edición Java de Minecraft.\nThe game profile may not have been created,\nplease click the link above to create it.
account.methods.microsoft.error.unknown=No se ha podido iniciar sesión, error: %d.
account.methods.microsoft.logging_in=Inicio de sesión...
account.methods.microsoft.hint=Por favor, haz clic en el botón "Acceder", y copia el código que se muestra aquí para terminar el proceso de acceso en la ventana abierta del navegador.\n\
\n\
Si el token utilizado para acceder a la cuenta de Microsoft se ha filtrado, puedes hacer clic en "Desautorizar la cuenta" para desautorizarla.\n\
Si encuentra algún problema, puede hacer clic en el botón de ayuda en la esquina superior derecha para obtener ayuda.
account.methods.microsoft.manual=El código de su dispositivo es <b>%1$s</b>, por favor, haga clic aquí para copiar. Después de hacer clic en el botón "Iniciar sesión", debería terminar el proceso de inicio de sesión en la ventana abierta del navegador. Si no aparece, puede ir a %2$s manualmente.n\
\n\
Si el token utilizado para acceder a la cuenta de Microsoft se ha filtrado, puedes hacer clic en "Desautorizar la cuenta" para desautorizarla.\n\
Si encuentra algún problema, puede hacer clic en el botón de ayuda en la esquina superior derecha para obtener ayuda.
account.methods.microsoft.profile=Perfil de la cuenta
account.methods.microsoft.hint=Haga clic en el botón "Iniciar sesión" para comenzar.
account.methods.microsoft.manual=[Haga clic aquí] para abrir %2$s o escanee el código QR, luego pegue o ingrese el código <b>%1$s</b> para iniciar sesión.
account.methods.qrcodelogin=Escanear el código QR para iniciar sesión
account.methods.microsoft.purchase=Comprar Minecraft
account.methods.microsoft.snapshot=Estás usando una construcción no oficial de hmcls, por favor descargue la construcción oficial para iniciar sesión en microsoft.
account.methods.offline=Sin conexión
Expand All @@ -115,7 +109,6 @@ account.methods.offline.uuid.hint=UUID es el identificador único del personaje
Esta opción es sólo para usuarios avanzados. No recomendamos modificar esta opción a menos que sepas lo que estás haciendo.\n\
Esta opción no es necesaria para unirse a servidores.
account.methods.offline.uuid.malformed=Formato no válido
account.methods.forgot_password=OLVIDÉ MI CONTRASEÑA
account.missing=No hay cuentas
account.missing.add=Haz clic aquí para añadir una.
account.not_logged_in=No ha iniciado sesión
Expand Down
7 changes: 3 additions & 4 deletions HMCL/src/main/resources/assets/lang/I18N_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ account.methods.microsoft.error.missing_xbox_account=Microsoftアカウントが
account.methods.microsoft.error.no_character=アカウントにMinecraftJavaプロファイルがありません。\nゲームファイルが作成されていない可能性があります\n上記のリンクをクリックして作成してください
account.methods.microsoft.error.unknown=ログインに失敗しました。Microsoftはエラーコード %d で応答します。
account.methods.microsoft.logging_in=ログイン...
account.methods.forgot_password=パスワードをお忘れの方
account.methods.microsoft.makegameidsettings=プロファイルを作成/プロフィール名を編集する
account.methods.microsoft.hint=「ログイン」ボタンをクリックして、新しく開いたブラウザウィンドウでログインプロセスを続行する必要があります。\nMicrosoftアカウントへのログインに使用されたトークンが誤って漏洩した場合は、下の[アカウントのバインドを解除]をクリックして、ログイン認証をキャンセルできます。\n問題が発生した場合は、右上隅にあるヘルプ ボタンをクリックするとヘルプが表示されます
account.methods.microsoft.manual=「ログイン」ボタンをクリックした後、新しく開いたブラウザウィンドウで認証を完了する必要があります。ブラウザウィンドウが表示されない場合は、ここをクリックしてURLをコピーし、ブラウザで手動で開くことができます。\nMicrosoftアカウントへのログインに使用されたトークンが誤って漏洩した場合は、下の[アカウントのバインドを解除]をクリックして、ログイン認証をキャンセルできます。\n問題が発生した場合は、右上隅にあるヘルプ ボタンをクリックするとヘルプが表示されます
account.methods.microsoft.profile=アカウントプロファイル..
account.methods.microsoft.hint=「ログイン」ボタンをクリックして開始します
account.methods.microsoft.manual=[ここをクリック]して %2$s を開くか、QRコードをスキャンして、<b>%1$s</b> コードを直接貼り付けるか入力してログインします
account.methods.qrcodelogin=QRコードをスキャンしてログイン
account.methods.microsoft.purchase=Minecraftを購入する
account.methods.microsoft.snapshot=非公式構築 HMCL を使用しているので、公式構築をダウンロードしてマイクロソフトにログインしてください。
account.methods.offline=オフライン
Expand Down
7 changes: 3 additions & 4 deletions HMCL/src/main/resources/assets/lang/I18N_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ account.methods.microsoft.error.no_character=На аккаунте отсутс
account.methods.microsoft.error.unknown=Не удалось войти. Microsoft отвечает с кодом ошибки %d.
account.methods.microsoft.logging_in=Авторизация...
account.methods.microsoft.makegameidsettings=Создать архив / изменение имени профиля
account.methods.microsoft.hint=Вам необходимо нажать кнопку «Войти» и продолжить процесс авторизации во вновь открывшемся окне браузера.\nЕсли токен, используемый для входа в аккаунт Microsoft случайно утёк, вы можете нажать «Отменить авторизацию аккаунта» ниже, чтобы отменить авторизацию.\nЕсли у вас возникнут какие-либо проблемы, вы можете нажать кнопку справки в правом верхнем углу для получения помощи.
account.methods.microsoft.manual=После нажатия кнопки «Войти», вы должны завершить авторизацию во вновь открывшемся окне браузера. Если окно браузера не открылось, вы можете щёлкнуть здесь, чтобы скопировать ссылку и вручную открыть её в браузере.\nЕсли токен, используемый для входа в аккаунт Microsoft случайно утёк, вы можете нажать «Отменить авторизацию аккаунта» ниже, чтобы отменить авторизацию.\n問題が発生した場合は、右上隅にあるヘルプ ボタンをクリックするとヘルプが表示されます。
account.methods.microsoft.profile=Профиль аккаунта...
account.methods.microsoft.hint=Нажмите кнопку «Войти», чтобы начать.
account.methods.microsoft.manual=[Нажмите здесь], чтобы открыть %2$s или отсканируйте QR-код, затем вставьте или введите код <b>%1$s</b> для входа.
account.methods.qrcodelogin=Сканировать QR-код для входа
account.methods.microsoft.purchase=Купить Minecraft
account.methods.forgot_password=ЗАБЫЛ ПАРОЛЬ
account.methods.microsoft.snapshot=Вы используете неофициальное построение HMCL, загрузите официальное построение для входа в Microsoft.
account.methods.offline=Офлайн
account.methods.offline.uuid=UUID
Expand Down
Loading