mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Stuff
This commit is contained in:
parent
078334096c
commit
b80d42c815
6 changed files with 110 additions and 0 deletions
|
|
@ -5,6 +5,11 @@
|
|||
export default class DhTemplateManager {
|
||||
#activePreview;
|
||||
|
||||
|
||||
getActivePreview() {
|
||||
return this.#activePreview;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a template preview, deactivating any existing ones.
|
||||
* @param {object} data
|
||||
|
|
@ -29,6 +34,7 @@ export default class DhTemplateManager {
|
|||
|
||||
canvas.app.view.addEventListener('wheel', this.#activePreview.events.wheel, true);
|
||||
canvas.app.view.addEventListener('contextmenu', this.#activePreview.events.contextmenu);
|
||||
return this.#activePreview;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,4 +108,11 @@ export default class DhTemplateManager {
|
|||
canvas.scene.createEmbeddedDocuments('MeasuredTemplate', [this.#activePreview.document.toObject()]);
|
||||
this.#activePreview = undefined;
|
||||
}
|
||||
|
||||
cancelActivePreview(event) {
|
||||
if (this.#activePreview) {
|
||||
this.#cancelTemplate(event);
|
||||
this.#activePreview = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue