Fixed set icon load of conflux.

This commit is contained in:
LevelX2 2013-01-08 22:32:05 +01:00
parent 8dab110060
commit 8b4b1691a4
2 changed files with 4 additions and 9 deletions

View file

@ -48,8 +48,7 @@ public class ManaSymbols {
} }
List<String> setCodes = CardRepository.instance.getSetCodes(); List<String> setCodes = CardRepository.instance.getSetCodes();
for (String set : setCodes) { for (String set : setCodes) {
String _set = set.equals("CON") ? "CFX" : set; File file = new File(Constants.RESOURCE_PATH_SET + set + "-C.jpg");
File file = new File(Constants.RESOURCE_PATH_SET + _set + "-C.jpg");
try { try {
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
int width = image.getWidth(null); int width = image.getWidth(null);
@ -77,7 +76,7 @@ public class ManaSymbols {
if (file.exists()) { if (file.exists()) {
continue; continue;
} }
file = new File(Constants.RESOURCE_PATH_SET + _set + "-" + code + ".jpg"); file = new File(Constants.RESOURCE_PATH_SET + set + "-" + code + ".jpg");
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
try { try {
int width = image.getWidth(null); int width = image.getWidth(null);
@ -89,7 +88,7 @@ public class ManaSymbols {
} }
Rectangle r = new Rectangle(15 + dx, (int) (height * (15.0f + dx) / width)); Rectangle r = new Rectangle(15 + dx, (int) (height * (15.0f + dx) / width));
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r); BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
File newFile = new File(Constants.RESOURCE_PATH_SET_SMALL + File.separator + _set + "-" + code + ".png"); File newFile = new File(Constants.RESOURCE_PATH_SET_SMALL + File.separator + set + "-" + code + ".png");
ImageIO.write(resized, "png", newFile); ImageIO.write(resized, "png", newFile);
} }
} catch (Exception e) { } catch (Exception e) {
@ -190,9 +189,6 @@ public class ManaSymbols {
public static String replaceSetCodeWithHTML(String set, String rarity) { public static String replaceSetCodeWithHTML(String set, String rarity) {
String _set = set; String _set = set;
if (_set.equals("CON")) {
_set = "CFX";
}
if (setImagesExist.containsKey(_set)) { if (setImagesExist.containsKey(_set)) {
Integer width = setImagesExist.get(_set).width; Integer width = setImagesExist.get(_set).width;
Integer height = setImagesExist.get(_set).height; Integer height = setImagesExist.get(_set).height;

View file

@ -34,7 +34,7 @@ public class GathererSets implements Iterable<DownloadJob> {
private static final String[] withMythics = {"M10", "M11", "M12", "M13", private static final String[] withMythics = {"M10", "M11", "M12", "M13",
"DDF", "DDF",
"ALA", "CFX", "ARB", "ALA", "CON", "ARB",
"ZEN", "WWK", "ROE", "ZEN", "WWK", "ROE",
"SOM", "MBS", "NPH", "SOM", "MBS", "NPH",
"ISD", "DKA", "AVR", "ISD", "DKA", "AVR",
@ -42,7 +42,6 @@ public class GathererSets implements Iterable<DownloadJob> {
private static final HashMap<String, String> symbolsReplacements = new HashMap<String, String>(); private static final HashMap<String, String> symbolsReplacements = new HashMap<String, String>();
static { static {
symbolsReplacements.put("CFX", "CON");
symbolsReplacements.put("ARN", "AN"); symbolsReplacements.put("ARN", "AN");
symbolsReplacements.put("ATQ", "AQ"); symbolsReplacements.put("ATQ", "AQ");
symbolsReplacements.put("LEG", "LE"); symbolsReplacements.put("LEG", "LE");