From ced533709d01f35e5d306e9776e0b067e86662a1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 15 Nov 2012 20:52:44 +0100 Subject: [PATCH] Fixed bug that the path for zip files of the card images is always the default path and never the individual defined preferences path. --- .../org/mage/plugins/card/utils/CardImageUtils.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java index ee9aed1b1fb..a2306830610 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java @@ -41,7 +41,9 @@ public class CardImageUtils { pathCache.put(card, filePath); } } else { - filePath = getImagePath(card, null); + String useDefault = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_USE_DEFAULT, "true"); + String path = useDefault.equals("true") ? null : PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PATH, null); + filePath = getImagePath(card, path); file = new TFile(filePath); } @@ -53,18 +55,20 @@ public class CardImageUtils { } private static String getTokenImagePath(CardInfo card) { - String filename = getImagePath(card, null); + String useDefault = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_USE_DEFAULT, "true"); + String path = useDefault.equals("true") ? null : PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PATH, null); + String filename = getImagePath(card, path); TFile file = new TFile(filename); if (!file.exists()) { CardInfo updated = new CardInfo(card); updated.setName(card.getName() + " 1"); - filename = getImagePath(updated, null); + filename = getImagePath(updated, path); file = new TFile(filename); if (!file.exists()) { updated = new CardInfo(card); updated.setName(card.getName() + " 2"); - filename = getImagePath(updated, null); + filename = getImagePath(updated, path); } }