From f850c2461ac3984d0b4834ff44182814cf4cadd4 Mon Sep 17 00:00:00 2001 From: huangyuhui Date: Wed, 14 Feb 2018 00:19:25 +0800 Subject: [PATCH] Current account tip --- HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountItem.java | 5 ++++- HMCL/src/main/resources/assets/fxml/account-item.fxml | 5 ++++- HMCL/src/main/resources/assets/lang/I18N.properties | 1 + HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountItem.java index 2c73a2543..8570ccb2a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountItem.java @@ -56,6 +56,7 @@ public final class AccountItem extends StackPane { @FXML private Label lblUser; @FXML private Label lblType; @FXML private Label lblEmail; + @FXML private Label lblCurrentAccount; @FXML private JFXRadioButton chkSelected; @FXML private JFXProgressBar pgsSkin; @FXML private ImageView portraitView; @@ -83,7 +84,8 @@ public final class AccountItem extends StackPane { icon.translateYProperty().bind(Bindings.createDoubleBinding(() -> header.getBoundsInParent().getHeight() - icon.getHeight() / 2 - 32.0, header.boundsInParentProperty(), icon.heightProperty())); chkSelected.getProperties().put("account", account); - chkSelected.setSelected(Settings.INSTANCE.getSelectedAccount() == account); + setSelected(Settings.INSTANCE.getSelectedAccount() == account); + lblUser.setText(Accounts.getCurrentCharacter(account)); lblType.setText(AccountsPage.accountType(account)); lblEmail.setText(account.getUsername()); @@ -138,6 +140,7 @@ public final class AccountItem extends StackPane { } public void setSelected(boolean selected) { + lblCurrentAccount.setVisible(selected); chkSelected.setSelected(selected); } diff --git a/HMCL/src/main/resources/assets/fxml/account-item.fxml b/HMCL/src/main/resources/assets/fxml/account-item.fxml index 6465b0f0c..814d2e420 100644 --- a/HMCL/src/main/resources/assets/fxml/account-item.fxml +++ b/HMCL/src/main/resources/assets/fxml/account-item.fxml @@ -37,7 +37,10 @@ - + + diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index c33a9af53..cb0fc8718 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -30,6 +30,7 @@ about.open_source.statement=GPL v3 (https://github.com/huanghongxun/HMCL/) account=Accounts account.choose=Choose a character +account.current=Current account account.create=Create a new account account.email=Email account.failed.connect_authentication_server=Cannot connect the authentication server. Check your network. diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index d11d68dfb..bbc511ba0 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -30,6 +30,7 @@ about.open_source.statement=GPL v3 (https://github.com/huanghongxun/HMCL/) account=账户 account.choose=选择一个角色 +account.current=当前账户 account.create=新建账户 account.email=邮箱 account.failed.connect_authentication_server=无法连接认证服务器,可能是网络问题