Remplacement progressif rencontres

This commit is contained in:
Vincent Vandemeulebrouck
2022-11-07 00:04:43 +01:00
parent d20a6a1506
commit f659a7508a
21 changed files with 460 additions and 746 deletions

View File

@ -48,8 +48,7 @@ export class SystemCompendiums extends FormApplication {
static async getContent(compendium, docType) {
const pack = SystemCompendiums.getPack(compendium);
if (pack.metadata.type == docType)
{
if (pack.metadata.type == docType) {
return await pack.getDocuments();
}
return [];
@ -59,6 +58,14 @@ export class SystemCompendiums extends FormApplication {
return await SystemCompendiums.getContent(compendium, 'Item')
}
static async getDefaultItems(compendium) {
const pack = game.packs.get(SystemCompendiums._getDefaultCompendium(compendium));
if (pack.metadata.type == 'Item') {
return await pack.getDocuments();
}
return [];
}
static getCompendium(compendium) {
const setting = CONFIGURABLE_COMPENDIUMS[compendium]?.setting;
return setting ? game.settings.get(SYSTEM_RDD, setting) : SystemCompendiums._getDefaultCompendium(compendium);