mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
..
This commit is contained in:
@@ -357,16 +357,20 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
|
||||
@Override
|
||||
public void drawValue(Graphics g, T value, FSkinFont font, FSkinColor foreColor, boolean pressed, float x, float y, float w, float h) {
|
||||
if (value instanceof CardView) {
|
||||
CardRenderer.drawCardListItem(g, font, foreColor, (CardView) value, 0, null, x, y, w, h, compactModeHandler.isCompactMode());
|
||||
}
|
||||
//update manacost text to draw symbols instead
|
||||
if (value.toString().contains(" {")){
|
||||
else if (value != null && value.toString().contains(" {")) {
|
||||
String[] values = value.toString().split(" ");
|
||||
String cost = TextUtil.fastReplace(values[1],"}{", " ");
|
||||
cost = TextUtil.fastReplace(TextUtil.fastReplace(cost,"{", ""),"}", "");
|
||||
String cost = TextUtil.fastReplace(value.toString().substring(value.toString().indexOf(" {")), "}{", " ");
|
||||
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);
|
||||
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);
|
||||
} else {
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
if (value != null)
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user