- For now, disregard both -1 and Integer.MAX_VALUE when rendering integer components in a table.

- Unfortunately, this means that Spinal Parasite does not have its P/T visualized in the deck editor table; but at least there won't be a lot of -1's elsewhere in the editor. Couldn't find a way to fix both of these at the same time for now.
- Revert processing default CMC as Integer.MAX_VALUE for the UI purposes.
This commit is contained in:
Agetian
2016-10-09 15:17:58 +00:00
parent 2b73fb48f4
commit b3a49e005f
2 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ import javax.swing.*;
import java.awt.*;
/**
* A quick converter to avoid Integer.MAX_VALUE being displayed for unapplicable values.
* A quick converter to avoid -1 and Integer.MAX_VALUE being displayed for unapplicable values.
*/
@SuppressWarnings("serial")
public class IntegerRenderer extends ItemCellRenderer {
@@ -36,7 +36,7 @@ public class IntegerRenderer extends ItemCellRenderer {
public final Component getTableCellRendererComponent(final JTable table, Object value0,
final boolean isSelected, final boolean hasFocus, final int row, final int column) {
if (value0 == null || (int)value0 == Integer.MAX_VALUE) { value0 = "-"; }
if (value0 == null || (int)value0 == Integer.MAX_VALUE || (int)value0 == -1) { value0 = "-"; }
return super.getTableCellRendererComponent(table, value0, isSelected, hasFocus, row, column);
}
}

View File

@@ -442,7 +442,7 @@ public enum ColumnDef {
}
private static Integer toCMC(final InventoryItem i) {
return i instanceof PaperCard ? ((IPaperCard) i).getRules().getManaCost().getCMC() : Integer.MAX_VALUE;
return i instanceof PaperCard ? ((IPaperCard) i).getRules().getManaCost().getCMC() : -1;
}
private static CardRarity toRarity(final InventoryItem i) {