Paramétrage des compendiums de recherche

This commit is contained in:
2023-01-17 21:51:49 +01:00
parent f7595a1bfe
commit f4d074fa31
8 changed files with 237 additions and 104 deletions

View File

@ -52,6 +52,10 @@ export class SystemCompendiums extends FormApplication {
}
static getPack(compendium) {
const pack = game.packs.get(compendium);
if (pack) {
return pack;
}
return game.packs.get(SystemCompendiums.getCompendium(compendium)) ?? game.packs.get(SystemCompendiums._getDefaultCompendium(compendium));
}
@ -187,7 +191,7 @@ export class CompendiumTable {
async getContent(itemFrequence = it => it.system.frequence, filter = it => true) {
return await SystemCompendiums.getContent(this.compendium,
this.type,
it => (!this.subTypes || this.subTypes.includes(it.type)) && filter(it),
it => (!this.subTypes || this.subTypes.includes(it.type)) && itemFrequence(it) > 0 && filter(it),
itemFrequence,
this.sorting);
}