Added a TemplateManager singleton for creating movable previewTemplates (#580)

This commit is contained in:
WBHarry 2025-08-05 04:10:16 +02:00 committed by GitHub
parent c9f045a36f
commit 089657a896
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);
};