mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.198.1
This commit is contained in:
52
js/filter-decks.js
Normal file
52
js/filter-decks.js
Normal 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;
|
||||
Reference in New Issue
Block a user