mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Added "E" to the to be replaced symbols with icon in rule text.
This commit is contained in:
parent
6ad012fa87
commit
e49c92e80c
1 changed files with 9 additions and 9 deletions
|
|
@ -43,7 +43,7 @@ public class ManaSymbols {
|
||||||
private static String cachedPath;
|
private static String cachedPath;
|
||||||
private static final String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG",
|
private static final String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG",
|
||||||
"BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU",
|
"BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU",
|
||||||
"WP", "UP", "BP", "RP", "GP", "X", "C"};
|
"WP", "UP", "BP", "RP", "GP", "X", "C", "E"};
|
||||||
|
|
||||||
public static void loadImages() {
|
public static void loadImages() {
|
||||||
renameSymbols(getSymbolsPath() + File.separator + "symbols");
|
renameSymbols(getSymbolsPath() + File.separator + "symbols");
|
||||||
|
|
@ -58,11 +58,11 @@ public class ManaSymbols {
|
||||||
}
|
}
|
||||||
for (String set : setCodes) {
|
for (String set : setCodes) {
|
||||||
String[] codes = new String[]{"C", "U", "R", "M"};
|
String[] codes = new String[]{"C", "U", "R", "M"};
|
||||||
|
|
||||||
Map<String, Image> rarityImages = new HashMap<>();
|
Map<String, Image> rarityImages = new HashMap<>();
|
||||||
setImages.put(set, rarityImages);
|
setImages.put(set, rarityImages);
|
||||||
|
|
||||||
for (String rarityCode: codes) {
|
for (String rarityCode : codes) {
|
||||||
File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-" + rarityCode + ".jpg");
|
File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-" + rarityCode + ".jpg");
|
||||||
try {
|
try {
|
||||||
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
|
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
|
||||||
|
|
@ -80,7 +80,7 @@ public class ManaSymbols {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
|
File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
|
@ -285,7 +285,7 @@ public class ManaSymbols {
|
||||||
if (symbolFilesFound) {
|
if (symbolFilesFound) {
|
||||||
replaced = REPLACE_SYMBOLS_PATTERN.matcher(value).replaceAll(
|
replaced = REPLACE_SYMBOLS_PATTERN.matcher(value).replaceAll(
|
||||||
"<img src='file:" + getSymbolsPath(true) + "/symbols/" + resourcePath + "/$1$2.gif' alt='$1$2' width=" + symbolSize
|
"<img src='file:" + getSymbolsPath(true) + "/symbols/" + resourcePath + "/$1$2.gif' alt='$1$2' width=" + symbolSize
|
||||||
+ " height=" + symbolSize + ">");
|
+ " height=" + symbolSize + ">");
|
||||||
}
|
}
|
||||||
replaced = replaced.replace("|source|", "{source}");
|
replaced = replaced.replace("|source|", "{source}");
|
||||||
replaced = replaced.replace("|this|", "{this}");
|
replaced = replaced.replace("|this|", "{this}");
|
||||||
|
|
@ -307,20 +307,20 @@ public class ManaSymbols {
|
||||||
public static Image getSetSymbolImage(String set) {
|
public static Image getSetSymbolImage(String set) {
|
||||||
return getSetSymbolImage(set, "C");
|
return getSetSymbolImage(set, "C");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Image getSetSymbolImage(String set, String rarity) {
|
public static Image getSetSymbolImage(String set, String rarity) {
|
||||||
Map<String, Image> rarityImages = setImages.get(set);
|
Map<String, Image> rarityImages = setImages.get(set);
|
||||||
if (rarityImages != null) {
|
if (rarityImages != null) {
|
||||||
return rarityImages.get(rarity);
|
return rarityImages.get(rarity);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BufferedImage getSizedManaSymbol(String symbol) {
|
public static BufferedImage getSizedManaSymbol(String symbol) {
|
||||||
return getSizedManaSymbol(symbol, GUISizeHelper.symbolDialogSize);
|
return getSizedManaSymbol(symbol, GUISizeHelper.symbolDialogSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BufferedImage getSizedManaSymbol(String symbol, int size) {
|
public static BufferedImage getSizedManaSymbol(String symbol, int size) {
|
||||||
if (!manaImages.containsKey(size)) {
|
if (!manaImages.containsKey(size)) {
|
||||||
loadSymbolsImages(size);
|
loadSymbolsImages(size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue