From 194a39c66719da8106b5c45eb666331d36eafb3b Mon Sep 17 00:00:00 2001 From: Ciilu <109708109+Ciilu@users.noreply.github.com> Date: Fri, 5 Sep 2025 22:19:59 +0800 Subject: [PATCH] rename --- .../hmcl/game/HMCLGameRepository.java | 2 +- .../jackhuang/hmcl/setting/VersionSetting.java | 18 +++++++++--------- .../versions/AdvancedVersionSettingPage.java | 8 +------- .../hmcl/ui/versions/VersionSettingsPage.java | 7 +++++++ .../main/resources/assets/lang/I18N.properties | 2 +- .../resources/assets/lang/I18N_zh.properties | 2 +- .../assets/lang/I18N_zh_CN.properties | 2 +- .../org/jackhuang/hmcl/game/LaunchOptions.java | 10 +++++----- .../jackhuang/hmcl/launch/DefaultLauncher.java | 4 ++-- 9 files changed, 28 insertions(+), 27 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java b/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java index a50412ee2..dcd4308f1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java @@ -411,7 +411,7 @@ public class HMCLGameRepository extends DefaultGameRepository { .setNativesDir(vs.getNativesDir()) .setProcessPriority(vs.getProcessPriority()) .setRenderer(vs.getRenderer()) - .setUseDebugLog4j2Config(vs.isUseDebugLog4j2Config()) + .setUseDebugLogOutput(vs.isUseDebugDebugLogOutput()) .setUseNativeGLFW(vs.isUseNativeGLFW()) .setUseNativeOpenAL(vs.isUseNativeOpenAL()) .setDaemon(!makeLaunchScript && vs.getLauncherVisibility().isDaemon()) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionSetting.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionSetting.java index 747f66ac6..974af6e52 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionSetting.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionSetting.java @@ -589,18 +589,18 @@ public final class VersionSetting implements Cloneable, Observable { this.rendererProperty.set(renderer); } - private final BooleanProperty useDebugLog4j2ConfigProperty = new SimpleBooleanProperty(this, "useDebugLog4j2Config", false); + private final BooleanProperty useDebugLogOutputProperty = new SimpleBooleanProperty(this, "useDebugLogOutput", false); - public boolean isUseDebugLog4j2Config() { - return useDebugLog4j2ConfigProperty.get(); + public boolean isUseDebugDebugLogOutput() { + return useDebugLogOutputProperty.get(); } - public BooleanProperty useDebugLog4j2ConfigProperty() { - return useDebugLog4j2ConfigProperty; + public BooleanProperty useDebugLogOutputProperty() { + return useDebugLogOutputProperty; } - public void setUseDebugLog4j2Config(boolean u) { - this.useDebugLog4j2ConfigProperty.set(u); + public void setUseDebugLogOutput(boolean u) { + this.useDebugLogOutputProperty.set(u); } private final BooleanProperty useNativeGLFW = new SimpleBooleanProperty(this, "nativeGLFW", false); @@ -778,7 +778,7 @@ public final class VersionSetting implements Cloneable, Observable { obj.addProperty("gameDir", src.getGameDir()); obj.addProperty("launcherVisibility", src.getLauncherVisibility().ordinal()); obj.addProperty("processPriority", src.getProcessPriority().ordinal()); - obj.addProperty("useDebugLog4j2Config", src.isUseDebugLog4j2Config()); + obj.addProperty("useDebugLogOutput", src.isUseDebugDebugLogOutput()); obj.addProperty("useNativeGLFW", src.isUseNativeGLFW()); obj.addProperty("useNativeOpenAL", src.isUseNativeOpenAL()); obj.addProperty("gameDirType", src.getGameDirType().ordinal()); @@ -846,7 +846,7 @@ public final class VersionSetting implements Cloneable, Observable { vs.setNotCheckJVM(Optional.ofNullable(obj.get("notCheckJVM")).map(JsonElement::getAsBoolean).orElse(false)); vs.setNotPatchNatives(Optional.ofNullable(obj.get("notPatchNatives")).map(JsonElement::getAsBoolean).orElse(false)); vs.setShowLogs(Optional.ofNullable(obj.get("showLogs")).map(JsonElement::getAsBoolean).orElse(false)); - vs.setUseDebugLog4j2Config(Optional.ofNullable(obj.get("useDebugLog4j2Config")).map(JsonElement::getAsBoolean).orElse(false)); + vs.setUseDebugLogOutput(Optional.ofNullable(obj.get("useDebugLogOutput")).map(JsonElement::getAsBoolean).orElse(false)); vs.setLauncherVisibility(parseJsonPrimitive(obj.getAsJsonPrimitive("launcherVisibility"), LauncherVisibility.class, LauncherVisibility.HIDE)); vs.setProcessPriority(parseJsonPrimitive(obj.getAsJsonPrimitive("processPriority"), ProcessPriority.class, ProcessPriority.NORMAL)); vs.setUseNativeGLFW(Optional.ofNullable(obj.get("useNativeGLFW")).map(JsonElement::getAsBoolean).orElse(false)); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java index d66163e1b..c47cb30df 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java @@ -47,7 +47,6 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor private final OptionToggleButton noJVMCheckPane; private final OptionToggleButton noNativesPatchPane; private final OptionToggleButton useNativeGLFWPane; - private final OptionToggleButton useDebugLog4j2CongigPane; private final OptionToggleButton useNativeOpenALPane; private final ComponentSublist nativesDirSublist; private final MultiFileItem nativesDirItem; @@ -193,9 +192,6 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor noNativesPatchPane = new OptionToggleButton(); noNativesPatchPane.setTitle(i18n("settings.advanced.dont_patch_natives")); - useDebugLog4j2CongigPane = new OptionToggleButton(); - useDebugLog4j2CongigPane.setTitle(i18n("settings.advanced.use_debug_log42j_config")); - useNativeGLFWPane = new OptionToggleButton(); useNativeGLFWPane.setTitle(i18n("settings.advanced.use_native_glfw")); @@ -204,7 +200,7 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor workaroundPane.getContent().setAll( nativesDirSublist, rendererPane, noJVMArgsPane, noGameCheckPane, - noJVMCheckPane, noNativesPatchPane, useDebugLog4j2CongigPane + noJVMCheckPane, noNativesPatchPane ); if (OperatingSystem.CURRENT_OS.isLinuxOrBSD()) { @@ -241,7 +237,6 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor noJVMArgsPane.selectedProperty().bindBidirectional(versionSetting.noJVMArgsProperty()); noNativesPatchPane.selectedProperty().bindBidirectional(versionSetting.notPatchNativesProperty()); useNativeGLFWPane.selectedProperty().bindBidirectional(versionSetting.useNativeGLFWProperty()); - useDebugLog4j2CongigPane.selectedProperty().bindBidirectional(versionSetting.useDebugLog4j2ConfigProperty()); useNativeOpenALPane.selectedProperty().bindBidirectional(versionSetting.useNativeOpenALProperty()); nativesDirItem.selectedDataProperty().bindBidirectional(versionSetting.nativesDirTypeProperty()); @@ -282,7 +277,6 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor noJVMCheckPane.selectedProperty().unbindBidirectional(versionSetting.notCheckJVMProperty()); noJVMArgsPane.selectedProperty().unbindBidirectional(versionSetting.noJVMArgsProperty()); noNativesPatchPane.selectedProperty().unbindBidirectional(versionSetting.notPatchNativesProperty()); - useDebugLog4j2CongigPane.selectedProperty().unbindBidirectional(versionSetting.useDebugLog4j2ConfigProperty()); useNativeGLFWPane.selectedProperty().unbindBidirectional(versionSetting.useNativeGLFWProperty()); useNativeOpenALPane.selectedProperty().unbindBidirectional(versionSetting.useNativeOpenALProperty()); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java index 96e89777d..48d4c3844 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionSettingsPage.java @@ -112,6 +112,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag private final MultiFileItem.FileOption gameDirCustomOption; private final JFXComboBox cboProcessPriority; private final OptionToggleButton showLogsPane; + private final OptionToggleButton useDebugLogOutputPane; private final ImagePickerItem iconPickerItem; private final ChangeListener> javaListChangeListener; @@ -412,6 +413,9 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag showLogsPane = new OptionToggleButton(); showLogsPane.setTitle(i18n("settings.show_log")); + useDebugLogOutputPane = new OptionToggleButton(); + useDebugLogOutputPane.setTitle(i18n("settings.advanced.use_debug_log_output")); + BorderPane processPriorityPane = new BorderPane(); { Label label = new Label(i18n("settings.advanced.process_priority")); @@ -477,6 +481,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag launcherVisibilityPane, dimensionPane, showLogsPane, + useDebugLogOutputPane, processPriorityPane, serverPane, showAdvancedSettingPane @@ -553,6 +558,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag FXUtils.unbind(txtServerIP, lastVersionSetting.serverIpProperty()); chkAutoAllocate.selectedProperty().unbindBidirectional(lastVersionSetting.autoMemoryProperty()); chkFullscreen.selectedProperty().unbindBidirectional(lastVersionSetting.fullscreenProperty()); + useDebugLogOutputPane.selectedProperty().unbindBidirectional(versionSetting.useDebugLogOutputProperty()); showLogsPane.selectedProperty().unbindBidirectional(lastVersionSetting.showLogsProperty()); FXUtils.unbindEnum(cboLauncherVisibility, lastVersionSetting.launcherVisibilityProperty()); FXUtils.unbindEnum(cboProcessPriority, lastVersionSetting.processPriorityProperty()); @@ -588,6 +594,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag chkAutoAllocate.selectedProperty().bindBidirectional(versionSetting.autoMemoryProperty()); chkFullscreen.selectedProperty().bindBidirectional(versionSetting.fullscreenProperty()); showLogsPane.selectedProperty().bindBidirectional(versionSetting.showLogsProperty()); + useDebugLogOutputPane.selectedProperty().bindBidirectional(versionSetting.useDebugLogOutputProperty()); FXUtils.bindEnum(cboLauncherVisibility, versionSetting.launcherVisibilityProperty()); FXUtils.bindEnum(cboProcessPriority, versionSetting.processPriorityProperty()); diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index cd0701830..e943a5d55 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1308,7 +1308,7 @@ settings.advanced.workaround=Workaround settings.advanced.workaround.warning=Workaround options are intended only for advanced users. Tweaking with these options may crash the game. Unless you know what you are doing, please do not edit these options. settings.advanced.wrapper_launcher=Wrapper Command settings.advanced.wrapper_launcher.prompt=Allows launching using an extra wrapper program like "optirun" on Linux -settings.advanced.use_debug_log42j_config=Use debug level Log4j2 configuration file +settings.advanced.use_debug_log_output=Output debug log settings.custom=Custom diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 868391cf8..c1f373904 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -1100,7 +1100,7 @@ settings.advanced.workaround=除錯選項 settings.advanced.workaround.warning=除錯選項僅提供給專業玩家使用。修改除錯選項可能會導致遊戲無法啟動。除非你知道你在做什麼,否則請不要修改這些選項。 settings.advanced.wrapper_launcher=前置指令 settings.advanced.wrapper_launcher.prompt=如填寫「optirun」後,啟動指令將從「java ...」變為「optirun java ...」 -settings.advanced.use_debug_log42j_config=使用除錯級別 Log4j2 設定檔 +settings.advanced.use_debug_log_output=输出除錯日誌 settings.custom=自訂 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 8b6193fca..5d0d10be8 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1111,7 +1111,7 @@ settings.advanced.workaround=调试选项 settings.advanced.workaround.warning=调试选项仅提供给专业玩家使用。调试选项可能会导致游戏无法启动。除非你知道你在做什么,否则请不要修改这些选项! settings.advanced.wrapper_launcher=包装命令 settings.advanced.wrapper_launcher.prompt=如填写“optirun”后,启动命令将从“java ...”变为“optirun java ...” -settings.advanced.use_debug_log42j_config=使用调试级别 Log4j2 配置文件 +settings.advanced.use_debug_log_output=输出调试日志 settings.custom=自定义 diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/LaunchOptions.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/LaunchOptions.java index a7343ec26..b5328b3f3 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/LaunchOptions.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/LaunchOptions.java @@ -63,7 +63,7 @@ public class LaunchOptions implements Serializable { private Renderer renderer = Renderer.DEFAULT; private boolean useNativeGLFW; private boolean useNativeOpenAL; - private boolean useDebugLog4j2Config; + private boolean useDebugLogOutput; private boolean daemon; /** @@ -275,8 +275,8 @@ public class LaunchOptions implements Serializable { return useNativeOpenAL; } - public boolean isUseDebugLog4j2Config() { - return useDebugLog4j2Config; + public boolean isUseDebugLogOutput() { + return useDebugLogOutput; } /** @@ -489,8 +489,8 @@ public class LaunchOptions implements Serializable { return this; } - public Builder setUseDebugLog4j2Config(boolean u) { - options.useDebugLog4j2Config = u; + public Builder setUseDebugLogOutput(boolean u) { + options.useDebugLogOutput = u; return this; } } diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java index c7545eb3c..e87fb4c40 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java @@ -147,7 +147,7 @@ public class DefaultLauncher extends Launcher { res.addDefault("-Dcom.sun.jndi.rmi.object.trustURLCodebase=", "false"); res.addDefault("-Dcom.sun.jndi.cosnaming.object.trustURLCodebase=", "false"); - if (options.isUseDebugLog4j2Config()) { + if (options.isUseDebugLogOutput()) { res.addDefault("-Dlog4j2.formatMsgNoLookups=", "false"); res.addDefault("-Dlog4j.configurationFile=", getLog4jConfigurationFile().getAbsolutePath()); } else { @@ -421,7 +421,7 @@ public class DefaultLauncher extends Launcher { public void extractLog4jConfigurationFile() throws IOException { File targetFile = getLog4jConfigurationFile(); InputStream source; - if (options.isUseDebugLog4j2Config()) { + if (options.isUseDebugLogOutput()) { source = DefaultLauncher.class.getResourceAsStream("/assets/game/log4j2-debug.xml"); } else if (GameVersionNumber.asGameVersion(repository.getGameVersion(version)).compareTo("1.12") < 0) { source = DefaultLauncher.class.getResourceAsStream("/assets/game/log4j2-1.7.xml");