Prevent *NEW* appearing in lists that don't have New column

This commit is contained in:
drdev
2014-07-18 06:07:12 +00:00
parent 5df9136ae9
commit 14cc111e2c

View File

@@ -62,12 +62,12 @@ public final class SpellShopManager extends ItemManager<InventoryItem> {
float totalHeight = h + 2 * FList.PADDING; float totalHeight = h + 2 * FList.PADDING;
float cardArtWidth = totalHeight * CardRenderer.CARD_ART_RATIO; float cardArtWidth = totalHeight * CardRenderer.CARD_ART_RATIO;
String suffix = FModel.getQuest().getCards().isNew(value.getKey()) ? " *NEW*" : null;
if (value.getKey() instanceof PaperCard) { if (value.getKey() instanceof PaperCard) {
String suffix = getConfig().getCols().containsKey(ColumnDef.NEW) && FModel.getQuest().getCards().isNew(value.getKey()) ? " *NEW*" : null;
CardRenderer.drawCardListItem(g, font, foreColor, (PaperCard)value.getKey(), value.getValue(), suffix, x, y, w, h); CardRenderer.drawCardListItem(g, font, foreColor, (PaperCard)value.getKey(), value.getValue(), suffix, x, y, w, h);
} }
else { else {
g.drawText(value.getValue().toString() + " " + value.getKey().toString() + (suffix == null ? "" : suffix), font, foreColor, x + cardArtWidth, y, w - cardArtWidth, h, false, HAlignment.LEFT, true); g.drawText(value.getValue().toString() + " " + value.getKey().toString(), font, foreColor, x + cardArtWidth, y, w - cardArtWidth, h, false, HAlignment.LEFT, true);
Texture image = ImageCache.getImage(value.getKey()); Texture image = ImageCache.getImage(value.getKey());
if (image != null) { if (image != null) {
float imageRatio = (float)image.getWidth() / (float)image.getHeight(); float imageRatio = (float)image.getWidth() / (float)image.getHeight();