diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java index 6218916ff..dcb4ed4fe 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java @@ -25,6 +25,7 @@ import org.jackhuang.hmcl.download.*; import org.jackhuang.hmcl.download.game.GameRemoteVersion; import org.jackhuang.hmcl.mod.RemoteMod; import org.jackhuang.hmcl.mod.curse.CurseForgeRemoteModRepository; +import org.jackhuang.hmcl.mod.modrinth.ModrinthRemoteModRepository; import org.jackhuang.hmcl.setting.DownloadProviders; import org.jackhuang.hmcl.setting.Profile; import org.jackhuang.hmcl.setting.Profiles; @@ -72,6 +73,7 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage private final TabHeader.Tab modTab = new TabHeader.Tab<>("modTab"); private final TabHeader.Tab modpackTab = new TabHeader.Tab<>("modpackTab"); private final TabHeader.Tab resourcePackTab = new TabHeader.Tab<>("resourcePackTab"); + private final TabHeader.Tab shaderTab = new TabHeader.Tab<>("shaderTab"); private final TabHeader.Tab worldTab = new TabHeader.Tab<>("worldTab"); private final TransitionPane transitionPane = new TransitionPane(); private final DownloadNavigator versionPageNavigator = new DownloadNavigator(); @@ -98,8 +100,9 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage })); modTab.setNodeSupplier(loadVersionFor(() -> HMCLLocalizedDownloadListPage.ofMod((profile, version, file) -> download(profile, version, file, "mods"), true))); resourcePackTab.setNodeSupplier(loadVersionFor(() -> HMCLLocalizedDownloadListPage.ofResourcePack((profile, version, file) -> download(profile, version, file, "resourcepacks"), true))); + shaderTab.setNodeSupplier(loadVersionFor(() -> new DownloadListPage(ModrinthRemoteModRepository.SHADER_PACKS, (profile, version, file) -> download(profile, version, file, "shaderpacks"), true))); worldTab.setNodeSupplier(loadVersionFor(() -> new DownloadListPage(CurseForgeRemoteModRepository.WORLDS))); - tab = new TabHeader(newGameTab, modpackTab, modTab, resourcePackTab, worldTab); + tab = new TabHeader(newGameTab, modpackTab, modTab, resourcePackTab, shaderTab, worldTab); Profiles.registerVersionsListener(this::loadVersions); @@ -115,6 +118,7 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage .startCategory(i18n("download.content").toUpperCase(Locale.ROOT)) .addNavigationDrawerTab(tab, modTab, i18n("mods"), SVG.EXTENSION) .addNavigationDrawerTab(tab, resourcePackTab, i18n("resourcepack"), SVG.TEXTURE) + .addNavigationDrawerTab(tab, shaderTab, i18n("download.shader"), SVG.WB_SUNNY) .addNavigationDrawerTab(tab, worldTab, i18n("world"), SVG.PUBLIC); FXUtils.setLimitWidth(sideBar, 200); setLeft(sideBar); @@ -186,6 +190,9 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage if (resourcePackTab.isInitialized()) { resourcePackTab.getNode().loadVersion(profile, null); } + if (shaderTab.isInitialized()) { + shaderTab.getNode().loadVersion(profile, null); + } if (worldTab.isInitialized()) { worldTab.getNode().loadVersion(profile, null); } diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 9ba019292..d8906b07c 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -332,6 +332,7 @@ download=Download download.hint=Install games and modpacks or download mods, resource packs, and worlds. download.code.404=File "%s" not found on the remote server. download.content=Addons +download.shader=Shaders download.curseforge.unavailable=This HMCL build does not support access to CurseForge. Please use the official build to access CurseForge. download.existing=The file cannot be saved because it already exists. You can click "Save As" to save the file elsewhere. download.external_link=Visit Download Website diff --git a/HMCL/src/main/resources/assets/lang/I18N_es.properties b/HMCL/src/main/resources/assets/lang/I18N_es.properties index 919b2ce73..357c62738 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_es.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_es.properties @@ -333,6 +333,7 @@ download=Descargar download.hint=Instalar juegos y modpacks o descargar mods, paquetes de recursos y mundos. download.code.404=Archivo no encontrado en el servidor remoto: %s download.content=Complementos +download.shader=Sombreadores download.curseforge.unavailable=Esta versión de HMCL no permite acceder a CurseForge. Utilice la versión oficial para acceder a CurseForge. download.existing=El archivo no se puede guardar porque ya existe. Puedes hacer clic en «Guardar como» para guardar el archivo en otro lugar. download.external_link=Abrir sitio web diff --git a/HMCL/src/main/resources/assets/lang/I18N_ja.properties b/HMCL/src/main/resources/assets/lang/I18N_ja.properties index 9327ca31c..34c49fff6 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ja.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ja.properties @@ -289,6 +289,7 @@ download=ダウンロード download.hint=ゲームや modpack をインストールするか、mod、リソース パック、マップをダウンロードします download.code.404=リモートサーバーにファイルが見つかりません:%s download.content=ゲームコンテンツ +download.shader=シェーダー download.existing=ファイルは既に存在するため、保存できません。「名前を付けて保存」を選択して、ファイルを別の場所に保存できます。 download.external_link=ダウンロードサイトを開く download.failed=%1$s のダウンロードに失敗しました、応答コード:%2$d diff --git a/HMCL/src/main/resources/assets/lang/I18N_ru.properties b/HMCL/src/main/resources/assets/lang/I18N_ru.properties index 551a8d798..6b7aa986f 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ru.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ru.properties @@ -334,6 +334,7 @@ download=Скачать download.hint=Установить игры и модпаки или скачать моды, пакеты ресурсов и миры. download.code.404=Файл «%s» не найден на удаленном сервере. download.content=Аддоны +download.shader=Шейдеры download.curseforge.unavailable=Эта сборка HMCL не поддерживает доступ к CurseForge. Пожалуйста, используйте официальную сборку для доступа к CurseForge. download.existing=Файл существует и по этому не может быть сохранён. Можно использовать «Сохранить как», чтобы сохранить файл в другом месте. download.external_link=Открыть сайт diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 20502e4c6..af4e5e569 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -334,6 +334,7 @@ download=下載 download.hint=安裝遊戲和模組包或下載模組、資源包和地圖 download.code.404=遠端伺服器沒有需要下載的檔案:%s download.content=遊戲內容 +download.shader=光影 download.curseforge.unavailable=這個 HMCL 版本不支援訪問 CurseForge。請使用官方版本進行下載。 download.existing=檔案已存在,無法儲存。你可以將檔案儲存至其他地方。 download.external_link=開啟下載網站 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 5c77828c6..76899b97f 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -342,6 +342,7 @@ download=下载 download.hint=安装游戏和整合包或下载模组、资源包和地图 download.code.404=远程服务器不包含需要下载的文件: %s\n你可以点击右上角帮助按钮进行求助。 download.content=游戏内容 +download.shader=光影 download.curseforge.unavailable=此 HMCL 版本不支持访问 CurseForge。请使用官方版本进行下载。 download.existing=文件已存在,无法保存。你可以将文件保存至其他地方。 download.external_link=打开下载网站 diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java index ba101cab7..24557e73f 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java @@ -46,6 +46,7 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository { public static final ModrinthRemoteModRepository MODS = new ModrinthRemoteModRepository("mod"); public static final ModrinthRemoteModRepository MODPACKS = new ModrinthRemoteModRepository("modpack"); public static final ModrinthRemoteModRepository RESOURCE_PACKS = new ModrinthRemoteModRepository("resourcepack"); + public static final ModrinthRemoteModRepository SHADER_PACKS = new ModrinthRemoteModRepository("shader"); private static final String PREFIX = "https://api.modrinth.com";