优化 Fabric / Quilt API 安装提示 (#4792)

Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: Glavo <zjx001202@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
辞庐
2026-01-16 21:01:24 +08:00
committed by GitHub
parent 9ca95c7f17
commit c1396c05aa
10 changed files with 20 additions and 12 deletions

View File

@@ -24,12 +24,12 @@ import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Insets; import javafx.geometry.Insets;
import javafx.geometry.Pos; import javafx.geometry.Pos;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import org.jackhuang.hmcl.download.DownloadProvider; import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.download.LibraryAnalyzer; import org.jackhuang.hmcl.download.LibraryAnalyzer;
import org.jackhuang.hmcl.ui.Controllers; import org.jackhuang.hmcl.ui.Controllers;
import javafx.scene.layout.BorderPane;
import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.ui.InstallerItem; import org.jackhuang.hmcl.ui.InstallerItem;
import org.jackhuang.hmcl.ui.construct.MessageDialogPane; import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
@@ -38,9 +38,11 @@ import org.jackhuang.hmcl.ui.wizard.WizardController;
import org.jackhuang.hmcl.ui.wizard.WizardPage; import org.jackhuang.hmcl.ui.wizard.WizardPage;
import org.jackhuang.hmcl.util.SettingsMap; import org.jackhuang.hmcl.util.SettingsMap;
import static org.jackhuang.hmcl.setting.ConfigHolder.config;
import static org.jackhuang.hmcl.util.i18n.I18n.i18n; import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
public abstract class AbstractInstallersPage extends Control implements WizardPage { public abstract class AbstractInstallersPage extends Control implements WizardPage {
public static final String FABRIC_QUILT_API_TIP = "fabricQuiltApi";
protected final WizardController controller; protected final WizardController controller;
protected InstallerItem.InstallerItemGroup group; protected InstallerItem.InstallerItemGroup group;
@@ -56,8 +58,14 @@ public abstract class AbstractInstallersPage extends Control implements WizardPa
String libraryId = library.getLibraryId(); String libraryId = library.getLibraryId();
if (libraryId.equals(LibraryAnalyzer.LibraryType.MINECRAFT.getPatchId())) continue; if (libraryId.equals(LibraryAnalyzer.LibraryType.MINECRAFT.getPatchId())) continue;
library.setOnInstall(() -> { library.setOnInstall(() -> {
if (LibraryAnalyzer.LibraryType.FABRIC_API.getPatchId().equals(libraryId)) { if (!Boolean.TRUE.equals(config().getShownTips().get(FABRIC_QUILT_API_TIP))
Controllers.dialog(i18n("install.installer.fabric-api.warning"), i18n("message.warning"), MessageDialogPane.MessageType.WARNING); && (LibraryAnalyzer.LibraryType.FABRIC_API.getPatchId().equals(libraryId)
|| LibraryAnalyzer.LibraryType.QUILT_API.getPatchId().equals(libraryId))) {
Controllers.dialog(new MessageDialogPane.Builder(
i18n("install.installer.fabric-quilt-api.warning", i18n("install.installer." + libraryId)),
i18n("message.warning"),
MessageDialogPane.MessageType.WARNING
).ok(null).addCancel(i18n("button.do_not_show_again"), () -> config().getShownTips().put(FABRIC_QUILT_API_TIP, true)).build());
} }
if (!(library.resolvedStateProperty().get() instanceof InstallerItem.IncompatibleState)) if (!(library.resolvedStateProperty().get() instanceof InstallerItem.IncompatibleState))

View File

@@ -719,7 +719,7 @@ install.installer.depend=Requires %s
install.installer.do_not_install=Do not install install.installer.do_not_install=Do not install
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=Warning: Fabric API is a mod and will be installed into the mod directory of the game instance. Please do not change the working directory of the game, or the Fabric API will not function. If you do want to change the directory, you should reinstall it. install.installer.fabric-quilt-api.warning=%1$s is a mod and will be installed into the mod directory of the game instance. Please do not change the working directory of the game, or the %1$s will not function. If you do want to change the directory, you should reinstall it.
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -696,7 +696,7 @@ install.installer.depend=يتطلب %s
install.installer.do_not_install=عدم التثبيت install.installer.do_not_install=عدم التثبيت
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=تحذير: Fabric API هو تعديل وسيتم تثبيته في دليل التعديلات لنسخة اللعبة. يرجى عدم تغيير دليل عمل اللعبة، أو لن يعمل Fabric API. إذا كنت تريد تغيير الدليل، فيجب عليك إعادة تثبيته. install.installer.fabric-quilt-api.warning=تحذير: %1$s هو تعديل وسيتم تثبيته في دليل التعديلات لنسخة اللعبة. يرجى عدم تغيير دليل عمل اللعبة، أو لن يعمل %1$s. إذا كنت تريد تغيير الدليل، فيجب عليك إعادة تثبيته.
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -701,7 +701,7 @@ install.installer.depend=Requiere %s
install.installer.do_not_install=No instalar install.installer.do_not_install=No instalar
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=Atención: Fabric API es un mod, y se instalará en el directorio de mods de la instancia del juego. Por favor, no cambies el directorio de trabajo del juego, o el Fabric API no funcionará. Si quieres cambiar esta configuración, debes reinstalarlo. install.installer.fabric-quilt-api.warning=%1$s es un mod, y se instalará en el directorio de mods de la instancia del juego. Por favor, no cambies el directorio de trabajo del juego, o el %1$s no funcionará. Si quieres cambiar esta configuración, debes reinstalarlo.
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -429,7 +429,7 @@ install.installer.choose=%s バージョンを選択してください
install.installer.depend=%s に依存 install.installer.depend=%s に依存
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=警告Fabric APIはmodであり、新しいゲームのmodディレクトリにインストールされます。新しいゲームの実行ディレクトリを変更しないでください。変更すると、FabricAPIのインストールが失われます。その設定を変更したい場合は、FabricAPIを再インストールする必要があります。 install.installer.fabric-quilt-api.warning=%1$sはmodであり、新しいゲームのmodディレクトリにインストールされます。新しいゲームの実行ディレクトリを変更しないでください。変更すると、%1$sのインストールが失われます。その設定を変更したい場合は、%1$sを再インストールする必要があります。
install.installer.forge=Forge install.installer.forge=Forge
install.installer.game=Minecraft install.installer.game=Minecraft
install.installer.incompatible=%s と互換性がありません install.installer.incompatible=%s と互換性がありません

View File

@@ -498,7 +498,7 @@ install.installer.depend=請先裝 %s
install.installer.do_not_install=不裝 install.installer.do_not_install=不裝
install.installer.fabric= install.installer.fabric=
install.installer.fabric-api=緞界 install.installer.fabric-api=緞界
install.installer.fabric-api.warning=誡:緞界者,改囊也,將措乎新戲之改囊案夾也。既裝而無改戲之「行徑」。將改,而須復置之。 install.installer.fabric-quilt-api.warning=%1$s者,改囊也,將措乎新戲之改囊案夾也。既裝而無改戲之「行徑」。將改,而須復置之。
install.installer.forge= install.installer.forge=
install.installer.neoforge=新鍛 install.installer.neoforge=新鍛
install.installer.game=礦藝 install.installer.game=礦藝

View File

@@ -692,7 +692,7 @@ install.installer.depend=Требуется %s
install.installer.do_not_install=Не устанавливать install.installer.do_not_install=Не устанавливать
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=Предупреждение: Fabric API является модом и будет установлен в папку mod в сборке игры. Пожалуйста, не меняйте рабочую папку сборки, иначе Fabric API не будет работать. Если вы все же хотите изменить папку, вам следует переустановить сборку. install.installer.fabric-quilt-api.warning=%1$s является модом и будет установлен в папку mod в сборке игры. Пожалуйста, не меняйте рабочую папку сборки, иначе %1$s не будет работать. Если вы все же хотите изменить папку, вам следует переустановить сборку.
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -640,7 +640,7 @@ install.installer.depend=Вимагає %s
install.installer.do_not_install=Не встановлювати install.installer.do_not_install=Не встановлювати
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=Попередження: Fabric API - це мод, і він буде встановлений у каталог модів екземпляра гри. Не змінюйте робочий каталог гри, інакше Fabric API не працюватиме. Якщо ви все ж хочете змінити каталог, вам слід перевстановити його. install.installer.fabric-quilt-api.warning=%1$s - це мод, і він буде встановлений у каталог модів екземпляра гри. Не змінюйте робочий каталог гри, інакше %1$s не працюватиме. Якщо ви все ж хочете змінити каталог, вам слід перевстановити його.
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -518,7 +518,7 @@ install.installer.depend=需要先安裝 %s
install.installer.do_not_install=不安裝 install.installer.do_not_install=不安裝
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=警告Fabric API 是一個模組,將會被安裝到新遊戲的模組目錄。請你在安裝遊戲後不要修改目前遊戲的「執行路徑」設定。如果你在之後修改了相關設定,則需要重新安裝 Fabric API install.installer.fabric-quilt-api.warning=%1$s 是一個模組,將會被安裝到新遊戲的模組目錄。請你在安裝遊戲後不要修改目前遊戲的「執行路徑」設定。如果你在之後修改了相關設定,則需要重新安裝 %1$s
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft

View File

@@ -522,7 +522,7 @@ install.installer.depend=需要先安装 %s
install.installer.do_not_install=不安装 install.installer.do_not_install=不安装
install.installer.fabric=Fabric install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=警告Fabric API 是一个模组,将会被安装到新游戏的模组文件夹。请你在安装游戏后不要修改当前游戏的“运行路径”设置。如果你在之后修改了相关设置,则需要重新安装 Fabric API install.installer.fabric-quilt-api.warning=%1$s 是一个模组,将会被安装到新游戏的模组文件夹。请你在安装游戏后不要修改当前游戏的“版本隔离”设置。如果你在之后修改了相关设置,则需要重新安装 %1$s
install.installer.forge=Forge install.installer.forge=Forge
install.installer.neoforge=NeoForge install.installer.neoforge=NeoForge
install.installer.game=Minecraft install.installer.game=Minecraft