feat(ui): show warnings for workaround options.

This commit is contained in:
huanghongxun
2021-10-09 17:17:28 +08:00
parent 6fc60f1387
commit 14fd0d484e
4 changed files with 23 additions and 7 deletions

View File

@@ -481,19 +481,26 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
ComponentList workaroundPane = new ComponentList();
workaroundPane.disableProperty().bind(enableSpecificSettings.not());
HintPane workaroundWarning = new HintPane(MessageDialogPane.MessageType.WARNING);
workaroundWarning.setText(i18n("settings.advanced.workaround.warning"));
{
nativesDirItem = new MultiFileItem<>();
nativesDirSublist = new ComponentSublist();
nativesDirSublist.getContent().add(nativesDirItem);
nativesDirSublist.setTitle(i18n("settings.advanced.natives_directory"));
nativesDirSublist.setHasSubtitle(true);
nativesDirCustomOption = new MultiFileItem.FileOption<>(i18n("settings.custom"), NativesDirectoryType.CUSTOM)
nativesDirCustomOption = new MultiFileItem.FileOption<>(i18n("settings.advanced.natives_directory.custom"), NativesDirectoryType.CUSTOM)
.setChooserTitle(i18n("settings.advanced.natives_directory.choose"))
.setDirectory(true);
nativesDirItem.loadChildren(Arrays.asList(
new MultiFileItem.Option<>(i18n("settings.advanced.natives_directory.default"), NativesDirectoryType.VERSION_FOLDER),
nativesDirCustomOption
));
HintPane nativesDirHint = new HintPane(MessageDialogPane.MessageType.WARNING);
nativesDirHint.setText(i18n("settings.advanced.natives_directory.hint"));
nativesDirItem.getChildren().add(nativesDirHint);
noJVMArgsPane = new OptionToggleButton();
noJVMArgsPane.setTitle(i18n("settings.advanced.no_jvm_args"));
@@ -517,7 +524,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
advancedHintPane,
ComponentList.createComponentListTitle(i18n("settings.advanced.custom_commands")), customCommandsPane,
ComponentList.createComponentListTitle(i18n("settings.advanced.jvm")), jvmPane,
ComponentList.createComponentListTitle(i18n("settings.advanced.workaround")), workaroundPane);
ComponentList.createComponentListTitle(i18n("settings.advanced.workaround")), workaroundWarning, workaroundPane);
initialize();

View File

@@ -771,9 +771,11 @@ settings.advanced.launcher_visibility.keep=Keep the launcher visible.
settings.advanced.launcher_visible=Launcher Visibility
settings.advanced.minecraft_arguments=Minecraft Arguments
settings.advanced.minecraft_arguments.prompt=Default
settings.advanced.natives_directory=Local Library Path (LWJGL)
settings.advanced.natives_directory.choose=Choose Local Library Path
settings.advanced.natives_directory.default=Standerd (.minecraft/versions/<version name>/natives/)
settings.advanced.natives_directory=Native Library Pathe.g. LWJGL
settings.advanced.natives_directory.choose=Choose Native Library Path
settings.advanced.natives_directory.custom=Custom (You should provide the native libraries that the game requires in runtime)
settings.advanced.natives_directory.default=Standard (Native libraries are provided by us)
settings.advanced.natives_directory.hint=This option is only used for play game on Apple M1 or other not officially supported platform/architectures.\nIf you don't know the meaning of changing this option, you'd better not modify this option, or the game won't launch.\nIf you do need to modify this option, you are required to place all the native libraries that the game need to run under your custom native directory, e.g. lwjgl.dll(liblwjgl.so), openal.dll(libopenal.so). HMCL won't provide missing native libraries for you.
settings.advanced.no_jvm_args=No Default JVM Args
settings.advanced.precall_command=Pre-launch command
settings.advanced.precall_command.prompt=Will be executed before game starts
@@ -790,6 +792,7 @@ settings.advanced.server_ip.prompt=Join server when game launched
settings.advanced.use_native_glfw=[Linux] Use system GLFW
settings.advanced.use_native_openal=[Linux] Use system OpenAL
settings.advanced.workaround=Workarounds
settings.advanced.workaround.warning=Workaround settings are only for professional users. Modifying workaround settings may result in game crash. Unless you know what you are doing, please do not modify these options.
settings.advanced.wrapper_launcher=Wrapper command
settings.advanced.wrapper_launcher.prompt=Allows launching using an extra wrapper program like 'optirun' on Linux.

View File

@@ -772,7 +772,9 @@ settings.advanced.minecraft_arguments=Minecraft 額外參數
settings.advanced.minecraft_arguments.prompt=預設
settings.advanced.natives_directory=本地庫路徑LWJGL
settings.advanced.natives_directory.choose=選擇本地庫路徑
settings.advanced.natives_directory.default=預設(.minecraft/versions/<版本名>/natives/
settings.advanced.natives_directory.custom=自訂(由你提供遊戲需要的本地庫
settings.advanced.natives_directory.default=預設(由啟動器提供遊戲本地庫)
settings.advanced.natives_directory.hint=本選項提供給 Apple M1 等未受遊戲官方支持的平台來自訂遊戲本地庫,如果你不知道本選項的含義,請你不要修改本選項,否則會導致遊戲無法啟動。\n如果你要修改本選項你需要保證自訂目錄下有遊戲所需的本地庫文件如 lwjgl.dll(liblwjgl.so), openal.dll(libopenal.so) 等文件。啟動器不會幫你補全缺少的本地庫文件。
settings.advanced.no_jvm_args=不使用預設的 JVM 參數
settings.advanced.precall_command=遊戲啟動前執行指令
settings.advanced.precall_command.prompt=將在遊戲啟動前呼叫使用
@@ -789,6 +791,7 @@ settings.advanced.server_ip.prompt=預設,啟動遊戲後直接進入對應伺
settings.advanced.use_native_glfw=[Linux] 使用系統 GLFW
settings.advanced.use_native_openal=[Linux] 使用系統 OpenAL
settings.advanced.workaround=除錯選項
settings.advanced.workaround.warning=除錯選項僅提供給專業玩家使用。修改除錯選項可能會導致遊戲無法啟動。除非你知道你在做什麼,否則請你不要修改這些選項。
settings.advanced.wrapper_launcher=前置指令
settings.advanced.wrapper_launcher.prompt=如填寫 optirun 後,啟動命令將從 "java ..." 變為 "optirun java ..."

View File

@@ -772,7 +772,9 @@ settings.advanced.minecraft_arguments=游戏参数
settings.advanced.minecraft_arguments.prompt=默认
settings.advanced.natives_directory=本地库路径LWJGL
settings.advanced.natives_directory.choose=选择本地库路径
settings.advanced.natives_directory.default=预设(.minecraft/versions/<版本名>/natives/
settings.advanced.natives_directory.custom=自定义(由你提供游戏需要的本地库
settings.advanced.natives_directory.default=预设(由启动器提供游戏本地库)
settings.advanced.natives_directory.hint=本选项提供给 Apple M1 等未受游戏官方支持的平台来自定义游戏本地库,如果你不知道本选项的含义,请你不要修改本选项,否则会导致游戏无法启动。\n如果你要修改本选项你需要保证自定义目录下有游戏所需的本地库文件如 lwjgl.dll(liblwjgl.so), openal.dll(libopenal.so) 等文件。启动器不会帮你补全缺少的本地库文件。
settings.advanced.no_jvm_args=不添加默认的 JVM 参数
settings.advanced.precall_command=游戏启动前执行命令
settings.advanced.precall_command.prompt=将在游戏启动前调用
@@ -789,6 +791,7 @@ settings.advanced.server_ip.prompt=默认,启动游戏后可以直接进入对
settings.advanced.use_native_glfw=[Linux] 使用系统 GLFW
settings.advanced.use_native_openal=[Linux] 使用系统 OpenAL
settings.advanced.workaround=调试选项
settings.advanced.workaround.warning=调试选项仅提供给专业玩家使用。调试选项可能会导致游戏无法启动。除非你知道你在做什么,否则请你不要修改这些选项。
settings.advanced.wrapper_launcher=包装命令
settings.advanced.wrapper_launcher.prompt=如填写 optirun 后,启动命令将从 "java ..." 变为 "optirun java ..."