feat(download): category

This commit is contained in:
huanghongxun
2021-10-10 22:20:32 +08:00
parent 0fd8a78972
commit 7d5a73828d
5 changed files with 16 additions and 7 deletions

View File

@@ -94,7 +94,7 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage
}));
modTab.setNodeSupplier(loadVersionFor(() -> new ModDownloadListPage((profile, version, file) -> download(profile, version, file, "mods"), true)));
resourcePackTab.setNodeSupplier(loadVersionFor(() -> new DownloadListPage(CurseForgeRemoteModRepository.RESOURCE_PACKS, (profile, version, file) -> download(profile, version, file, "resourcepacks"))));
// customizationTab.setNodeSupplier(() -> new ModDownloadListPage(CurseModManager.CUSTOMIZATIONS, this::download));
customizationTab.setNodeSupplier(loadVersionFor(() -> new DownloadListPage(CurseForgeRemoteModRepository.CUSTOMIZATIONS)));
worldTab.setNodeSupplier(loadVersionFor(() -> new DownloadListPage(CurseForgeRemoteModRepository.WORLDS)));
tab = new TabHeader(newGameTab, modpackTab, modTab, resourcePackTab, worldTab);
@@ -107,24 +107,26 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage
{
AdvancedListBox sideBar = new AdvancedListBox()
.startCategory(i18n("download.game"))
.addNavigationDrawerItem(item -> {
item.setTitle(i18n("game"));
item.setLeftGraphic(wrap(SVG::gamepad));
item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(newGameTab));
item.setOnAction(e -> tab.select(newGameTab));
})
.addNavigationDrawerItem(item -> {
item.setTitle(i18n("mods"));
item.setLeftGraphic(wrap(SVG::puzzle));
item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(modTab));
item.setOnAction(e -> tab.select(modTab));
})
.addNavigationDrawerItem(settingsItem -> {
settingsItem.setTitle(i18n("modpack"));
settingsItem.setLeftGraphic(wrap(SVG::pack));
settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(modpackTab));
settingsItem.setOnAction(e -> tab.select(modpackTab));
})
.startCategory(i18n("download.content"))
.addNavigationDrawerItem(item -> {
item.setTitle(i18n("mods"));
item.setLeftGraphic(wrap(SVG::puzzle));
item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(modTab));
item.setOnAction(e -> tab.select(modTab));
})
.addNavigationDrawerItem(item -> {
item.setTitle(i18n("resourcepack"));
item.setLeftGraphic(wrap(SVG::textureBox));

View File

@@ -267,12 +267,14 @@ curse.sort.total_downloads=Total Downloads
download=Download
download.code.404=File not found on the remote server: %s
download.content=Game Contents
download.curseforge.customization=Light and shadow, and game customization
download.existing=The file cannot be saved because it already exists. You can choose 'Save As' to save the file elsewhere.
download.external_link=Open Download Site
download.failed=Failed to download %1$s, response code: %2$d
download.failed.empty=No candidates. Click here to return.
download.failed.refresh=Unable to download version list. Click here to retry.
download.game=Game Downloads
download.provider.mcbbs=MCBBS (https://www.mcbbs.net/)
download.provider.bmclapi=BMCLAPI (bangbang93, https://bmclapi2.bangbang93.com/)
download.provider.mojang=Mojang (OptiFine download service is provided by BMCLAPI)

View File

@@ -267,12 +267,14 @@ curse.sort.total_downloads=下載量
download=下載
download.code.404=遠端伺服器沒有需要下載的檔案: %s
download.content=遊戲內容
download.curseforge.customization=光影與遊戲定制
download.existing=檔案已存在,無法保存。你可以選擇另存為將檔案保存至其他地方。
download.external_link=打開下載網站
download.failed=下載失敗: %1$s錯誤碼%2$d
download.failed.empty=沒有能安裝的版本,按一下此處返回。
download.failed.refresh=載入版本列表失敗,按一下此處重試。
download.game=新遊戲
download.provider.mcbbs=我的世界中文論壇 (MCBBS, https://www.mcbbs.net/)
download.provider.bmclapi=BMCLAPI (bangbang93https://bmclapi2.bangbang93.com/)
download.provider.mojang=官方伺服器 (OptiFine 自動安裝的下載來源是 BMCLAPI)

View File

@@ -267,12 +267,14 @@ curse.sort.total_downloads=下载量
download=下载
download.code.404=远程服务器不包含需要下载的文件: %s
download.content=游戏内容
download.curseforge.customization=光影与游戏定制
download.existing=文件已存在,无法保存。你可以选择另存为将文件保存至其他地方。
download.external_link=打开下载网站
download.failed=下载失败: %1$s错误码%2$d
download.failed.empty=没有可供安装的版本,点击此处返回。
download.failed.refresh=加载版本列表失败,点击此处重试。
download.game=新游戏
download.provider.mcbbs=我的世界中文论坛 (MCBBS, https://www.mcbbs.net/)
download.provider.bmclapi=BMCLAPIbangbang93https://bmclapi2.bangbang93.com/
download.provider.mojang=官方OptiFine 自动安装使用 BMCLAPI 下载源)

View File

@@ -162,6 +162,7 @@ public final class CurseForgeRemoteModRepository implements RemoteModRepository
public static final CurseForgeRemoteModRepository MODPACKS = new CurseForgeRemoteModRepository(SECTION_MODPACK);
public static final CurseForgeRemoteModRepository RESOURCE_PACKS = new CurseForgeRemoteModRepository(SECTION_RESOURCE_PACK);
public static final CurseForgeRemoteModRepository WORLDS = new CurseForgeRemoteModRepository(SECTION_WORLD);
public static final CurseForgeRemoteModRepository CUSTOMIZATIONS = new CurseForgeRemoteModRepository(SECTION_CUSTOMIZATION);
public static class Category {
private final int id;