mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Added a TemplateManager singleton for creating movable previewTemplates (#580)
This commit is contained in:
parent
c9f045a36f
commit
089657a896
4 changed files with 113 additions and 10 deletions
|
|
@ -59,14 +59,14 @@ export const renderMeasuredTemplate = async event => {
|
|||
const distance = type === CONFIG.DH.GENERAL.templateTypes.EMANATION ? baseDistance + 2.5 : baseDistance;
|
||||
|
||||
const { width, height } = game.canvas.scene.dimensions;
|
||||
canvas.scene.createEmbeddedDocuments('MeasuredTemplate', [
|
||||
{
|
||||
x: width / 2,
|
||||
y: height / 2,
|
||||
t: usedType,
|
||||
distance: distance,
|
||||
width: type === CONST.MEASURED_TEMPLATE_TYPES.RAY ? 5 : undefined,
|
||||
angle: angle
|
||||
}
|
||||
]);
|
||||
const data = {
|
||||
x: width / 2,
|
||||
y: height / 2,
|
||||
t: usedType,
|
||||
distance: distance,
|
||||
width: type === CONST.MEASURED_TEMPLATE_TYPES.RAY ? 5 : undefined,
|
||||
angle: angle
|
||||
};
|
||||
|
||||
CONFIG.ux.TemplateManager.createPreview(data);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue