Do some logic tweaks for the item filter functionality
This commit is contained in:
parent
aab71df1fc
commit
5fe854a0f3
2 changed files with 20 additions and 7 deletions
|
|
@ -114,20 +114,19 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
_itemFiltersActive = new Set();
|
||||
toggleItemFilter(filterName) {
|
||||
if (this._itemFiltersActive.has(filterName)) {
|
||||
this._itemFiltersActive.add(filterName);
|
||||
} else {
|
||||
this._itemFiltersActive.delete(filterName);
|
||||
} else {
|
||||
this._itemFiltersActive.add(filterName);
|
||||
};
|
||||
this.render();
|
||||
};
|
||||
|
||||
get #itemFilters() {
|
||||
const types = CONFIG.Item.typeLabels;
|
||||
const types = DOTDUNGEON.itemFilters;
|
||||
const filters = [];
|
||||
for (const type in types) {
|
||||
if (["base", "spell", "legendaryItem"].includes(type)) continue;
|
||||
for (const type of types) {
|
||||
filters.push({
|
||||
label: localizer(types[type]),
|
||||
label: localizer(`TYPES.Item.${type}`),
|
||||
key: type,
|
||||
active: this._itemFiltersActive.has(type),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue