mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Add Forge SetLogo for Desktop and Mobile
Common, Uncommon, Rare, Mythic and Special Forge logos
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,6 +32,7 @@ public class FSkin {
|
||||
private static final Map<Integer, TextureRegion> sleeves = new HashMap<>(64);
|
||||
private static final Map<Integer, TextureRegion> borders = new HashMap<>();
|
||||
private static final Map<Integer, TextureRegion> deckbox = new HashMap<>();
|
||||
private static final Map<Integer, TextureRegion> setlogo = new HashMap<>();
|
||||
|
||||
private static Array<String> allSkins;
|
||||
private static FileHandle preferredDir;
|
||||
@@ -217,6 +218,8 @@ public class FSkin {
|
||||
final FileHandle f11 = getSkinFile(ForgeConstants.SPRITE_BUTTONS_FILE);
|
||||
final FileHandle f12 = getSkinFile(ForgeConstants.SPRITE_START_FILE);
|
||||
final FileHandle f13 = getDefaultSkinFile(ForgeConstants.SPRITE_DECKBOX_FILE);
|
||||
final FileHandle f14 = getDefaultSkinFile(ForgeConstants.SPRITE_SETLOGO_FILE);
|
||||
final FileHandle f15 = getSkinFile(ForgeConstants.SPRITE_SETLOGO_FILE);
|
||||
|
||||
try {
|
||||
textures.put(f1.path(), new Texture(f1));
|
||||
@@ -388,6 +391,20 @@ public class FSkin {
|
||||
FSkin.deckbox.put(1, new TextureRegion(deckboxes, 492, 2, 488, 680));
|
||||
//generic deck box
|
||||
FSkin.deckbox.put(2, new TextureRegion(deckboxes, 982, 2, 488, 680));
|
||||
//setlogo
|
||||
Texture setlogos = f15.exists() ? new Texture(f15, textureFilter) : new Texture(f14, textureFilter);
|
||||
if (textureFilter)
|
||||
setlogos.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||
//common logo
|
||||
FSkin.setlogo.put(0, new TextureRegion(setlogos, 2, 2, 520, 451));
|
||||
//uncommon logo
|
||||
FSkin.setlogo.put(1, new TextureRegion(setlogos, 2, 455, 520, 451));
|
||||
//rare logo
|
||||
FSkin.setlogo.put(2, new TextureRegion(setlogos, 2, 908, 520, 451));
|
||||
//mythic logo
|
||||
FSkin.setlogo.put(3, new TextureRegion(setlogos, 2, 1361, 520, 451));
|
||||
//special logo
|
||||
FSkin.setlogo.put(4, new TextureRegion(setlogos, 2, 1814, 520, 451));
|
||||
|
||||
preferredIcons.dispose();
|
||||
pxDefaultAvatars.dispose();
|
||||
|
||||
@@ -95,10 +95,17 @@ public enum FSkinImage implements FImage {
|
||||
MANA_Z (FSkinProp.IMG_MANA_Z, SourceFile.MANAICONS),
|
||||
|
||||
//CMC ranges
|
||||
CMC_LOW (FSkinProp.IMG_CMC_LOW, SourceFile.MANAICONS),
|
||||
CMC_LOW_MID (FSkinProp.IMG_CMC_LOW_MID, SourceFile.MANAICONS),
|
||||
CMC_MID_HIGH (FSkinProp.IMG_CMC_MID_HIGH, SourceFile.MANAICONS),
|
||||
CMC_HIGH (FSkinProp.IMG_CMC_HIGH, SourceFile.MANAICONS),
|
||||
CMC_LOW (FSkinProp.IMG_CMC_LOW, SourceFile.MANAICONS),
|
||||
CMC_LOW_MID (FSkinProp.IMG_CMC_LOW_MID, SourceFile.MANAICONS),
|
||||
CMC_MID_HIGH (FSkinProp.IMG_CMC_MID_HIGH, SourceFile.MANAICONS),
|
||||
CMC_HIGH (FSkinProp.IMG_CMC_HIGH, SourceFile.MANAICONS),
|
||||
|
||||
//Setlogo
|
||||
SET_COMMON (FSkinProp.IMG_SETLOGO_COMMON, SourceFile.SETLOGOS),
|
||||
SET_UNCOMMON (FSkinProp.IMG_SETLOGO_UNCOMMON, SourceFile.SETLOGOS),
|
||||
SET_RARE (FSkinProp.IMG_SETLOGO_RARE, SourceFile.SETLOGOS),
|
||||
SET_MYTHIC (FSkinProp.IMG_SETLOGO_MYTHIC, SourceFile.SETLOGOS),
|
||||
SET_SPECIAL (FSkinProp.IMG_SETLOGO_SPECIAL, SourceFile.SETLOGOS),
|
||||
|
||||
//Gameplay
|
||||
TAP (FSkinProp.IMG_TAP, SourceFile.MANAICONS),
|
||||
@@ -422,6 +429,7 @@ public enum FSkinImage implements FImage {
|
||||
BUTTONS(ForgeConstants.SPRITE_BUTTONS_FILE),
|
||||
BTNSTART(ForgeConstants.SPRITE_START_FILE),
|
||||
MANAICONS(ForgeConstants.SPRITE_MANAICONS_FILE),
|
||||
SETLOGOS(ForgeConstants.SPRITE_SETLOGO_FILE),
|
||||
PLANAR_CONQUEST(ForgeConstants.SPRITE_PLANAR_CONQUEST_FILE);
|
||||
|
||||
private final String filename;
|
||||
|
||||
@@ -233,10 +233,23 @@ public class CardImageRenderer {
|
||||
float padding = h / 8;
|
||||
|
||||
//draw square icon for rarity
|
||||
float iconSize = h * 0.55f;
|
||||
float iconSize = h * 0.9f;
|
||||
float iconPadding = (h - iconSize) / 2;
|
||||
w -= iconSize + iconPadding * 2;
|
||||
g.fillRect(CardRenderer.getRarityColor(state.getRarity()), x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
//g.fillRect(CardRenderer.getRarityColor(state.getRarity()), x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
if (state.getRarity() == null) {
|
||||
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
} else if (state.getRarity() == CardRarity.Special ) {
|
||||
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
} else if (state.getRarity() == CardRarity.MythicRare) {
|
||||
g.drawImage(FSkinImage.SET_MYTHIC, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
} else if (state.getRarity() == CardRarity.Rare) {
|
||||
g.drawImage(FSkinImage.SET_RARE, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
} else if (state.getRarity() == CardRarity.Uncommon) {
|
||||
g.drawImage(FSkinImage.SET_UNCOMMON, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
} else {
|
||||
g.drawImage(FSkinImage.SET_COMMON, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
}
|
||||
|
||||
//draw type
|
||||
x += padding;
|
||||
|
||||
BIN
forge-gui/res/skins/default/sprite_setlogo.png
Normal file
BIN
forge-gui/res/skins/default/sprite_setlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
@@ -120,6 +120,7 @@ public final class ForgeConstants {
|
||||
public static final String SPRITE_SLEEVES2_FILE = "sprite_sleeves2.png";
|
||||
public static final String SPRITE_FAVICONS_FILE = "sprite_favicons.png";
|
||||
public static final String SPRITE_PLANAR_CONQUEST_FILE = "sprite_planar_conquest.png";
|
||||
public static final String SPRITE_SETLOGO_FILE = "sprite_setlogo.png";
|
||||
public static final String FONT_FILE = "font1.ttf";
|
||||
public static final String SPLASH_BG_FILE = "bg_splash.png";
|
||||
public static final String MATCH_BG_FILE = "bg_match.jpg";
|
||||
|
||||
@@ -395,6 +395,13 @@ public enum FSkinProp {
|
||||
IMG_DECK_CARD_ART (new int[] {492, 2, 488, 680}, PropType.DECKBOX),
|
||||
IMG_DECK_GENERIC (new int[] {982, 2, 488, 680}, PropType.DECKBOX),
|
||||
|
||||
//FOR SETLOGO
|
||||
IMG_SETLOGO_COMMON (new int[] {2, 2, 520, 451}, PropType.SETLOGO),
|
||||
IMG_SETLOGO_UNCOMMON (new int[] {2, 455, 520, 451}, PropType.SETLOGO),
|
||||
IMG_SETLOGO_RARE (new int[] {2, 908, 520, 451}, PropType.SETLOGO),
|
||||
IMG_SETLOGO_MYTHIC (new int[] {2, 1361, 520, 451}, PropType.SETLOGO),
|
||||
IMG_SETLOGO_SPECIAL (new int[] {2, 1814, 520, 451}, PropType.SETLOGO),
|
||||
|
||||
IMG_FAV1 (new int[] {0, 0, 100, 100}, PropType.FAVICON),
|
||||
IMG_FAV2 (new int[] {100, 0, 100, 100}, PropType.FAVICON),
|
||||
IMG_FAV3 (new int[] {200, 0, 100, 100}, PropType.FAVICON),
|
||||
@@ -497,6 +504,7 @@ public enum FSkinProp {
|
||||
MANAICONS,
|
||||
PLANAR_CONQUEST,
|
||||
DECKBOX,
|
||||
SETLOGO,
|
||||
FAVICON
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user