mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix so both sides of split card have text displayed when card not on stack
Fix so only the cast half of a split card has its mana cost displayed when it's on the stack
This commit is contained in:
@@ -520,6 +520,11 @@ public class CardView extends GameEntityView {
|
|||||||
}
|
}
|
||||||
sb.append(state.getAbilityText());
|
sb.append(state.getAbilityText());
|
||||||
|
|
||||||
|
if (state.getState() == CardStateName.LeftSplit && getZone() != ZoneType.Stack) {
|
||||||
|
//ensure ability text for right half of split card is included unless spell is on stack
|
||||||
|
sb.append("\r\n\r\n").append(getAlternateState().getAbilityText());
|
||||||
|
}
|
||||||
|
|
||||||
String nonAbilityText = get(TrackableProperty.NonAbilityText);
|
String nonAbilityText = get(TrackableProperty.NonAbilityText);
|
||||||
int blockAdditional = state.getBlockAdditional();
|
int blockAdditional = state.getBlockAdditional();
|
||||||
if (blockAdditional > 1) {
|
if (blockAdditional > 1) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import forge.card.CardEdition;
|
|||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.card.CardView;
|
import forge.game.card.CardView;
|
||||||
import forge.game.card.CardView.CardStateView;
|
import forge.game.card.CardView.CardStateView;
|
||||||
|
import forge.game.zone.ZoneType;
|
||||||
import forge.item.IPaperCard;
|
import forge.item.IPaperCard;
|
||||||
import forge.item.InventoryItemFromSet;
|
import forge.item.InventoryItemFromSet;
|
||||||
import forge.match.MatchUtil;
|
import forge.match.MatchUtil;
|
||||||
@@ -190,9 +191,10 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final String manaCost;
|
final String manaCost;
|
||||||
if (card.isSplitCard() && card.getAlternateState() != null) {
|
if (card.isSplitCard() && card.hasAlternateState() && card.getZone() != ZoneType.Stack) { //only display current state's mana cost when on stack
|
||||||
manaCost = card.getCurrentState().getManaCost() + " // " + card.getAlternateState().getManaCost();
|
manaCost = card.getCurrentState().getManaCost() + " // " + card.getAlternateState().getManaCost();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
manaCost = state.getManaCost().toString();
|
manaCost = state.getManaCost().toString();
|
||||||
}
|
}
|
||||||
nameCostLabel.setText(FSkin.encodeSymbols(CardDetailUtil.formatCardName(card, canShow, isInAltState) + " - " + manaCost, true));
|
nameCostLabel.setText(FSkin.encodeSymbols(CardDetailUtil.formatCardName(card, canShow, isInAltState) + " - " + manaCost, true));
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import forge.card.CardDetailUtil.DetailColors;
|
|||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.game.card.CardView;
|
import forge.game.card.CardView;
|
||||||
import forge.game.card.CardView.CardStateView;
|
import forge.game.card.CardView.CardStateView;
|
||||||
|
import forge.game.zone.ZoneType;
|
||||||
import forge.item.IPaperCard;
|
import forge.item.IPaperCard;
|
||||||
import forge.match.MatchUtil;
|
import forge.match.MatchUtil;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
@@ -398,7 +399,7 @@ public class CardRenderer {
|
|||||||
float manaCostWidth = 0;
|
float manaCostWidth = 0;
|
||||||
if (canShow) {
|
if (canShow) {
|
||||||
ManaCost mainManaCost = state.getManaCost();
|
ManaCost mainManaCost = state.getManaCost();
|
||||||
if (card.isSplitCard() && card.hasAlternateState()) {
|
if (card.isSplitCard() && card.hasAlternateState() && card.getZone() != ZoneType.Stack) { //only display current state's mana cost when on stack
|
||||||
//handle rendering both parts of split card
|
//handle rendering both parts of split card
|
||||||
mainManaCost = state.getManaCost();
|
mainManaCost = state.getManaCost();
|
||||||
ManaCost otherManaCost = card.getAlternateState().getManaCost();
|
ManaCost otherManaCost = card.getAlternateState().getManaCost();
|
||||||
|
|||||||
Reference in New Issue
Block a user