mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +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.*;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user