Fix minor card render problems (#8478)

* Missing space

* Unescape line breaks in card descriptions
This commit is contained in:
Eradev
2025-08-22 23:56:21 -04:00
committed by GitHub
parent cdc63f35bb
commit eeca33855d
4 changed files with 11 additions and 3 deletions

View File

@@ -3219,6 +3219,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
desc = TextUtil.fastReplace(desc, "EFFECTSOURCE", getEffectSource().getName());
}
// Ensure no more escaped linebreak are present
desc = desc.replace("\\r", "\r")
.replace("\\n", "\n");
return desc.trim();
}

View File

@@ -938,7 +938,9 @@ public class CardView extends GameEntityView {
sb.append("\r\n\r\nMerged Cards: ").append(mergedCards);
}
return sb.toString().trim();
return sb.toString().trim()
.replace("\\r", "\r")
.replace("\\n", "\n");
}
public CardStateView getCurrentState() {

View File

@@ -67,7 +67,7 @@ public class CostExileFromStack extends CostPart {
final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription();
sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), desc));
sb.append("from stack");
sb.append(" from stack");
return sb.toString();
}

View File

@@ -252,7 +252,9 @@ public class VStack extends FDropDown {
stackInstance = stackInstance0;
CardView card = stackInstance.getSourceCard();
text = stackInstance.getText();
text = stackInstance.getText()
.replace("\\r", "\r")
.replace("\\n", "\n");
if (stackInstance.isOptionalTrigger() &&
stackInstance0.getActivatingPlayer().equals(MatchController.instance.getCurrentPlayer())) {
text = "(OPTIONAL) " + text;