mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-13 09:17:59 +00:00
Merge pull request #4119 from kevlahnota/newmaster2
update DefaultItemRenderer title/ability name
This commit is contained in:
@@ -362,12 +362,13 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
}
|
||||
//update manacost text to draw symbols instead
|
||||
else if (value != null && value.toString().contains(" {")) {
|
||||
String[] values = value.toString().split(" ");
|
||||
String cost = TextUtil.fastReplace(value.toString().substring(value.toString().indexOf(" {")), "}{", " ");
|
||||
int manaStringindex = value.toString().indexOf(" {");
|
||||
String title = value.toString().substring(0, manaStringindex - 1); //support ability/name with spaces...
|
||||
String cost = TextUtil.fastReplace(value.toString().substring(manaStringindex), "}{", " ");
|
||||
cost = TextUtil.fastReplace(TextUtil.fastReplace(cost, "{", ""), "}", "");
|
||||
ManaCost manaCost = new ManaCost(new ManaCostParser(cost));
|
||||
CardFaceSymbols.drawManaCost(g, manaCost, x + font.getBounds(values[0] + " ").width, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
g.drawText(values[0], font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
CardFaceSymbols.drawManaCost(g, manaCost, x + font.getBounds(title).width, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
g.drawText(title, font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
} else {
|
||||
if (value != null)
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
|
||||
Reference in New Issue
Block a user