mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Updated display of charm-like spells in the card details panel to look like the new cards in KTK.
This commit is contained in:
@@ -1904,8 +1904,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
sb.append("\r\n\r\n");
|
||||
}
|
||||
if (this.isCommander) {
|
||||
sb.append(getOwner() + "'s Commander\r\n");
|
||||
sb.append(CardFactoryUtil.getCommanderInfo(getOwner()) + "\r\n");
|
||||
sb.append(getOwner()).append("'s Commander\r\n");
|
||||
sb.append(CardFactoryUtil.getCommanderInfo(getOwner())).append("\r\n");
|
||||
}
|
||||
sb.append(this.getAbilityText());
|
||||
|
||||
@@ -2443,6 +2443,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
final String s = this.getSpellText();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
// Give spellText line breaks for easier reading
|
||||
sb.append(s.replaceAll("\\\\r\\\\n", "\r\n"));
|
||||
|
||||
@@ -2457,7 +2458,36 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
// I think SpellAbilities should be displayed after Keywords
|
||||
// Add SpellAbilities
|
||||
for (final SpellAbility element : this.getSpellAbilities()) {
|
||||
sb.append(element.toString() + "\r\n");
|
||||
|
||||
String elementText = element.toString();
|
||||
|
||||
//Determine if a card has multiple choices, then format it in an easier to read list.
|
||||
if (element.getApi().equals(ApiType.Charm)) {
|
||||
|
||||
String chooseText = elementText.split("-")[0].trim();
|
||||
sb.append(chooseText).append("—\r\n");
|
||||
|
||||
String[] choices = elementText.split("-")[1].split(";");
|
||||
|
||||
for (int i = 0; i < choices.length; i++) {
|
||||
String choice = choices[i].trim();
|
||||
|
||||
if (choice.startsWith("Or ") || choice.startsWith("or ")) {
|
||||
choice = choice.substring(3);
|
||||
}
|
||||
|
||||
sb.append("    • ").append(Character.toUpperCase(choice.charAt(0)))
|
||||
.append(choice.substring(1));
|
||||
if (i < choices.length - 1) {
|
||||
sb.append(".");
|
||||
}
|
||||
sb.append("\r\n");
|
||||
}
|
||||
|
||||
} else {
|
||||
sb.append(elementText).append("\r\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Add Keywords
|
||||
|
||||
Reference in New Issue
Block a user