mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
Merge branch 'master' of https://github.com/magefree/mage.git
This commit is contained in:
commit
cc798f1440
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…
Reference in a new issue