mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 06:45:42 -04:00
Add an entrance directly to add authlib-injector server
This commit is contained in:
parent
07a701e572
commit
dae41dfb30
@ -66,6 +66,8 @@ public class AddAccountPane extends StackPane {
|
|||||||
@FXML private Hyperlink linkManageInjectorServers;
|
@FXML private Hyperlink linkManageInjectorServers;
|
||||||
@FXML private JFXDialogLayout layout;
|
@FXML private JFXDialogLayout layout;
|
||||||
@FXML private JFXButton btnAccept;
|
@FXML private JFXButton btnAccept;
|
||||||
|
@FXML private JFXButton btnAddServer;
|
||||||
|
@FXML private JFXButton btnManageServer;
|
||||||
@FXML private SpinnerPane acceptPane;
|
@FXML private SpinnerPane acceptPane;
|
||||||
|
|
||||||
public AddAccountPane() {
|
public AddAccountPane() {
|
||||||
@ -81,6 +83,9 @@ public class AddAccountPane extends StackPane {
|
|||||||
cboType.setConverter(stringConverter(Accounts::getAccountTypeName));
|
cboType.setConverter(stringConverter(Accounts::getAccountTypeName));
|
||||||
cboType.getSelectionModel().select(0);
|
cboType.getSelectionModel().select(0);
|
||||||
|
|
||||||
|
btnAddServer.visibleProperty().bind(cboServers.visibleProperty());
|
||||||
|
btnManageServer.visibleProperty().bind(cboServers.visibleProperty());
|
||||||
|
|
||||||
cboServers.getItems().addListener(onInvalidating(this::checkIfNoServer));
|
cboServers.getItems().addListener(onInvalidating(this::checkIfNoServer));
|
||||||
checkIfNoServer();
|
checkIfNoServer();
|
||||||
|
|
||||||
@ -91,7 +96,6 @@ public class AddAccountPane extends StackPane {
|
|||||||
|
|
||||||
cboServers.visibleProperty().bind(loginType.isEqualTo(Accounts.FACTORY_AUTHLIB_INJECTOR));
|
cboServers.visibleProperty().bind(loginType.isEqualTo(Accounts.FACTORY_AUTHLIB_INJECTOR));
|
||||||
lblInjectorServer.visibleProperty().bind(cboServers.visibleProperty());
|
lblInjectorServer.visibleProperty().bind(cboServers.visibleProperty());
|
||||||
linkManageInjectorServers.visibleProperty().bind(cboServers.visibleProperty());
|
|
||||||
|
|
||||||
txtUsername.getValidators().add(new Validator(i18n("input.email"), str -> !txtPassword.isVisible() || str.contains("@")));
|
txtUsername.getValidators().add(new Validator(i18n("input.email"), str -> !txtPassword.isVisible() || str.contains("@")));
|
||||||
|
|
||||||
@ -189,6 +193,11 @@ public class AddAccountPane extends StackPane {
|
|||||||
Controllers.navigate(Controllers.getServersPage());
|
Controllers.navigate(Controllers.getServersPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void onAddInjecterServer() {
|
||||||
|
Controllers.dialog(new AddAuthlibInjectorServerPane());
|
||||||
|
}
|
||||||
|
|
||||||
private class Selector extends BorderPane implements CharacterSelector {
|
private class Selector extends BorderPane implements CharacterSelector {
|
||||||
|
|
||||||
private final AdvancedListBox listBox = new AdvancedListBox();
|
private final AdvancedListBox listBox = new AdvancedListBox();
|
||||||
|
@ -31,8 +31,18 @@
|
|||||||
|
|
||||||
<JFXComboBox fx:id="cboServers" promptText="%general.prompt.empty" maxHeight="25" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
<JFXComboBox fx:id="cboServers" promptText="%general.prompt.empty" maxHeight="25" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||||
|
|
||||||
<Hyperlink fx:id="linkManageInjectorServers" text="%account.injector.manage"
|
<HBox GridPane.columnIndex="2" GridPane.rowIndex="1" spacing="8">
|
||||||
onMouseClicked="#onManageInjecterServers" GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
<JFXButton fx:id="btnAddServer" styleClass="toggle-icon4" onMouseClicked="#onAddInjecterServer">
|
||||||
|
<graphic>
|
||||||
|
<javafx.scene.shape.SVGPath content="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||||
|
</graphic>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="btnManageServer" styleClass="toggle-icon4" onMouseClicked="#onManageInjecterServers">
|
||||||
|
<graphic>
|
||||||
|
<fx:include source="/assets/svg/gear.fxml" />
|
||||||
|
</graphic>
|
||||||
|
</JFXButton>
|
||||||
|
</HBox>
|
||||||
|
|
||||||
<Label text="%account.username" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
|
<Label text="%account.username" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user