mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 12:41:07 +01:00
Merge 503aa712e6 into 0b343c9f52
This commit is contained in:
commit
094357b6e3
15 changed files with 395 additions and 23 deletions
|
|
@ -37,4 +37,30 @@ export default class DhScene extends Scene {
|
|||
this.#sizeSyncBatch.clear();
|
||||
this.updateEmbeddedDocuments('Token', entries, { animation: { movementSpeed: 1.5 } });
|
||||
}, 0);
|
||||
|
||||
prepareBaseData() {
|
||||
super.prepareBaseData();
|
||||
|
||||
if (this instanceof game.system.api.documents.DhScene) {
|
||||
const system = new game.system.api.data.scenes.DHScene(this.flags.daggerheart);
|
||||
|
||||
// Register this scene to all environements
|
||||
for (const environment of system.sceneEnvironments) {
|
||||
environment.system.scenes?.add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_onDelete(options, userId) {
|
||||
super._onDelete(options, userId);
|
||||
|
||||
if (this instanceof game.system.api.documents.DhScene) {
|
||||
const system = new game.system.api.data.scenes.DHScene(this.flags.daggerheart);
|
||||
|
||||
// Clear this scene from all environments that aren't deleted
|
||||
for (const environement of system.sceneEnvironments) {
|
||||
environement?.system?.scenes?.delete(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue