forked from public/foundryvtt-reve-de-dragon
Add default scene
This commit is contained in:
@ -274,6 +274,16 @@ export class SystemReveDeDragon {
|
||||
})
|
||||
}
|
||||
|
||||
static async setupAccueil() {
|
||||
let exists = game.scenes.find(j => j.name == "Accueil RdD");
|
||||
if (!exists) {
|
||||
const scenes = await SystemCompendiums.loadCompendium("foundryvtt-reve-de-dragon.scenes-rdd")
|
||||
let newDocuments = scenes.filter(i => i.name == "Accueil RdD");
|
||||
await game.scenes.documentClass.create(newDocuments);
|
||||
game.scenes.find(i => i.name == "Accueil RdD").activate();
|
||||
}
|
||||
}
|
||||
|
||||
async onReady() {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -307,6 +317,8 @@ export class SystemReveDeDragon {
|
||||
user: game.user.id
|
||||
})
|
||||
}
|
||||
|
||||
SystemReveDeDragon.setupAccueil()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -112,6 +112,19 @@ export class SystemCompendiums extends FormApplication {
|
||||
return elements;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendiumData(compendium) {
|
||||
const pack = game.packs.get(compendium);
|
||||
return await pack?.getDocuments() ?? [];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendium(compendium, filter = item => true) {
|
||||
let compendiumData = await SystemCompendiums.loadCompendiumData(compendium);
|
||||
return compendiumData.filter(filter);
|
||||
}
|
||||
|
||||
|
||||
static async getDefaultItems(compendium) {
|
||||
const pack = game.packs.get(SystemCompendiums._getDefaultCompendium(compendium));
|
||||
if (pack.metadata.type == 'Item') {
|
||||
|
Reference in New Issue
Block a user