Add Forge SetLogo for Desktop and Mobile

Common, Uncommon, Rare, Mythic and Special Forge logos
This commit is contained in:
Anthony Calosa
2021-08-20 13:22:09 +08:00
parent 3f65f56b31
commit b355d7fc84
8 changed files with 77 additions and 10 deletions

View File

@@ -1108,7 +1108,7 @@ public class FSkin {
private static String preferredDir;
private static String preferredName;
private static BufferedImage bimDefaultSprite, bimFavIcon, bimPreferredSprite, bimFoils, bimQuestDraftDeck, bimOldFoils,
bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities, bimManaIcons, bimDefaultSleeve, bimDefaultSleeve2, bimDefaultDeckbox;
bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities, bimManaIcons, bimDefaultSleeve, bimDefaultSleeve2, bimDefaultDeckbox, bimPrefferedSetLogo;
private static int x0, y0, w0, h0, newW, newH, preferredW, preferredH;
private static int[] tempCoords;
private static int defaultFontSize = 12;
@@ -1246,6 +1246,8 @@ public class FSkin {
final File f12 = new File(defaultDir + ForgeConstants.SPRITE_SLEEVES_FILE);
final File f13 = new File(defaultDir + ForgeConstants.SPRITE_SLEEVES2_FILE);
final File f14 = new File(defaultDir + ForgeConstants.SPRITE_DECKBOX_FILE);
final File f15 = new File(defaultDir + ForgeConstants.SPRITE_SETLOGO_FILE);
final File f16 = new File(preferredDir + ForgeConstants.SPRITE_SETLOGO_FILE);
try {
int p = 0;
@@ -1269,6 +1271,8 @@ public class FSkin {
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimDefaultDeckbox = ImageIO.read(f14);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimPrefferedSetLogo = f16.exists() ? ImageIO.read(f16) : ImageIO.read(f15);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimTrophies = ImageIO.read(f7);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimQuestDraftDeck = ImageIO.read(f8);
@@ -1330,6 +1334,9 @@ public class FSkin {
case DECKBOX:
setImage(prop, bimDefaultDeckbox);
break;
case SETLOGO:
setImage(prop, bimPrefferedSetLogo);
break;
default:
break;
}
@@ -1353,6 +1360,7 @@ public class FSkin {
bimDefaultSleeve.flush();
bimDefaultSleeve2.flush();
bimDefaultDeckbox.flush();
bimPrefferedSetLogo.flush();
bimQuestDraftDeck.flush();
bimTrophies.flush();
bimAbilities.flush();
@@ -1368,6 +1376,7 @@ public class FSkin {
bimDefaultSleeve = null;
bimDefaultSleeve2 = null;
bimDefaultDeckbox = null;
bimPrefferedSetLogo = null;
bimPreferredAvatars = null;
bimQuestDraftDeck = null;
bimTrophies = null;

View File

@@ -717,11 +717,22 @@ public class FCardImageRenderer {
//draw square icon for rarity
if (drawRarity) {
int iconSize = Math.round(h * 0.55f);
int iconSize = Math.round(h * 0.9f);
int iconPadding = (h - iconSize) / 2;
w -= iconSize + iconPadding * 2;
g.setColor(getRarityColor(state.getRarity()));
g.fillRect(x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
if (state.getRarity() == null) {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_SPECIAL), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
} else if (state.getRarity() == CardRarity.Special ) {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_SPECIAL), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
} else if (state.getRarity() == CardRarity.MythicRare) {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_MYTHIC), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
} else if (state.getRarity() == CardRarity.Rare) {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_RARE), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
} else if (state.getRarity() == CardRarity.Uncommon) {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_UNCOMMON), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
} else {
FSkin.drawImage(g, FSkin.getImage(FSkinProp.IMG_SETLOGO_COMMON), x + w + iconPadding, y + (h - iconSize + 1) / 2, iconSize, iconSize);
}
}
//draw type