Added a TemplateManager singleton for creating movable previewTemplates

This commit is contained in:
WBHarry 2025-08-05 01:15:50 +02:00
parent 353f3a9e1e
commit 8c785346d9
4 changed files with 113 additions and 10 deletions

View file

@ -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);
};