diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java index 7c8cfe549..4c808bbe1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java @@ -396,4 +396,10 @@ public final class SVG { "M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z", fill, width, height); } + + public static Node applicationOutline(ObjectBinding fill, double width, double height) { + return createSVGPath( + "M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20Z", + fill, width, height); + } } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java index b0ba87b08..a95b50ae9 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java @@ -20,6 +20,7 @@ package org.jackhuang.hmcl.ui.main; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.scene.layout.BorderPane; +import org.jackhuang.hmcl.setting.Profiles; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.SVG; import org.jackhuang.hmcl.ui.animation.ContainerAnimations; @@ -27,13 +28,15 @@ import org.jackhuang.hmcl.ui.animation.TransitionPane; import org.jackhuang.hmcl.ui.construct.AdvancedListBox; import org.jackhuang.hmcl.ui.construct.TabHeader; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; +import org.jackhuang.hmcl.ui.versions.VersionSettingsPage; import static org.jackhuang.hmcl.ui.versions.VersionPage.wrap; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class LauncherSettingsPage extends BorderPane implements DecoratorPage { - private final ReadOnlyObjectWrapper state = new ReadOnlyObjectWrapper<>(State.fromTitle(i18n("settings.launcher"), 200)); + private final ReadOnlyObjectWrapper state = new ReadOnlyObjectWrapper<>(State.fromTitle(i18n("settings"), 200)); private final TabHeader tab; + private final TabHeader.Tab gameTab = new TabHeader.Tab<>("versionSettingsPage"); private final TabHeader.Tab settingsTab = new TabHeader.Tab<>("settingsPage"); private final TabHeader.Tab personalizationTab = new TabHeader.Tab<>("personalizationPage"); private final TabHeader.Tab downloadTab = new TabHeader.Tab<>("downloadSettingsPage"); @@ -43,15 +46,18 @@ public class LauncherSettingsPage extends BorderPane implements DecoratorPage { private final TransitionPane transitionPane = new TransitionPane(); public LauncherSettingsPage() { + gameTab.setNodeSupplier(VersionSettingsPage::new); settingsTab.setNodeSupplier(SettingsPage::new); personalizationTab.setNodeSupplier(PersonalizationPage::new); downloadTab.setNodeSupplier(DownloadSettingsPage::new); helpTab.setNodeSupplier(HelpPage::new); sponsorTab.setNodeSupplier(SponsorPage::new); aboutTab.setNodeSupplier(AboutPage::new); - tab = new TabHeader(settingsTab, personalizationTab, downloadTab, helpTab, sponsorTab, aboutTab); + tab = new TabHeader(gameTab, settingsTab, personalizationTab, downloadTab, helpTab, sponsorTab, aboutTab); - tab.getSelectionModel().select(settingsTab); + tab.getSelectionModel().select(gameTab); + gameTab.initializeIfNeeded(); + gameTab.getNode().loadVersion(Profiles.getSelectedProfile(), null); FXUtils.onChangeAndOperate(tab.getSelectionModel().selectedItemProperty(), newValue -> { newValue.initializeIfNeeded(); transitionPane.setContent(newValue.getNode(), ContainerAnimations.FADE.getAnimationProducer()); @@ -59,9 +65,15 @@ public class LauncherSettingsPage extends BorderPane implements DecoratorPage { { AdvancedListBox sideBar = new AdvancedListBox() + .addNavigationDrawerItem(settingsItem -> { + settingsItem.setTitle(i18n("settings.game")); + settingsItem.setLeftGraphic(wrap(SVG.gamepad(null, 20, 20))); + settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(gameTab)); + settingsItem.setOnAction(e -> tab.getSelectionModel().select(gameTab)); + }) .addNavigationDrawerItem(settingsItem -> { settingsItem.setTitle(i18n("settings.launcher")); - settingsItem.setLeftGraphic(wrap(SVG.gearOutline(null, 20, 20))); + settingsItem.setLeftGraphic(wrap(SVG.applicationOutline(null, 20, 20))); settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(settingsTab)); settingsItem.setOnAction(e -> tab.getSelectionModel().select(settingsTab)); }) 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 1670695e1..3b16ee106 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 @@ -172,13 +172,18 @@ public class RootPage extends DecoratorTabPage { launcherSettingsItem .setLeftGraphic(AdvancedListItem.createImageView(newImage("/assets/img/command.png")).getKey()); launcherSettingsItem.setActionButtonVisible(false); - launcherSettingsItem.setTitle(i18n("settings.launcher")); + launcherSettingsItem.setTitle(i18n("settings")); launcherSettingsItem.setOnAction(e -> Controllers.navigate(Controllers.getSettingsPage())); // the left sidebar - AdvancedListBox sideBar = new AdvancedListBox().startCategory(i18n("account").toUpperCase()) - .add(accountListItem).startCategory(i18n("version").toUpperCase()).add(gameListItem).add(gameItem) - .startCategory(i18n("launcher").toUpperCase()).add(launcherSettingsItem); + AdvancedListBox sideBar = new AdvancedListBox() + .startCategory(i18n("account").toUpperCase()) + .add(accountListItem) + .startCategory(i18n("version").toUpperCase()) + .add(gameListItem) + .add(gameItem) + .startCategory(i18n("launcher").toUpperCase()) + .add(launcherSettingsItem); // the root page, with the sidebar in left, navigator in center. BorderPane root = new BorderPane(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java index bd787b487..4245e3957 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java @@ -243,7 +243,7 @@ public class VersionPage extends Control implements DecoratorPage, ModDownloadPa AdvancedListItem versionSettingsItem = new AdvancedListItem(); versionSettingsItem.getStyleClass().add("navigation-drawer-item"); - versionSettingsItem.setTitle(i18n("settings")); + versionSettingsItem.setTitle(i18n("settings.game")); versionSettingsItem.setLeftGraphic(wrap(SVG.gearOutline(null, 20, 20))); versionSettingsItem.setActionButtonVisible(false); versionSettingsItem.activeProperty().bind(control.tab.getSelectionModel().selectedItemProperty().isEqualTo(control.versionSettingsTab)); diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index a4dea9cd1..50f2e194c 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -446,7 +446,7 @@ selector.choose=Choose selector.choose_file=Select a file selector.custom=Custom -settings=Game Settings +settings=Settings settings.advanced=Advanced Settings settings.advanced.dont_check_game_completeness=Do not scan game files 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 a4a2a2bb1..d054313c0 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -451,7 +451,7 @@ selector.choose=选择 selector.choose_file=选择文件 selector.custom=自定义 -settings=游戏设置 +settings=设置 settings.advanced=高级设置 settings.advanced.dont_check_game_completeness=不检查游戏完整性