diff --git a/lang/en.json b/lang/en.json index 828b2303..4b786683 100755 --- a/lang/en.json +++ b/lang/en.json @@ -69,7 +69,8 @@ }, "summon": { "name": "Summon", - "tooltip": "Create tokens in the scene." + "tooltip": "Create tokens in the scene.", + "error": "You do not have permission to summon tokens or there is no active scene." } }, "Config": { diff --git a/module/data/action/summonAction.mjs b/module/data/action/summonAction.mjs index b06f1d38..7f272c69 100644 --- a/module/data/action/summonAction.mjs +++ b/module/data/action/summonAction.mjs @@ -1,3 +1,4 @@ +import { ui } from '../../applications/_module.mjs'; import DHBaseAction from './baseAction.mjs'; export default class DHSummonAction extends DHBaseAction { @@ -5,12 +6,18 @@ export default class DHSummonAction extends DHBaseAction { const fields = foundry.data.fields; return { ...super.defineSchema(), - documentUUID: new fields.DocumentUUIDField({ type: 'Actor' }) + tokenArray: new fields.ArrayField(new fields.SchemaField({ + actorUUID: new fields.DocumentUUIDField({ type: 'Actor', required: true }), + count: new fields.NumberField({ required: true, default: 1, min:1 }) + }), { required: false }) }; } async trigger(event, ...args) { - if (!this.canSummon || !canvas.scene) return; + if (!this.canSummon || !canvas.scene){ + ui.notifications.error(game.i18n.localize("DAGGERHEART.ACTIONS.TYPES.summon.error")); + return; + } } get canSummon() {