mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Custom Editions are now included in Advanced Search Filters
This commit is contained in:
@@ -116,7 +116,10 @@ public class AdvancedSearch {
|
|||||||
CARD_SET("lblSet", PaperCard.class, FilterOperator.SINGLE_LIST_OPS, new CustomListEvaluator<PaperCard, CardEdition>(FModel.getMagicDb().getSortedEditions(), CardEdition.FN_GET_CODE) {
|
CARD_SET("lblSet", PaperCard.class, FilterOperator.SINGLE_LIST_OPS, new CustomListEvaluator<PaperCard, CardEdition>(FModel.getMagicDb().getSortedEditions(), CardEdition.FN_GET_CODE) {
|
||||||
@Override
|
@Override
|
||||||
protected CardEdition getItemValue(PaperCard input) {
|
protected CardEdition getItemValue(PaperCard input) {
|
||||||
return FModel.getMagicDb().getEditions().get(input.getEdition());
|
CardEdition edition = FModel.getMagicDb().getEditions().get(input.getEdition());
|
||||||
|
if (edition == null) // try custom editions
|
||||||
|
edition = FModel.getMagicDb().getCustomEditions().get(input.getEdition());
|
||||||
|
return edition;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
CARD_FORMAT("lblFormat", PaperCard.class, FilterOperator.MULTI_LIST_OPS, new CustomListEvaluator<PaperCard, GameFormat>((List<GameFormat>)FModel.getFormats().getFilterList()) {
|
CARD_FORMAT("lblFormat", PaperCard.class, FilterOperator.MULTI_LIST_OPS, new CustomListEvaluator<PaperCard, GameFormat>((List<GameFormat>)FModel.getFormats().getFilterList()) {
|
||||||
@@ -330,7 +333,10 @@ public class AdvancedSearch {
|
|||||||
@Override
|
@Override
|
||||||
protected CardEdition getItemValue(InventoryItem input) {
|
protected CardEdition getItemValue(InventoryItem input) {
|
||||||
if (input instanceof PaperCard) {
|
if (input instanceof PaperCard) {
|
||||||
return FModel.getMagicDb().getEditions().get(((PaperCard)input).getEdition());
|
CardEdition set = FModel.getMagicDb().getEditions().get(((PaperCard)input).getEdition());
|
||||||
|
if (set == null) // try custom set
|
||||||
|
set = FModel.getMagicDb().getCustomEditions().get(((PaperCard)input).getEdition());
|
||||||
|
return set;
|
||||||
} else if (input instanceof SealedProduct) {
|
} else if (input instanceof SealedProduct) {
|
||||||
return FModel.getMagicDb().getEditions().get(((SealedProduct)input).getEdition());
|
return FModel.getMagicDb().getEditions().get(((SealedProduct)input).getEdition());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user