mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
[Mobile] fix Adventure Card on "Art" mode
This commit is contained in:
@@ -822,7 +822,7 @@ public class CardView extends GameEntityView {
|
|||||||
updateZoneText(c);
|
updateZoneText(c);
|
||||||
updateDamage(c);
|
updateDamage(c);
|
||||||
|
|
||||||
if (getBackup() == null && !c.isFaceDown() && (c.hasBackSide()||c.isFlipCard())) {
|
if (getBackup() == null && !c.isFaceDown() && (c.hasBackSide()||c.isFlipCard()||c.isAdventureCard())) {
|
||||||
set(TrackableProperty.PaperCardBackup, c.getPaperCard());
|
set(TrackableProperty.PaperCardBackup, c.getPaperCard());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package forge.assets;
|
package forge.assets;
|
||||||
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ public class FSkin {
|
|||||||
|
|
||||||
//ensure skins directory exists
|
//ensure skins directory exists
|
||||||
final FileHandle dir = Gdx.files.absolute(ForgeConstants.CACHE_SKINS_DIR);
|
final FileHandle dir = Gdx.files.absolute(ForgeConstants.CACHE_SKINS_DIR);
|
||||||
if (!Files.exists(dir.file().toPath()) || !Files.isDirectory(dir.file().toPath())) {
|
if (!dir.exists() || !dir.isDirectory()) {
|
||||||
//if skins directory doesn't exist, point to internal assets/skin directory instead for the sake of the splash screen
|
//if skins directory doesn't exist, point to internal assets/skin directory instead for the sake of the splash screen
|
||||||
preferredDir = Gdx.files.internal("fallback_skin");
|
preferredDir = Gdx.files.internal("fallback_skin");
|
||||||
}
|
}
|
||||||
@@ -119,7 +118,7 @@ public class FSkin {
|
|||||||
|
|
||||||
// Non-default (preferred) skin name and dir.
|
// Non-default (preferred) skin name and dir.
|
||||||
preferredDir = Gdx.files.absolute(preferredName.equals("default") ? ForgeConstants.BASE_SKINS_DIR + preferredName : ForgeConstants.CACHE_SKINS_DIR + preferredName);
|
preferredDir = Gdx.files.absolute(preferredName.equals("default") ? ForgeConstants.BASE_SKINS_DIR + preferredName : ForgeConstants.CACHE_SKINS_DIR + preferredName);
|
||||||
if (!Files.exists(preferredDir.file().toPath()) || !Files.isDirectory(preferredDir.file().toPath())) {
|
if (!preferredDir.exists() || !preferredDir.isDirectory()) {
|
||||||
preferredDir.mkdirs();
|
preferredDir.mkdirs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +127,7 @@ public class FSkin {
|
|||||||
|
|
||||||
//load theme logo while changing skins
|
//load theme logo while changing skins
|
||||||
final FileHandle theme_logo = getSkinFile("hd_logo.png");
|
final FileHandle theme_logo = getSkinFile("hd_logo.png");
|
||||||
if (Files.exists(theme_logo.file().toPath())) {
|
if (theme_logo.exists()) {
|
||||||
Texture txOverlay = new Texture(theme_logo, true);
|
Texture txOverlay = new Texture(theme_logo, true);
|
||||||
txOverlay.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
txOverlay.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||||
hdLogo = txOverlay;
|
hdLogo = txOverlay;
|
||||||
@@ -136,7 +135,7 @@ public class FSkin {
|
|||||||
hdLogo = null;
|
hdLogo = null;
|
||||||
}
|
}
|
||||||
final FileHandle duals_overlay = getDefaultSkinFile("overlay_alpha.png");
|
final FileHandle duals_overlay = getDefaultSkinFile("overlay_alpha.png");
|
||||||
if (Files.exists(duals_overlay.file().toPath())) {
|
if (duals_overlay.exists()) {
|
||||||
Texture txAlphaLines = new Texture(duals_overlay, true);
|
Texture txAlphaLines = new Texture(duals_overlay, true);
|
||||||
txAlphaLines.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
txAlphaLines.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||||
overlay_alpha = txAlphaLines;
|
overlay_alpha = txAlphaLines;
|
||||||
@@ -148,7 +147,7 @@ public class FSkin {
|
|||||||
final FileHandle f = getSkinFile("bg_splash.png");
|
final FileHandle f = getSkinFile("bg_splash.png");
|
||||||
final FileHandle f2 = getSkinFile("bg_splash_hd.png"); //HD Splashscreen
|
final FileHandle f2 = getSkinFile("bg_splash_hd.png"); //HD Splashscreen
|
||||||
|
|
||||||
if (!Files.exists(f.file().toPath())) {
|
if (!f.exists()) {
|
||||||
if (!skinName.equals("default")) {
|
if (!skinName.equals("default")) {
|
||||||
FSkin.loadLight("default", splashScreen);
|
FSkin.loadLight("default", splashScreen);
|
||||||
}
|
}
|
||||||
@@ -160,7 +159,7 @@ public class FSkin {
|
|||||||
final int w = txSplash.getWidth();
|
final int w = txSplash.getWidth();
|
||||||
final int h = txSplash.getHeight();
|
final int h = txSplash.getHeight();
|
||||||
|
|
||||||
if (Files.exists(f2.file().toPath())) {
|
if (f2.exists()) {
|
||||||
Texture txSplashHD = new Texture(f2, true);
|
Texture txSplashHD = new Texture(f2, true);
|
||||||
txSplashHD.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
txSplashHD.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||||
splashScreen.setBackground(new TextureRegion(txSplashHD));
|
splashScreen.setBackground(new TextureRegion(txSplashHD));
|
||||||
@@ -238,26 +237,26 @@ public class FSkin {
|
|||||||
try {
|
try {
|
||||||
textures.put(f1.path(), new Texture(f1));
|
textures.put(f1.path(), new Texture(f1));
|
||||||
Pixmap preferredIcons = new Pixmap(f1);
|
Pixmap preferredIcons = new Pixmap(f1);
|
||||||
if (Files.exists(f2.file().toPath())) {
|
if (f2.exists()) {
|
||||||
textures.put(f2.path(), new Texture(f2));
|
textures.put(f2.path(), new Texture(f2));
|
||||||
preferredIcons = new Pixmap(f2);
|
preferredIcons = new Pixmap(f2);
|
||||||
}
|
}
|
||||||
|
|
||||||
textures.put(f3.path(), new Texture(f3));
|
textures.put(f3.path(), new Texture(f3));
|
||||||
if (Files.exists(f6.file().toPath())) {
|
if (f6.exists()) {
|
||||||
textures.put(f6.path(), new Texture(f6));
|
textures.put(f6.path(), new Texture(f6));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
textures.put(f6.path(), textures.get(f3.path()));
|
textures.put(f6.path(), textures.get(f3.path()));
|
||||||
}
|
}
|
||||||
if (Files.exists(f7.file().toPath())){
|
if (f7.exists()){
|
||||||
Texture t = new Texture(f7, true);
|
Texture t = new Texture(f7, true);
|
||||||
//t.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
//t.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||||
textures.put(f7.path(), t);
|
textures.put(f7.path(), t);
|
||||||
}
|
}
|
||||||
|
|
||||||
//hdbuttons
|
//hdbuttons
|
||||||
if (Files.exists(f11.file().toPath())) {
|
if (f11.exists()) {
|
||||||
if (GuiBase.isAndroid() && Forge.totalDeviceRAM <5000) {
|
if (GuiBase.isAndroid() && Forge.totalDeviceRAM <5000) {
|
||||||
Forge.hdbuttons = false;
|
Forge.hdbuttons = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -267,7 +266,7 @@ public class FSkin {
|
|||||||
Forge.hdbuttons = true;
|
Forge.hdbuttons = true;
|
||||||
}
|
}
|
||||||
} else { Forge.hdbuttons = false; } //how to refresh buttons when a theme don't have hd buttons?
|
} else { Forge.hdbuttons = false; } //how to refresh buttons when a theme don't have hd buttons?
|
||||||
if (Files.exists(f12.file().toPath())) {
|
if (f12.exists()) {
|
||||||
if (GuiBase.isAndroid() && Forge.totalDeviceRAM <5000) {
|
if (GuiBase.isAndroid() && Forge.totalDeviceRAM <5000) {
|
||||||
Forge.hdstart = false;
|
Forge.hdstart = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -317,7 +316,7 @@ public class FSkin {
|
|||||||
if (textureFilter)
|
if (textureFilter)
|
||||||
txDefaultSleeves.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
txDefaultSleeves.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
|
||||||
|
|
||||||
if (Files.exists(f5.file().toPath())) {
|
if (f5.exists()) {
|
||||||
pxPreferredAvatars = new Pixmap(f5);
|
pxPreferredAvatars = new Pixmap(f5);
|
||||||
txPreferredAvatars = new Texture(f5, textureFilter);
|
txPreferredAvatars = new Texture(f5, textureFilter);
|
||||||
if (textureFilter)
|
if (textureFilter)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class CardImageRenderer {
|
|||||||
|
|
||||||
//draw header containing name and mana cost
|
//draw header containing name and mana cost
|
||||||
Color[] headerColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.NAME_BOX_TINT);
|
Color[] headerColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.NAME_BOX_TINT);
|
||||||
drawHeader(g, card, state, headerColors, x, y, w, headerHeight, isFaceDown && !altState);
|
drawHeader(g, card, state, headerColors, x, y, w, headerHeight, isFaceDown && !altState, false);
|
||||||
|
|
||||||
if (pos == CardStackPosition.BehindVert) { return; } //remaining rendering not needed if card is behind another card in a vertical stack
|
if (pos == CardStackPosition.BehindVert) { return; } //remaining rendering not needed if card is behind another card in a vertical stack
|
||||||
boolean onTop = (pos == CardStackPosition.Top);
|
boolean onTop = (pos == CardStackPosition.Top);
|
||||||
@@ -185,38 +185,38 @@ public class CardImageRenderer {
|
|||||||
if (isSaga) {
|
if (isSaga) {
|
||||||
//draw text box
|
//draw text box
|
||||||
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
||||||
drawTextBox(g, card, state, textBoxColors, x + artInset, y-artHeight, (w - 2 * artInset)/2, textBoxHeight+artHeight, onTop, useCardBGTexture, noText);
|
drawTextBox(g, card, state, textBoxColors, x + artInset, y-artHeight, (w - 2 * artInset)/2, textBoxHeight+artHeight, onTop, useCardBGTexture, noText, altState, isFaceDown, canShow, isChoiceList);
|
||||||
y += textBoxHeight;
|
y += textBoxHeight;
|
||||||
|
|
||||||
//draw type line
|
//draw type line
|
||||||
drawTypeLine(g, card, state, canShow, headerColors, x, y, w, typeBoxHeight, noText);
|
drawTypeLine(g, state, canShow, headerColors, x, y, w, typeBoxHeight, noText, false, false);
|
||||||
y += typeBoxHeight;
|
y += typeBoxHeight;
|
||||||
} else if (isClass) {
|
} else if (isClass) {
|
||||||
//draw text box
|
//draw text box
|
||||||
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
||||||
drawTextBox(g, card, state, textBoxColors, x + artInset+(artWidth/2), y-artHeight, (w - 2 * artInset)/2, textBoxHeight+artHeight, onTop, useCardBGTexture, noText);
|
drawTextBox(g, card, state, textBoxColors, x + artInset+(artWidth/2), y-artHeight, (w - 2 * artInset)/2, textBoxHeight+artHeight, onTop, useCardBGTexture, noText, altState, isFaceDown, canShow, isChoiceList);
|
||||||
y += textBoxHeight;
|
y += textBoxHeight;
|
||||||
|
|
||||||
//draw type line
|
//draw type line
|
||||||
drawTypeLine(g, card, state, canShow, headerColors, x, y, w, typeBoxHeight, noText);
|
drawTypeLine(g, state, canShow, headerColors, x, y, w, typeBoxHeight, noText, false, false);
|
||||||
y += typeBoxHeight;
|
y += typeBoxHeight;
|
||||||
} else if (isDungeon) {
|
} else if (isDungeon) {
|
||||||
if (!drawDungeon) {
|
if (!drawDungeon) {
|
||||||
//draw textbox
|
//draw textbox
|
||||||
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
||||||
drawTextBox(g, card, state, textBoxColors, x + artInset, y-artHeight, (w - 2 * artInset), textBoxHeight+artHeight, onTop, useCardBGTexture, noText);
|
drawTextBox(g, card, state, textBoxColors, x + artInset, y-artHeight, (w - 2 * artInset), textBoxHeight+artHeight, onTop, useCardBGTexture, noText, altState, isFaceDown, canShow, isChoiceList);
|
||||||
y += textBoxHeight;
|
y += textBoxHeight;
|
||||||
}
|
}
|
||||||
drawTypeLine(g, card, state, canShow, headerColors, x, y, w, typeBoxHeight, noText);
|
drawTypeLine(g, state, canShow, headerColors, x, y, w, typeBoxHeight, noText, false, false);
|
||||||
y += typeBoxHeight;
|
y += typeBoxHeight;
|
||||||
} else {
|
} else {
|
||||||
//draw type line
|
//draw type line
|
||||||
drawTypeLine(g, card, state, canShow, headerColors, x, y, w, typeBoxHeight, noText);
|
drawTypeLine(g, state, canShow, headerColors, x, y, w, typeBoxHeight, noText, false, false);
|
||||||
y += typeBoxHeight;
|
y += typeBoxHeight;
|
||||||
|
|
||||||
//draw text box
|
//draw text box
|
||||||
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
Color[] textBoxColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.TEXT_BOX_TINT);
|
||||||
drawTextBox(g, card, state, textBoxColors, x + artInset, y, w - 2 * artInset, textBoxHeight, onTop, useCardBGTexture, noText);
|
drawTextBox(g, card, state, textBoxColors, x + artInset, y, w - 2 * artInset, textBoxHeight, onTop, useCardBGTexture, noText, altState, isFaceDown, canShow, isChoiceList);
|
||||||
y += textBoxHeight;
|
y += textBoxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,12 +231,17 @@ public class CardImageRenderer {
|
|||||||
g.drawOutlinedText(artist, TEXT_FONT, Color.WHITE, Color.DARK_GRAY, x+(TYPE_FONT.getCapHeight()/2), y+(TYPE_FONT.getCapHeight()/2), w, h, false, Align.left, false);
|
g.drawOutlinedText(artist, TEXT_FONT, Color.WHITE, Color.DARK_GRAY, x+(TYPE_FONT.getCapHeight()/2), y+(TYPE_FONT.getCapHeight()/2), w, h, false, Align.left, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void drawHeader(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean noText) {
|
private static void drawHeader(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean noText, boolean isAdventure) {
|
||||||
|
float oldAlpha = g.getfloatAlphaComposite();
|
||||||
|
if (isAdventure)
|
||||||
|
g.setAlphaComposite(0.8f);
|
||||||
fillColorBackground(g, colors, x, y, w, h);
|
fillColorBackground(g, colors, x, y, w, h);
|
||||||
|
g.setAlphaComposite(oldAlpha);
|
||||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||||
|
|
||||||
float padding = h / 8;
|
float padding = h / 8;
|
||||||
float manaCostWidth = 0;
|
float manaCostWidth = 0;
|
||||||
|
float manaSymbolSize = isAdventure ? MANA_SYMBOL_SIZE * 0.75f : MANA_SYMBOL_SIZE;
|
||||||
if (!noText) {
|
if (!noText) {
|
||||||
//draw mana cost for card
|
//draw mana cost for card
|
||||||
ManaCost mainManaCost = state.getManaCost();
|
ManaCost mainManaCost = state.getManaCost();
|
||||||
@@ -244,14 +249,14 @@ public class CardImageRenderer {
|
|||||||
//handle rendering both parts of split card
|
//handle rendering both parts of split card
|
||||||
mainManaCost = card.getLeftSplitState().getManaCost();
|
mainManaCost = card.getLeftSplitState().getManaCost();
|
||||||
ManaCost otherManaCost = card.getRightSplitState().getManaCost();
|
ManaCost otherManaCost = card.getRightSplitState().getManaCost();
|
||||||
manaCostWidth = CardFaceSymbols.getWidth(otherManaCost, MANA_SYMBOL_SIZE) + HEADER_PADDING;
|
manaCostWidth = CardFaceSymbols.getWidth(otherManaCost, manaSymbolSize) + HEADER_PADDING;
|
||||||
CardFaceSymbols.drawManaCost(g, otherManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
CardFaceSymbols.drawManaCost(g, otherManaCost, x + w - manaCostWidth, y + (h - manaSymbolSize) / 2, manaSymbolSize);
|
||||||
//draw "//" between two parts of mana cost
|
//draw "//" between two parts of mana cost
|
||||||
manaCostWidth += NAME_FONT.getBounds("//").width + HEADER_PADDING;
|
manaCostWidth += NAME_FONT.getBounds("//").width + HEADER_PADDING;
|
||||||
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, Align.left, true);
|
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, Align.left, true);
|
||||||
}
|
}
|
||||||
manaCostWidth += CardFaceSymbols.getWidth(mainManaCost, MANA_SYMBOL_SIZE) + HEADER_PADDING;
|
manaCostWidth += CardFaceSymbols.getWidth(mainManaCost, manaSymbolSize) + HEADER_PADDING;
|
||||||
CardFaceSymbols.drawManaCost(g, mainManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
CardFaceSymbols.drawManaCost(g, mainManaCost, x + w - manaCostWidth, y + (h - manaSymbolSize) / 2, manaSymbolSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw name for card
|
//draw name for card
|
||||||
@@ -333,7 +338,7 @@ public class CardImageRenderer {
|
|||||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||||
}
|
}
|
||||||
private static void drawSplitCard(CardView card, FImageComplex cardArt, Graphics g, float x, float y, float w, float h, boolean altState, boolean isFaceDown) {
|
private static void drawSplitCard(CardView card, FImageComplex cardArt, Graphics g, float x, float y, float w, float h, boolean altState, boolean isFaceDown) {
|
||||||
CardView alt = CardView.getCardForUi(ImageUtil.getPaperCardFromImageKey(card.getAlternateState().getImageKey()));
|
CardView alt = card.getBackup();
|
||||||
if (alt == null)
|
if (alt == null)
|
||||||
alt = card.getAlternateState().getCard();
|
alt = card.getAlternateState().getCard();
|
||||||
CardView cv = altState && isFaceDown ? alt : card;
|
CardView cv = altState && isFaceDown ? alt : card;
|
||||||
@@ -365,29 +370,35 @@ public class CardImageRenderer {
|
|||||||
else
|
else
|
||||||
g.drawImage(cardArt, x, y, w, h);
|
g.drawImage(cardArt, x, y, w, h);
|
||||||
}
|
}
|
||||||
private static void drawTypeLine(Graphics g, CardView card, CardStateView state, boolean canShow, Color[] colors, float x, float y, float w, float h, boolean noText) {
|
private static void drawTypeLine(Graphics g, CardStateView state, boolean canShow, Color[] colors, float x, float y, float w, float h, boolean noText, boolean noRarity, boolean isAdventure) {
|
||||||
|
float oldAlpha = g.getfloatAlphaComposite();
|
||||||
|
if (isAdventure)
|
||||||
|
g.setAlphaComposite(0.6f);
|
||||||
fillColorBackground(g, colors, x, y, w, h);
|
fillColorBackground(g, colors, x, y, w, h);
|
||||||
|
g.setAlphaComposite(oldAlpha);
|
||||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||||
|
|
||||||
float padding = h / 8;
|
float padding = h / 8;
|
||||||
|
|
||||||
//draw square icon for rarity
|
//draw square icon for rarity
|
||||||
float iconSize = h * 0.9f;
|
if (!noRarity) {
|
||||||
float iconPadding = (h - iconSize) / 2;
|
float iconSize = h * 0.9f;
|
||||||
w -= iconSize + iconPadding * 2;
|
float iconPadding = (h - iconSize) / 2;
|
||||||
//g.fillRect(CardRenderer.getRarityColor(state.getRarity()), x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
w -= iconSize + iconPadding * 2;
|
||||||
if (state.getRarity() == null) {
|
//g.fillRect(CardRenderer.getRarityColor(state.getRarity()), x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
if (state.getRarity() == null) {
|
||||||
} else if (state.getRarity() == CardRarity.Special ) {
|
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
} else if (state.getRarity() == CardRarity.Special ) {
|
||||||
} else if (state.getRarity() == CardRarity.MythicRare) {
|
g.drawImage(FSkinImage.SET_SPECIAL, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_MYTHIC, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
} else if (state.getRarity() == CardRarity.MythicRare) {
|
||||||
} else if (state.getRarity() == CardRarity.Rare) {
|
g.drawImage(FSkinImage.SET_MYTHIC, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_RARE, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
} else if (state.getRarity() == CardRarity.Rare) {
|
||||||
} else if (state.getRarity() == CardRarity.Uncommon) {
|
g.drawImage(FSkinImage.SET_RARE, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_UNCOMMON, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
} else if (state.getRarity() == CardRarity.Uncommon) {
|
||||||
} else {
|
g.drawImage(FSkinImage.SET_UNCOMMON, x + w + iconPadding, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||||
g.drawImage(FSkinImage.SET_COMMON, 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
|
//draw type
|
||||||
@@ -400,7 +411,26 @@ public class CardImageRenderer {
|
|||||||
//use text renderer to handle mana symbols and reminder text
|
//use text renderer to handle mana symbols and reminder text
|
||||||
private static final TextRenderer cardTextRenderer = new TextRenderer(true);
|
private static final TextRenderer cardTextRenderer = new TextRenderer(true);
|
||||||
|
|
||||||
private static void drawTextBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean onTop, boolean useCardBGTexture, boolean noText) {
|
private static void drawTextBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean onTop, boolean useCardBGTexture, boolean noText, boolean altstate, boolean isFacedown, boolean canShow, boolean isChoiceList) {
|
||||||
|
if (card.isAdventureCard()) {
|
||||||
|
if ((isFacedown && !altstate) || card.getZone() == ZoneType.Stack || isChoiceList || altstate) {
|
||||||
|
setTextBox(g, card, state, colors, x, y, w, h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
|
||||||
|
} else {
|
||||||
|
//left
|
||||||
|
//float headerHeight = Math.max(MANA_SYMBOL_SIZE + 2 * HEADER_PADDING, 2 * TYPE_FONT.getCapHeight()) + 2;
|
||||||
|
float typeBoxHeight = 2 * TYPE_FONT.getCapHeight();
|
||||||
|
drawHeader(g, card, card.getState(true), colors, x, y, w - (w / 2), typeBoxHeight, noText, true);
|
||||||
|
drawTypeLine(g, card.getState(true), canShow, colors, x, y + typeBoxHeight, w - (w / 2), typeBoxHeight, noText, true, true);
|
||||||
|
float mod = (typeBoxHeight + typeBoxHeight);
|
||||||
|
setTextBox(g, card, state, colors, x, y + mod, w - (w / 2), h - mod, onTop, useCardBGTexture, noText, typeBoxHeight, typeBoxHeight, true, altstate, isFacedown);
|
||||||
|
//right
|
||||||
|
setTextBox(g, card, state, colors, x + w / 2, y, w - (w / 2), h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTextBox(g, card, state, colors, x, y, w, h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static void setTextBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean onTop, boolean useCardBGTexture, boolean noText, float adventureHeaderHeight, float adventureTypeHeight, boolean drawAdventure, boolean altstate, boolean isFaceDown) {
|
||||||
boolean fakeDuals = false;
|
boolean fakeDuals = false;
|
||||||
//update land bg colors
|
//update land bg colors
|
||||||
if (state.isLand()) {
|
if (state.isLand()) {
|
||||||
@@ -419,7 +449,6 @@ public class CardImageRenderer {
|
|||||||
} if (state.origCanProduceColoredMana() == 2) {
|
} if (state.origCanProduceColoredMana() == 2) {
|
||||||
//dual colors
|
//dual colors
|
||||||
Color[] colorPairs = new Color[2];
|
Color[] colorPairs = new Color[2];
|
||||||
Color[] colorPairsBackup = new Color[2];
|
|
||||||
//init Color
|
//init Color
|
||||||
colorPairs[0] = fromDetailColor(DetailColors.WHITE);
|
colorPairs[0] = fromDetailColor(DetailColors.WHITE);
|
||||||
colorPairs[1] = fromDetailColor(DetailColors.WHITE);
|
colorPairs[1] = fromDetailColor(DetailColors.WHITE);
|
||||||
@@ -538,16 +567,44 @@ public class CardImageRenderer {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
boolean needTranslation = true;
|
boolean needTranslation = true;
|
||||||
|
String text = "";
|
||||||
if (card.isToken()) {
|
if (card.isToken()) {
|
||||||
if (card.getCloneOrigin() == null)
|
if (card.getCloneOrigin() == null)
|
||||||
needTranslation = false;
|
needTranslation = false;
|
||||||
}
|
}
|
||||||
if (noText)
|
if (drawAdventure) {
|
||||||
|
// draw left textbox text
|
||||||
|
if (noText)
|
||||||
|
return;
|
||||||
|
if (card.isAdventureCard()) {
|
||||||
|
CardView cv = card.getBackup();
|
||||||
|
if (cv == null || isFaceDown)
|
||||||
|
cv = card;
|
||||||
|
text = cv.getText(cv.getState(true), needTranslation ? CardTranslation.getTranslationTexts(cv.getName(), "") : null);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
text = !card.isSplitCard() ?
|
||||||
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
|
||||||
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (noText)
|
||||||
|
return;
|
||||||
|
if (card.isAdventureCard()) {
|
||||||
|
CardView cv = card.getBackup();
|
||||||
|
if (cv == null || isFaceDown)
|
||||||
|
cv = card;
|
||||||
|
text = cv.getText(cv.getState(false), needTranslation ? CardTranslation.getTranslationTexts(cv.getName(), "") : null);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
text = !card.isSplitCard() ?
|
||||||
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
|
||||||
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(text)) {
|
||||||
return;
|
return;
|
||||||
final String text = !card.isSplitCard() ?
|
}
|
||||||
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
|
|
||||||
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null );
|
|
||||||
if (StringUtils.isEmpty(text)) { return; }
|
|
||||||
|
|
||||||
float padding = TEXT_FONT.getCapHeight() * 0.75f;
|
float padding = TEXT_FONT.getCapHeight() * 0.75f;
|
||||||
x += padding;
|
x += padding;
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class CardZoom extends FOverlay {
|
|||||||
}
|
}
|
||||||
if (flipIconBounds != null && flipIconBounds.contains(x, y)) {
|
if (flipIconBounds != null && flipIconBounds.contains(x, y)) {
|
||||||
if (currentCard.isFaceDown() && currentCard.getBackup() != null) {
|
if (currentCard.isFaceDown() && currentCard.getBackup() != null) {
|
||||||
if (currentCard.getBackup().hasBackSide() || currentCard.getBackup().isFlipCard()) {
|
if (currentCard.getBackup().hasBackSide() || currentCard.getBackup().isFlipCard() || currentCard.getBackup().isAdventureCard()) {
|
||||||
show(currentCard.getBackup());
|
show(currentCard.getBackup());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user