mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Changed Cone template to be 'In Front', acting as a 180 degree cone
This commit is contained in:
parent
13f65e514a
commit
4dc0e79aec
5 changed files with 79 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ Hooks.once('init', () => {
|
|||
|
||||
CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, ...[DHRoll, DualityRoll, D20Roll, DamageRoll]];
|
||||
CONFIG.MeasuredTemplate.objectClass = placeables.DhMeasuredTemplate;
|
||||
CONFIG.MeasuredTemplate.defaults.angle = 180;
|
||||
|
||||
CONFIG.Item.documentClass = documents.DHItem;
|
||||
|
||||
|
|
@ -119,6 +120,7 @@ Hooks.once('init', () => {
|
|||
CONFIG.ChatMessage.documentClass = documents.DhChatMessage;
|
||||
|
||||
CONFIG.Canvas.rulerClass = placeables.DhRuler;
|
||||
CONFIG.Canvas.layers.templates.layerClass = placeables.DhTemplateLayer;
|
||||
CONFIG.Combat.documentClass = documents.DhpCombat;
|
||||
CONFIG.ui.combat = applications.ui.DhCombatTracker;
|
||||
CONFIG.ui.chat = applications.ui.DhChatLog;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
"environment": "Environment"
|
||||
}
|
||||
},
|
||||
"CONTROLS": {
|
||||
"inFront": "In Front"
|
||||
},
|
||||
"DAGGERHEART": {
|
||||
"ACTIONS": {
|
||||
"Config": {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
export { default as DhMeasuredTemplate } from './measuredTemplate.mjs';
|
||||
export { default as DhRuler } from './ruler.mjs';
|
||||
export { default as DhTemplateLayer } from './templateLayer.mjs';
|
||||
export { default as DhTokenRuler } from './tokenRuler.mjs';
|
||||
|
|
|
|||
72
module/canvas/placeables/templateLayer.mjs
Normal file
72
module/canvas/placeables/templateLayer.mjs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
export default class DhTemplateLayer extends TemplateLayer {
|
||||
static prepareSceneControls() {
|
||||
const sc = SceneControls;
|
||||
return {
|
||||
name: 'templates',
|
||||
order: 2,
|
||||
title: 'CONTROLS.GroupMeasure',
|
||||
icon: 'fa-solid fa-ruler-combined',
|
||||
visible: game.user.can('TEMPLATE_CREATE'),
|
||||
onChange: (event, active) => {
|
||||
if (active) canvas.templates.activate();
|
||||
},
|
||||
onToolChange: () => canvas.templates.setAllRenderFlags({ refreshState: true }),
|
||||
tools: {
|
||||
circle: {
|
||||
name: 'circle',
|
||||
order: 1,
|
||||
title: 'CONTROLS.MeasureCircle',
|
||||
icon: 'fa-regular fa-circle',
|
||||
toolclip: {
|
||||
src: 'toolclips/tools/measure-circle.webm',
|
||||
heading: 'CONTROLS.MeasureCircle',
|
||||
items: sc.buildToolclipItems(['create', 'move', 'edit', 'hide', 'delete'])
|
||||
}
|
||||
},
|
||||
cone: {
|
||||
name: 'cone',
|
||||
order: 2,
|
||||
title: 'CONTROLS.inFront',
|
||||
icon: 'fa-solid fa-eye',
|
||||
toolclip: {
|
||||
src: 'toolclips/tools/measure-cone.webm',
|
||||
heading: 'CONTROLS.inFront',
|
||||
items: sc.buildToolclipItems(['create', 'move', 'edit', 'hide', 'delete', 'rotate'])
|
||||
}
|
||||
},
|
||||
rect: {
|
||||
name: 'rect',
|
||||
order: 3,
|
||||
title: 'CONTROLS.MeasureRect',
|
||||
icon: 'fa-regular fa-square',
|
||||
toolclip: {
|
||||
src: 'toolclips/tools/measure-rect.webm',
|
||||
heading: 'CONTROLS.MeasureRect',
|
||||
items: sc.buildToolclipItems(['create', 'move', 'edit', 'hide', 'delete', 'rotate'])
|
||||
}
|
||||
},
|
||||
ray: {
|
||||
name: 'ray',
|
||||
order: 4,
|
||||
title: 'CONTROLS.MeasureRay',
|
||||
icon: 'fa-solid fa-up-down',
|
||||
toolclip: {
|
||||
src: 'toolclips/tools/measure-ray.webm',
|
||||
heading: 'CONTROLS.MeasureRay',
|
||||
items: sc.buildToolclipItems(['create', 'move', 'edit', 'hide', 'delete', 'rotate'])
|
||||
}
|
||||
},
|
||||
clear: {
|
||||
name: 'clear',
|
||||
order: 5,
|
||||
title: 'CONTROLS.MeasureClear',
|
||||
icon: 'fa-solid fa-trash',
|
||||
visible: game.user.isGM,
|
||||
onChange: () => canvas.templates.deleteAll(),
|
||||
button: true
|
||||
}
|
||||
},
|
||||
activeTool: 'circle'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
export default class DhTooltipManager extends foundry.helpers.interaction.TooltipManager {
|
||||
async activate(element, options = {}) {
|
||||
let html = options.html;
|
||||
if (element.dataset.tooltip.startsWith('#item#')) {
|
||||
if (element.dataset.tooltip?.startsWith('#item#')) {
|
||||
const item = await foundry.utils.fromUuid(element.dataset.tooltip.slice(6));
|
||||
if (item) {
|
||||
html = await foundry.applications.handlebars.renderTemplate(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue