mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- Allows for sorting by value in the cardshop.
This commit is contained in:
@@ -252,7 +252,7 @@ public class Gui_DeckEditor_Menu extends JMenuBar implements NewConstants {
|
||||
//private String column[] = {"Qty", "Name", "Cost", "Color", "Type", "Stats", "Rarity"};
|
||||
Gui_DeckEditor g = (Gui_DeckEditor) deckDisplay;
|
||||
|
||||
g.getTopTableModel().sort(7, true);
|
||||
g.getTopTableModel().sort(99, true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ class TableModel extends AbstractTableModel {
|
||||
column.setPreferredWidth(40);
|
||||
column.setMaxWidth(40);
|
||||
}
|
||||
|
||||
}//for
|
||||
|
||||
for(int j = 0; j < table.getColumnCount(); j++) {
|
||||
|
||||
@@ -92,7 +92,12 @@ public class TableSorter implements Comparator<Card>, NewConstants
|
||||
aCom = getRarity(a);
|
||||
bCom = getRarity(b);
|
||||
}
|
||||
else if (column == 7)//New First
|
||||
else if (column == 7)//Value
|
||||
{
|
||||
aCom = getValue(a);
|
||||
bCom = getValue(b);
|
||||
}
|
||||
else if (column == 99)//New First
|
||||
{
|
||||
aCom = sortNewFirst(a);
|
||||
bCom = sortNewFirst(b);
|
||||
@@ -128,6 +133,11 @@ public class TableSorter implements Comparator<Card>, NewConstants
|
||||
return Integer.valueOf(5);
|
||||
}
|
||||
|
||||
final private Long getValue(Card c)
|
||||
{
|
||||
return c.getValue();
|
||||
}
|
||||
|
||||
final public static String getColor(Card c)
|
||||
{
|
||||
ArrayList list = CardUtil.getColors(c);
|
||||
|
||||
Reference in New Issue
Block a user