mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- 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:
@@ -21,7 +21,7 @@ import javax.swing.*;
|
|||||||
import java.awt.*;
|
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")
|
@SuppressWarnings("serial")
|
||||||
public class IntegerRenderer extends ItemCellRenderer {
|
public class IntegerRenderer extends ItemCellRenderer {
|
||||||
@@ -36,7 +36,7 @@ public class IntegerRenderer extends ItemCellRenderer {
|
|||||||
public final Component getTableCellRendererComponent(final JTable table, Object value0,
|
public final Component getTableCellRendererComponent(final JTable table, Object value0,
|
||||||
final boolean isSelected, final boolean hasFocus, final int row, final int column) {
|
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);
|
return super.getTableCellRendererComponent(table, value0, isSelected, hasFocus, row, column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ public enum ColumnDef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Integer toCMC(final InventoryItem i) {
|
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) {
|
private static CardRarity toRarity(final InventoryItem i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user