Replace compendium calls

This commit is contained in:
Dapoolp 2025-08-06 03:04:00 +02:00
parent 42867a4be1
commit 3ea050997b
12 changed files with 220 additions and 70 deletions

View file

@ -1,6 +1,7 @@
import { abilities, subclassFeatureLabels } from '../../config/actorConfig.mjs';
import { domains } from '../../config/domainConfig.mjs';
import { getDeleteKeys, tagifyElement } from '../../helpers/utils.mjs';
import { ItemBrowser } from '../ui/itemBrowser.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
@ -525,8 +526,24 @@ export default class DhlevelUp extends HandlebarsApplicationMixin(ApplicationV2)
this.render();
}
static async viewCompendium(_, button) {
(await game.packs.get(`daggerheart.${button.dataset.compendium}`))?.render(true);
static async viewCompendium(event, target) {
const type = target.dataset.compendium ?? target.dataset.type;
const presets = {
compendium: "daggerheart",
folder: type,
render: {
noFolder: true
}
};
// if(type == "domains")
// presets.filter = {
// 'level.max': { key: 'level.max', value: 1 },
// 'system.domain': { key: 'system.domain', value: this.setup.class?.system.domains ?? null },
// };
return new ItemBrowser({ presets }).render({ force: true });
}
static async selectPreview(_, button) {