- Temporary crash prevention measure for manifested split cards (until the problem with the view of such cards can be figured out)

This commit is contained in:
Agetian
2017-06-06 14:27:20 +00:00
parent 0045be2e84
commit f1fa86a08a
2 changed files with 15 additions and 11 deletions

View File

@@ -372,11 +372,13 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
if (!showSplitMana) { if (!showSplitMana) {
drawManaCost(g, card.getCurrentState().getManaCost(), 0); drawManaCost(g, card.getCurrentState().getManaCost(), 0);
} else { } else {
PaperCard pc = StaticData.instance().getCommonCards().getCard(card.getName()); if (!card.getName().isEmpty()) { // FIXME: temporary crash prevention measure for face-down (manifested) split cards
int ofs = pc != null && Card.getCardForUi(pc).hasKeyword("Aftermath") ? -12 : 12; PaperCard pc = StaticData.instance().getCommonCards().getCard(card.getName());
int ofs = pc != null && Card.getCardForUi(pc).hasKeyword("Aftermath") ? -12 : 12;
drawManaCost(g, card.getCurrentState().getManaCost(), ofs); drawManaCost(g, card.getCurrentState().getManaCost(), ofs);
drawManaCost(g, card.getAlternateState().getManaCost(), -ofs); drawManaCost(g, card.getAlternateState().getManaCost(), -ofs);
}
} }
} }

View File

@@ -379,15 +379,17 @@ public class CardRenderer {
if (showCardManaCostOverlay(card)) { if (showCardManaCostOverlay(card)) {
float manaSymbolSize = w / 4; float manaSymbolSize = w / 4;
if (card.isSplitCard() && card.hasAlternateState()) { if (card.isSplitCard() && card.hasAlternateState()) {
float dy = manaSymbolSize / 2 + Utils.scale(5); if (!card.getName().isEmpty()) { // FIXME: temporary crash prevention measure for face-down (manifested) split cards
float dy = manaSymbolSize / 2 + Utils.scale(5);
PaperCard pc = StaticData.instance().getCommonCards().getCard(card.getName()); PaperCard pc = StaticData.instance().getCommonCards().getCard(card.getName());
if (Card.getCardForUi(pc).hasKeyword("Aftermath")){ if (Card.getCardForUi(pc).hasKeyword("Aftermath")){
dy *= -1; // flip card costs for Aftermath cards dy *= -1; // flip card costs for Aftermath cards
}
drawManaCost(g, card.getAlternateState().getManaCost(), x - padding, y - dy, w + 2 * padding, h, manaSymbolSize);
drawManaCost(g, card.getCurrentState().getManaCost(), x - padding, y + dy, w + 2 * padding, h, manaSymbolSize);
} }
drawManaCost(g, card.getAlternateState().getManaCost(), x - padding, y - dy, w + 2 * padding, h, manaSymbolSize);
drawManaCost(g, card.getCurrentState().getManaCost(), x - padding, y + dy, w + 2 * padding, h, manaSymbolSize);
} }
else { else {
drawManaCost(g, card.getCurrentState().getManaCost(), x - padding, y, w + 2 * padding, h, manaSymbolSize); drawManaCost(g, card.getCurrentState().getManaCost(), x - padding, y, w + 2 * padding, h, manaSymbolSize);