This commit is contained in:
TheGiddyLimit
2024-01-01 19:34:49 +00:00
parent 332769043f
commit 8117ebddc5
1748 changed files with 2544409 additions and 1 deletions

52
js/filter-decks.js Normal file
View File

@@ -0,0 +1,52 @@
"use strict";
class PageFilterDecks extends PageFilter {
constructor () {
super();
this._miscFilter = new Filter({
header: "Miscellaneous",
items: ["Has Card Art", "SRD"],
isMiscFilter: true,
selFn: it => it === "Has Card Art",
});
}
static mutateForFilters (ent) {
ent._fMisc = [];
if (ent.srd) ent._fMisc.push("SRD");
if (ent.hasCardArt) ent._fMisc.push("Has Card Art");
}
addToFilters (ent, isExcluded) {
if (isExcluded) return;
this._sourceFilter.addItem(ent.source);
}
async _pPopulateBoxOptions (opts) {
opts.filters = [
this._sourceFilter,
this._miscFilter,
];
}
toDisplay (values, ent) {
return this._filterBox.toDisplay(
values,
ent.source,
ent._fMisc,
);
}
}
globalThis.PageFilterDecks = PageFilterDecks;
class ListSyntaxDecks extends ListUiUtil.ListSyntax {
static _INDEXABLE_PROPS_ENTRIES = [
"entries",
"cards",
];
}
globalThis.ListSyntaxDecks = ListSyntaxDecks;