From 6e0fe59bd85f326240fb7c020a64dc9f6caf3f33 Mon Sep 17 00:00:00 2001 From: burningtnt Date: Sun, 16 Jun 2024 14:53:33 +0800 Subject: [PATCH 1/4] Change root page UI --- .../java/org/jackhuang/hmcl/ui/main/MainPage.java | 2 +- .../java/org/jackhuang/hmcl/ui/main/RootPage.java | 5 ++--- .../hmcl/ui/versions/GameAdvancedListItem.java | 13 +++---------- HMCL/src/main/resources/assets/lang/I18N.properties | 4 ++-- .../main/resources/assets/lang/I18N_zh.properties | 4 ++-- .../resources/assets/lang/I18N_zh_CN.properties | 4 ++-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index 6f1cf7f176..583efa2f0b 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -150,7 +150,7 @@ public final class MainPage extends StackPane implements DecoratorPage { } StackPane launchPane = new StackPane(); - launchPane.getStyleClass().add("launch-pane"); + launchPane.getStyleClass().addAll("launch-pane"); launchPane.setMaxWidth(230); launchPane.setMaxHeight(55); launchPane.setOnScroll(event -> { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java index abf24d6ce0..7685f8bbe9 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java @@ -58,8 +58,8 @@ import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.ui.versions.VersionPage.wrap; -import static org.jackhuang.hmcl.util.logging.Logger.LOG; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; +import static org.jackhuang.hmcl.util.logging.Logger.LOG; public class RootPage extends DecoratorAnimatedPage implements DecoratorPage { private MainPage mainPage = null; @@ -191,8 +191,7 @@ protected Skin(RootPage control) { .add(downloadItem) .startCategory(i18n("settings.launcher.general").toUpperCase(Locale.ROOT)) .add(launcherSettingsItem) - .add(chatItem) - ; + .add(chatItem); // the root page, with the sidebar in left, navigator in center. setLeft(sideBar); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameAdvancedListItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameAdvancedListItem.java index da7306d5ac..29743853bf 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameAdvancedListItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameAdvancedListItem.java @@ -18,7 +18,6 @@ package org.jackhuang.hmcl.ui.versions; import javafx.scene.Node; -import javafx.scene.control.Tooltip; import javafx.scene.image.ImageView; import org.jackhuang.hmcl.event.Event; import org.jackhuang.hmcl.setting.Profile; @@ -34,15 +33,13 @@ import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class GameAdvancedListItem extends AdvancedListItem { - private final Tooltip tooltip; private final ImageView imageView; private final WeakListenerHolder holder = new WeakListenerHolder(); private Profile profile; + @SuppressWarnings("unused") private Consumer onVersionIconChangedListener; public GameAdvancedListItem() { - tooltip = new Tooltip(); - Pair view = createImageView(null); setLeftGraphic(view.getKey()); imageView = view.getValue(); @@ -63,17 +60,13 @@ private void loadVersion(String version) { } if (version != null && Profiles.getSelectedProfile() != null && Profiles.getSelectedProfile().getRepository().hasVersion(version)) { - FXUtils.installFastTooltip(this, tooltip); - setTitle(version); - setSubtitle(null); + setTitle(i18n("version.manage.manage")); + setSubtitle(version); imageView.setImage(Profiles.getSelectedProfile().getRepository().getVersionIconImage(version)); - tooltip.setText(version); } else { - Tooltip.uninstall(this,tooltip); setTitle(i18n("version.empty")); setSubtitle(i18n("version.empty.add")); imageView.setImage(VersionIconType.DEFAULT.getIcon()); - tooltip.setText(""); } } } diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 77ed7f4190..d65f538e59 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1248,8 +1248,8 @@ version.manage.duplicate=Duplicate Instance version.manage.duplicate.duplicate_save=Duplicate Save version.manage.duplicate.prompt=Enter instance name version.manage.duplicate.confirm=The duplicated instance will have a copy of all the files of this instance, with an isolated game directory and settings. -version.manage.manage=Manage Instances -version.manage.manage.title=Manage Instance - %1s +version.manage.manage=Game Instances Setting +version.manage.manage.title=Game Instances Setting - %1s version.manage.redownload_assets_index=Update Game Assets version.manage.remove=Delete Instance version.manage.remove.confirm=Are you sure you want to permanently remove the version %s? This action cannot be undone! diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 0063a9cb93..b18c405fb8 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -1105,8 +1105,8 @@ version.manage.duplicate=複製遊戲實例 version.manage.duplicate.duplicate_save=複製存檔 version.manage.duplicate.prompt=請輸入新遊戲實例名稱 version.manage.duplicate.confirm=將鎖定複製產生的新遊戲實例:強制版本隔離、遊戲設置獨立。 -version.manage.manage=遊戲管理 -version.manage.manage.title=遊戲管理 - %1s +version.manage.manage=特定版本設定 +version.manage.manage.title=特定版本設定 - %1s version.manage.redownload_assets_index=更新遊戲資源檔案 version.manage.remove=刪除該版本 version.manage.remove.confirm=真的要刪除版本 %s 嗎? 你將無法找回被刪除的檔案! 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 ee0fca1ee2..e7a43927fe 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1104,8 +1104,8 @@ version.manage.duplicate=复制游戏实例 version.manage.duplicate.duplicate_save=复制存档 version.manage.duplicate.prompt=请输入新游戏实例名称 version.manage.duplicate.confirm=将锁定复制产生的新游戏实例:开启版本隔离、游戏设置并复制该版本产生的文件 -version.manage.manage=游戏管理 -version.manage.manage.title=游戏管理 - %1s +version.manage.manage=特定版本设置 +version.manage.manage.title=特定版本设置 - %1s version.manage.redownload_assets_index=更新游戏资源文件 version.manage.remove=删除该版本 version.manage.remove.confirm=真的要删除版本 %s 吗?你将无法找回被删除的文件!!! From 1e68198724771aecff786868bf1493e32828e66c Mon Sep 17 00:00:00 2001 From: Burning_TNT <88144530+burningtnt@users.noreply.github.com> Date: Sun, 16 Jun 2024 15:40:16 +0800 Subject: [PATCH 2/4] Update HMCL/src/main/resources/assets/lang/I18N.properties Co-authored-by: 3gf8jv4dv <158490944+3gf8jv4dv@users.noreply.github.com> --- HMCL/src/main/resources/assets/lang/I18N.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index d65f538e59..976457991e 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1248,8 +1248,8 @@ version.manage.duplicate=Duplicate Instance version.manage.duplicate.duplicate_save=Duplicate Save version.manage.duplicate.prompt=Enter instance name version.manage.duplicate.confirm=The duplicated instance will have a copy of all the files of this instance, with an isolated game directory and settings. -version.manage.manage=Game Instances Setting -version.manage.manage.title=Game Instances Setting - %1s +version.manage.manage=Game Instance Settings +version.manage.manage.title=Game Instance Settings - %1s version.manage.redownload_assets_index=Update Game Assets version.manage.remove=Delete Instance version.manage.remove.confirm=Are you sure you want to permanently remove the version %s? This action cannot be undone! From f792140852a51fdf7630766c8c9ea6e2a72beb94 Mon Sep 17 00:00:00 2001 From: burningtnt Date: Mon, 17 Jun 2024 18:33:39 +0800 Subject: [PATCH 3/4] Shorten I18N --- HMCL/src/main/resources/assets/lang/I18N.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 976457991e..2975127faf 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -164,7 +164,7 @@ archive.version=Version assets.download=Downloading Assets assets.download_all=Validating assets integrity -assets.index.malformed=Index files of downloaded assets were corrupted. You can try using 'Update Game Assets' in its game instance settings to fix this issue. +assets.index.malformed=Index files of downloaded assets were corrupted. You can try using 'Update Game Assets' in its instance settings to fix this issue. button.cancel=Cancel button.change_source=Change Download Source @@ -1248,8 +1248,8 @@ version.manage.duplicate=Duplicate Instance version.manage.duplicate.duplicate_save=Duplicate Save version.manage.duplicate.prompt=Enter instance name version.manage.duplicate.confirm=The duplicated instance will have a copy of all the files of this instance, with an isolated game directory and settings. -version.manage.manage=Game Instance Settings -version.manage.manage.title=Game Instance Settings - %1s +version.manage.manage=Instance Settings +version.manage.manage.title=Instance Settings - %1s version.manage.redownload_assets_index=Update Game Assets version.manage.remove=Delete Instance version.manage.remove.confirm=Are you sure you want to permanently remove the version %s? This action cannot be undone! From e528bc688b2cff3cc835136196ff572651dd2a1f Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 26 Oct 2024 20:59:35 +0800 Subject: [PATCH 4/4] update --- HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java | 2 +- HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index 9fd20c7d20..1c0f991627 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -161,7 +161,7 @@ public final class MainPage extends StackPane implements DecoratorPage { } StackPane launchPane = new StackPane(); - launchPane.getStyleClass().addAll("launch-pane"); + launchPane.getStyleClass().add("launch-pane"); launchPane.setMaxWidth(230); launchPane.setMaxHeight(55); launchPane.setOnScroll(event -> { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java index 7685f8bbe9..abf24d6ce0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java @@ -58,8 +58,8 @@ import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.ui.versions.VersionPage.wrap; -import static org.jackhuang.hmcl.util.i18n.I18n.i18n; import static org.jackhuang.hmcl.util.logging.Logger.LOG; +import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class RootPage extends DecoratorAnimatedPage implements DecoratorPage { private MainPage mainPage = null; @@ -191,7 +191,8 @@ protected Skin(RootPage control) { .add(downloadItem) .startCategory(i18n("settings.launcher.general").toUpperCase(Locale.ROOT)) .add(launcherSettingsItem) - .add(chatItem); + .add(chatItem) + ; // the root page, with the sidebar in left, navigator in center. setLeft(sideBar);