mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Fix so new cards appear on top in inventory
Fix so *NEW* appears next to new card names in spell shop
This commit is contained in:
@@ -231,7 +231,7 @@ public enum ColumnDef {
|
||||
return from.getValue();
|
||||
}
|
||||
}),
|
||||
NEW("New", "New", 30, true, SortState.ASC,
|
||||
NEW("New", "New", 30, true, SortState.DESC,
|
||||
null, null), //functions will be set later
|
||||
PRICE("Price", "Price", 35, true, SortState.DESC,
|
||||
null, null),
|
||||
|
||||
@@ -736,6 +736,10 @@ public final class QuestUtilCards {
|
||||
return this.fnNewGet;
|
||||
}
|
||||
|
||||
public boolean isNew(InventoryItem item) {
|
||||
return qa.getNewCardList().contains(item);
|
||||
}
|
||||
|
||||
// These functions provide a way to sort and compare cards in a table
|
||||
// according to their new-ness
|
||||
// It might be a good idea to store them in a base class for both quest-mode
|
||||
@@ -746,8 +750,7 @@ public final class QuestUtilCards {
|
||||
new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
||||
@Override
|
||||
public Comparable<?> apply(final Entry<InventoryItem, Integer> from) {
|
||||
return QuestUtilCards.this.qa.getNewCardList().contains(from.getKey()) ? Integer.valueOf(1) : Integer
|
||||
.valueOf(0);
|
||||
return isNew(from.getKey()) ? Integer.valueOf(1) : Integer.valueOf(0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -756,7 +759,7 @@ public final class QuestUtilCards {
|
||||
new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
||||
@Override
|
||||
public Object apply(final Entry<? extends InventoryItem, Integer> from) {
|
||||
return QuestUtilCards.this.qa.getNewCardList().contains(from.getKey()) ? "NEW" : "";
|
||||
return isNew(from.getKey()) ? "NEW" : "";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user