[Mobile] cleanup stack item strings

-show optional cost string (ie Kicked, Entwined, etc ) on spells if activated
This commit is contained in:
Anthony Calosa
2021-02-20 16:37:21 +08:00
parent 5055931cbc
commit 51f8f47878

View File

@@ -396,9 +396,12 @@ public class VStack extends FDropDown {
String optionalCostString = !stackInstance.getOptionalCostString().equals("") ? " ("+ stackInstance.getOptionalCostString() + ")" : "";
if (index == -1) {
newtext = TextUtil.fastReplace(TextUtil.fastReplace(text.trim(),"--","-"),"- -","-");
newtext = TextUtil.fastReplace(newtext, "- - ", "- ");
textRenderer.drawText(g, name + " " + (name.length() > 1 ? cId : "") + "\n" + (newtext.length() > 1 ? newtext : ""),
newtext = TextUtil.fastReplace(text.trim(), " ", " ");
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext,"--","-"),"- -","-");
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext, " and .", ".")," .", ".");
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext, "- - ", "- "), ". .", ".");
newtext = TextUtil.fastReplace(newtext, "CARDNAME", name);
textRenderer.drawText(g, name + " " + (name.length() > 1 ? cId : "") + optionalCostString + "\n" + (newtext.length() > 1 ? newtext : ""),
FONT, foreColor, x, y, w, h, y, h, true, Align.left, true);
} else {
@@ -409,10 +412,13 @@ public class VStack extends FDropDown {
if(newtext.equals("\n"+name))
textRenderer.drawText(g, name + " " + cId + optionalCostString, FONT, foreColor, x, y, w, h, y, h, true, Align.left, true);
else {
newtext = TextUtil.fastReplace(newtext, " ", " ");
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext,name+" -","-"), "\n ", "\n");
newtext = "\n"+ TextUtil.fastReplace(newtext.trim(),"--","-");
newtext = TextUtil.fastReplace(newtext, "- - ", "- ");
textRenderer.drawText(g, name+" "+cId+newtext, FONT, foreColor, x, y, w, h, y, h, true, Align.left, true);
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext, " and .", ".")," .", ".");
newtext = TextUtil.fastReplace(TextUtil.fastReplace(newtext, "- - ", "- "), ". .", ".");
newtext = TextUtil.fastReplace(newtext, "CARDNAME", name);
textRenderer.drawText(g, name+" "+cId + optionalCostString +newtext, FONT, foreColor, x, y, w, h, y, h, true, Align.left, true);
}
}