@@ -75,8 +75,33 @@ Hooks.once("setup", () => {
|
||||
localizeSystemConfig()
|
||||
})
|
||||
|
||||
Hooks.once("ready", () => {
|
||||
Hooks.once("ready", async () => {
|
||||
console.info(`${SYSTEM_ID} | Ready`)
|
||||
|
||||
if (!game.user.isGM) return
|
||||
|
||||
if (game.scenes.getName("Map")) return
|
||||
|
||||
const pack = game.packs.get("fvtt-machine-gods-noxian-expanse.scenes")
|
||||
if (!pack) {
|
||||
console.warn(`${SYSTEM_ID} | Scenes compendium not found`)
|
||||
return
|
||||
}
|
||||
|
||||
const index = await pack.getIndex()
|
||||
const entry = index.find(s => s.name === "Map")
|
||||
if (!entry) {
|
||||
console.warn(`${SYSTEM_ID} | Map scene not found in compendium`)
|
||||
return
|
||||
}
|
||||
|
||||
const doc = await pack.getDocument(entry._id)
|
||||
if (doc) {
|
||||
const scene = await Scene.create(doc.toObject(), { keepId: false })
|
||||
if (scene) {
|
||||
await scene.activate()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Hooks.on("deleteCombat", (combat) => {
|
||||
|
||||
Reference in New Issue
Block a user