mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed bug that the path for zip files of the card images is always the default path and never the individual defined preferences path.
This commit is contained in:
parent
f017ab903c
commit
ced533709d
1 changed files with 8 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue