From 4bc07e5311cc35476eb1908d10c9add0ce6f38ea Mon Sep 17 00:00:00 2001 From: Chris H Date: Sat, 15 Feb 2025 22:21:13 -0500 Subject: [PATCH] Disable bulk images from the UI --- .../home/settings/VSubmenuDownloaders.java | 63 +++++++------------ .../src/forge/screens/settings/FilesPage.java | 56 ++++++++--------- .../properties/ForgeConstants.java | 4 +- .../properties/ForgePreferences.java | 2 +- 4 files changed, 54 insertions(+), 71 deletions(-) diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuDownloaders.java b/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuDownloaders.java index 0c18d309623..0bba6cf1d5d 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuDownloaders.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuDownloaders.java @@ -81,45 +81,32 @@ public enum VSubmenuDownloaders implements IVSubmenu { pnlContent.setOpaque(false); - if (javaRecentEnough()) { - // Github actions now uploading the latest version predictably. So we should be able to use this again. - pnlContent.add(btnCheckForUpdates, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblCheckForUpdates")), constraintsLBL); + pnlContent.add(_makeLabel("Bulk downloaders have been disabled. Please use auto-downloader for now."), constraintsLBL); - pnlContent.add(btnDownloadPics, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPics")), constraintsLBL); + // Github actions now uploading the latest version predictably. So we should be able to use this again. + pnlContent.add(btnCheckForUpdates, constraintsBTN); + pnlContent.add(_makeLabel(localizer.getMessage("lblCheckForUpdates")), constraintsLBL); - pnlContent.add(btnDownloadPicsHQ, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPicsHQ")), constraintsLBL); +// pnlContent.add(btnDownloadPics, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPics")), constraintsLBL); +// +// pnlContent.add(btnDownloadPicsHQ, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPicsHQ")), constraintsLBL); +// +// pnlContent.add(btnDownloadSetPics, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadSetPics")), constraintsLBL); +// +// pnlContent.add(btnDownloadQuestImages, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadQuestImages")), constraintsLBL); +// +// pnlContent.add(btnDownloadAchievementImages, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadAchievementImages")), constraintsLBL); - pnlContent.add(btnDownloadSetPics, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadSetPics")), constraintsLBL); + pnlContent.add(btnDownloadPrices, constraintsBTN); + pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPrices")), constraintsLBL); - pnlContent.add(btnDownloadQuestImages, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadQuestImages")), constraintsLBL); - - pnlContent.add(btnDownloadAchievementImages, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadAchievementImages")), constraintsLBL); - - pnlContent.add(btnDownloadPrices, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPrices")), constraintsLBL); - - pnlContent.add(btnDownloadSkins, constraintsBTN); - pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadSkins")), constraintsLBL); - } else { - String text = localizer.getMessage("lblYourVersionOfJavaIsTooOld"); - FLabel label = new FLabel.Builder().fontAlign(SwingConstants.CENTER).text(text).fontStyle(Font.BOLD).fontSize(18).build(); - pnlContent.add(label, "w 90%!, h 25px!, center, gap 0 0 30px 3px"); - - text = localizer.getMessage("lblPleaseUpdateToTheLatestVersionOfJava"); - label = new FLabel.Builder().fontAlign(SwingConstants.CENTER).text(text).fontStyle(Font.BOLD).fontSize(18).build(); - pnlContent.add(label, "w 90%!, h 25px!, center, gap 0 0 0 36px"); - - text = localizer.getMessage("lblYoureRunning") + " " + System.getProperty("java.version"); - text = text + " . " + localizer.getMessage("lblYouNeedAtLeastJavaVersion") ; - label = new FLabel.Builder().fontAlign(SwingConstants.CENTER).text(text).fontStyle(Font.BOLD).fontSize(18).build(); - pnlContent.add(label, "w 90%!, h 25px!, center, gap 0 0 0 36px"); - } +// pnlContent.add(btnDownloadSkins, constraintsBTN); +// pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadSkins")), constraintsLBL); pnlContent.add(btnListImageData, constraintsBTN); pnlContent.add(_makeLabel(localizer.getMessage("lblListImageData")), constraintsLBL); @@ -137,12 +124,6 @@ public enum VSubmenuDownloaders implements IVSubmenu { pnlContent.add(_makeLabel(localizer.getMessage("lblLicensing")), constraintsLBL); } - private boolean javaRecentEnough() { - RuntimeVersion javaVersion = RuntimeVersion.of(System.getProperty("java.version")); - - return javaVersion.getMajor() >= 9 || (javaVersion.getMajor() >= 1 && (javaVersion.getMinor() > 8 || (javaVersion.getMinor() == 8 && javaVersion.getUpdate() >= 101))); - } - /* (non-Javadoc) * @see forge.view.home.IViewSubmenu#populate() */ diff --git a/forge-gui-mobile/src/forge/screens/settings/FilesPage.java b/forge-gui-mobile/src/forge/screens/settings/FilesPage.java index e5c39ca1755..5edf6b4b839 100644 --- a/forge-gui-mobile/src/forge/screens/settings/FilesPage.java +++ b/forge-gui-mobile/src/forge/screens/settings/FilesPage.java @@ -80,34 +80,34 @@ public class FilesPage extends TabPage { } }, 0); //content downloaders - lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadPics"), - Forge.getLocalizer().getMessage("lblDownloadPics")) { - @Override - protected GuiDownloadService createService() { - return new GuiDownloadPicturesLQ(); - } - }, 1); - lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadSetPics"), - Forge.getLocalizer().getMessage("lblDownloadSetPics")) { - @Override - protected GuiDownloadService createService() { - return new GuiDownloadSetPicturesLQ(); - } - }, 1); - lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadQuestImages"), - Forge.getLocalizer().getMessage("lblDownloadQuestImages")) { - @Override - protected GuiDownloadService createService() { - return new GuiDownloadQuestImages(); - } - }, 1); - lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadAchievementImages"), - Forge.getLocalizer().getMessage("lblDownloadAchievementImages")) { - @Override - protected GuiDownloadService createService() { - return new GuiDownloadAchievementImages(); - } - }, 1); +// lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadPics"), +// Forge.getLocalizer().getMessage("lblDownloadPics")) { +// @Override +// protected GuiDownloadService createService() { +// return new GuiDownloadPicturesLQ(); +// } +// }, 1); +// lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadSetPics"), +// Forge.getLocalizer().getMessage("lblDownloadSetPics")) { +// @Override +// protected GuiDownloadService createService() { +// return new GuiDownloadSetPicturesLQ(); +// } +// }, 1); +// lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadQuestImages"), +// Forge.getLocalizer().getMessage("lblDownloadQuestImages")) { +// @Override +// protected GuiDownloadService createService() { +// return new GuiDownloadQuestImages(); +// } +// }, 1); +// lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadAchievementImages"), +// Forge.getLocalizer().getMessage("lblDownloadAchievementImages")) { +// @Override +// protected GuiDownloadService createService() { +// return new GuiDownloadAchievementImages(); +// } +// }, 1); lstItems.addItem(new ContentDownloader(Forge.getLocalizer().getMessage("btnDownloadPrices"), Forge.getLocalizer().getMessage("lblDownloadPrices")) { @Override diff --git a/forge-gui/src/main/java/forge/localinstance/properties/ForgeConstants.java b/forge-gui/src/main/java/forge/localinstance/properties/ForgeConstants.java index 6ba0fd93bb3..e646a0b8816 100644 --- a/forge-gui/src/main/java/forge/localinstance/properties/ForgeConstants.java +++ b/forge-gui/src/main/java/forge/localinstance/properties/ForgeConstants.java @@ -329,9 +329,11 @@ public final class ForgeConstants { // URLs private static final String URL_CARDFORGE = "https://downloads.cardforge.org"; + private static final String GITHUB_ASSETS_BASE = "https://raw.githubusercontent.com/Card-Forge/forge-extras/refs/heads/main/"; + public static final String URL_PIC_DOWNLOAD = URL_CARDFORGE + "/images/cards/"; public static final String URL_TOKEN_DOWNLOAD = URL_CARDFORGE + "/images/tokens/"; - public static final String URL_PRICE_DOWNLOAD = URL_CARDFORGE + "/all-prices.txt"; + public static final String URL_PRICE_DOWNLOAD = GITHUB_ASSETS_BASE + "all-prices.txt"; private static final String URL_SCRYFALL = "https://api.scryfall.com"; public static final String URL_PIC_SCRYFALL_DOWNLOAD = URL_SCRYFALL + "/cards/"; diff --git a/forge-gui/src/main/java/forge/localinstance/properties/ForgePreferences.java b/forge-gui/src/main/java/forge/localinstance/properties/ForgePreferences.java index 8bfac293546..f034c1146ec 100644 --- a/forge-gui/src/main/java/forge/localinstance/properties/ForgePreferences.java +++ b/forge-gui/src/main/java/forge/localinstance/properties/ForgePreferences.java @@ -83,7 +83,7 @@ public class ForgePreferences extends PreferencesStore { UI_OVERLAY_CARD_ID ("true"), UI_OVERLAY_ABILITY_ICONS("true"), UI_OVERLAY_DRAFT_RANKING("true"), - UI_ENABLE_ONLINE_IMAGE_FETCHER ("false"), + UI_ENABLE_ONLINE_IMAGE_FETCHER ("true"), UI_PREFERRED_ART("LATEST_ART_ALL_EDITIONS"), UI_SMART_CARD_ART("false"), UI_AUTO_AIDECK_SELECTION("true"),