mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[AFR] added dungeon support in image/card view, images download, Card Viewer, verify tests;
This commit is contained in:
parent
654ee7791c
commit
2b2a2d085a
8 changed files with 107 additions and 25 deletions
|
|
@ -318,6 +318,33 @@ public class MageBook extends JComponent {
|
|||
}
|
||||
}
|
||||
|
||||
// dungeons
|
||||
List<CardDownloadData> allDungeons = getTokenCardUrls();
|
||||
for (CardDownloadData dungeon : allDungeons) {
|
||||
if (dungeon.getSet().equals(currentSet)) {
|
||||
try {
|
||||
String className = dungeon.getName();
|
||||
if (dungeon.getTokenClassName() != null && dungeon.getTokenClassName().length() > 0) {
|
||||
if (dungeon.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*dungeon.*")) {
|
||||
className = dungeon.getTokenClassName();
|
||||
className = "mage.game.command.dungeons." + className;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
Class<?> c = Class.forName(className);
|
||||
Constructor<?> cons = c.getConstructor();
|
||||
Object newDungeon = cons.newInstance();
|
||||
if (newDungeon instanceof Dungeon) {
|
||||
((Dungeon) newDungeon).setExpansionSetCodeForImage(currentSet);
|
||||
res.add(newDungeon);
|
||||
}
|
||||
} catch (ClassNotFoundException | InvocationTargetException | IllegalArgumentException | IllegalAccessException | InstantiationException | SecurityException | NoSuchMethodException ex) {
|
||||
// Swallow exception
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -550,7 +550,6 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
// logger.debug("Token: " + set + "/" + card.getName() + " type: " + type);
|
||||
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM:")) {
|
||||
String set = params[2].substring(7);
|
||||
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, "0", false, type, "", "", true, fileName);
|
||||
|
|
@ -571,6 +570,11 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true, fileName);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("DUNGEON:")) {
|
||||
String set = params[2].substring(8);
|
||||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true, fileName);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
} else {
|
||||
logger.error("wrong line format in tokens file: " + line);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue