mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-14 06:17:47 -04:00
parent
cc8a4ddf19
commit
371295d9fe
@ -224,12 +224,7 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
|
|||||||
additionalData = null;
|
additionalData = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (factory instanceof OfflineAccountFactory && username != null) {
|
Runnable doCreate = () -> {
|
||||||
if (!USERNAME_CHECKER_PATTERN.matcher(username).matches()) {
|
|
||||||
Controllers.confirm(
|
|
||||||
i18n("account.methods.offline.name.invalid"), i18n("message.warning"),
|
|
||||||
MessageDialogPane.MessageType.WARNING,
|
|
||||||
() -> {
|
|
||||||
logging.set(true);
|
logging.set(true);
|
||||||
deviceCode.set(null);
|
deviceCode.set(null);
|
||||||
|
|
||||||
@ -259,14 +254,21 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
|
|||||||
body.setDisable(false);
|
body.setDisable(false);
|
||||||
spinner.hideSpinner();
|
spinner.hideSpinner();
|
||||||
}).executor(true);
|
}).executor(true);
|
||||||
},
|
};
|
||||||
|
|
||||||
|
if (factory instanceof OfflineAccountFactory && username != null && !USERNAME_CHECKER_PATTERN.matcher(username).matches()) {
|
||||||
|
Controllers.confirm(
|
||||||
|
i18n("account.methods.offline.name.invalid"), i18n("message.warning"),
|
||||||
|
MessageDialogPane.MessageType.WARNING,
|
||||||
|
doCreate,
|
||||||
() -> {
|
() -> {
|
||||||
lblErrorMessage.setText(i18n("account.methods.offline.name.invalid"));
|
lblErrorMessage.setText(i18n("account.methods.offline.name.invalid"));
|
||||||
body.setDisable(false);
|
body.setDisable(false);
|
||||||
spinner.hideSpinner();
|
spinner.hideSpinner();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
|
doCreate.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +372,7 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
|
|||||||
private static class AccountDetailsInputPane extends GridPane {
|
private static class AccountDetailsInputPane extends GridPane {
|
||||||
|
|
||||||
// ==== authlib-injector hyperlinks ====
|
// ==== authlib-injector hyperlinks ====
|
||||||
private static final String[] ALLOWED_LINKS = { "homepage", "register" };
|
private static final String[] ALLOWED_LINKS = {"homepage", "register"};
|
||||||
|
|
||||||
private static List<Hyperlink> createHyperlinks(AuthlibInjectorServer server) {
|
private static List<Hyperlink> createHyperlinks(AuthlibInjectorServer server) {
|
||||||
if (server == null) {
|
if (server == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user