Fixed linting

This commit is contained in:
WBHarry 2026-05-02 14:26:22 +02:00
parent 091c8527d6
commit d40ee35f92
2 changed files with 23 additions and 25 deletions

View file

@ -258,7 +258,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
const effects = selectedArea.effects.map(effect => this.system.action.item.effects.get(effect).uuid); const effects = selectedArea.effects.map(effect => this.system.action.item.effects.get(effect).uuid);
const { shape: type, size: range } = selectedArea; const { shape: type, size: range } = selectedArea;
const shapeData = CONFIG.Canvas.layers.regions.layerClass.getTemplateShape({ type, range }); const shapeData = CONFIG.Canvas.layers.regions.layerClass.getTemplateShape({ type, range });
const scene = game.scenes.get(game.user.viewedScene); const scene = game.scenes.get(game.user.viewedScene);
const level = scene.levels.find(x => x.isView); const level = scene.levels.find(x => x.isView);
@ -267,39 +267,37 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
levels: level ? [level.id] : [], levels: level ? [level.id] : [],
shapes: [shapeData], shapes: [shapeData],
restriction: { enabled: false, type: 'move', priority: 0 }, restriction: { enabled: false, type: 'move', priority: 0 },
behaviors: effects.length > 0 ? [ behaviors:
{ effects.length > 0
name: game.i18n.localize('TYPES.RegionBehavior.applyActiveEffect'), ? [
type: 'applyActiveEffect', {
system: { name: game.i18n.localize('TYPES.RegionBehavior.applyActiveEffect'),
effects: effects type: 'applyActiveEffect',
} system: {
}] : [], effects: effects
}
}
]
: [],
displayMeasurements: true, displayMeasurements: true,
locked: false, locked: false,
ownership: { default: CONST.DOCUMENT_OWNERSHIP_LEVELS.NONE }, ownership: { default: CONST.DOCUMENT_OWNERSHIP_LEVELS.NONE },
visibility: CONST.REGION_VISIBILITY.ALWAYS visibility: CONST.REGION_VISIBILITY.ALWAYS
}; };
const placeRegion = (data) => { const placeRegion = data => {
canvas.regions.placeRegion( canvas.regions.placeRegion(data, { create: true });
data,
{ create: true }
);
}; };
const needsGMExecution = effects.length > 0; const needsGMExecution = effects.length > 0;
if (needsGMExecution && !game.user.isGM) { if (needsGMExecution && !game.user.isGM) {
if (!game.users.activeGM) if (!game.users.activeGM)
return ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.behaviorRegionRequiresGM')); return ui.notifications.error(
game.i18n.localize('DAGGERHEART.UI.Notifications.behaviorRegionRequiresGM')
);
const region = await canvas.regions.placeRegion(regionData, { create: false }); const region = await canvas.regions.placeRegion(regionData, { create: false });
emitGMCreate( emitGMCreate('Region', placeRegion, region, scene.id);
'Region',
placeRegion,
region,
scene.id,
);
} else { } else {
placeRegion(regionData); placeRegion(regionData);
} }

View file

@ -42,7 +42,7 @@ export const GMUpdateEvent = {
UpdateSetting: 'DhGMUpdateSetting', UpdateSetting: 'DhGMUpdateSetting',
UpdateFear: 'DhGMUpdateFear', UpdateFear: 'DhGMUpdateFear',
UpdateCountdowns: 'DhGMUpdateCountdowns', UpdateCountdowns: 'DhGMUpdateCountdowns',
UpdateSaveMessage: 'DhGMUpdateSaveMessage', UpdateSaveMessage: 'DhGMUpdateSaveMessage'
}; };
export const RefreshType = { export const RefreshType = {
@ -109,7 +109,7 @@ export const registerSocketHooks = () => {
Hooks.on(socketEvent.GMCreate, async ({ data, documentType, scene }) => { Hooks.on(socketEvent.GMCreate, async ({ data, documentType, scene }) => {
if (!game.user.isGM) return; if (!game.user.isGM) return;
switch (documentType) { switch (documentType) {
default: default:
const cls = getDocumentClass(documentType); const cls = getDocumentClass(documentType);
@ -129,7 +129,7 @@ export const emitGMUpdate = async (eventName, callback, update, uuid = null, ref
}; };
export const emitGMCreate = async (documentType, callback, data, scene) => { export const emitGMCreate = async (documentType, callback, data, scene) => {
return await emitAsGM(socketEvent.GMCreate, { documentType, callback, data, scene }); return await emitAsGM(socketEvent.GMCreate, { documentType, callback, data, scene });
}; };
export const emitAsGM = async (event, data = { callback: () => {}, data: {} }) => { export const emitAsGM = async (event, data = { callback: () => {}, data: {} }) => {