This commit is contained in:
WBHarry 2026-04-21 17:06:53 +02:00
parent 152e364225
commit 957d4f9e03
2 changed files with 3 additions and 6 deletions

View file

@ -122,10 +122,8 @@ export default class DhRegionLayer extends foundry.canvas.layers.RegionLayer {
const shapeWidth = type === line.id ? 5 * dimensionConstant : type === rectangle.id ? length : undefined; const shapeWidth = type === line.id ? 5 * dimensionConstant : type === rectangle.id ? length : undefined;
const shapeType = type === inFront.id ? cone.id : type; const shapeType = type === inFront.id ? cone.id : type;
const { width, height } = game.canvas.scene.dimensions;
return { return {
x: width / 2, ...canvas.mousePosition,
y: height / 2,
base: { base: {
type: 'token', type: 'token',
x: 0, x: 0,

View file

@ -284,13 +284,12 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
if (this.system.action.area.length === 1) createArea(this.system.action.area[0]); if (this.system.action.area.length === 1) createArea(this.system.action.area[0]);
else if (this.system.action.area.length > 1) { else if (this.system.action.area.length > 1) {
/* Pop a selection. Possibly a context menu? */
new foundry.applications.ux.ContextMenu.implementation( new foundry.applications.ux.ContextMenu.implementation(
event.target, event.target,
'.action-areas', '.action-areas',
this.system.action.area.map((area, index) => ({ this.system.action.area.map((area, index) => ({
name: area.name, label: area.name,
callback: () => createArea(this.system.action.area[index]) onClick: () => createArea(this.system.action.area[index])
})), })),
{ {
jQuery: false, jQuery: false,