Functioning setup

This commit is contained in:
WBHarry 2026-04-18 15:02:41 +02:00
parent 4b92001f97
commit 0cb7ede933
24 changed files with 350 additions and 72 deletions

View file

@ -0,0 +1,35 @@
const fields = foundry.data.fields;
export default class AreaField extends fields.ArrayField {
/**
* Action Workflow order
*/
static order = 150;
/** @inheritDoc */
constructor(options = {}, context = {}) {
const element = new fields.SchemaField({
type: new fields.StringField({
nullable: false,
choices: CONFIG.DH.ACTIONS.areaTypes,
initial: CONFIG.DH.ACTIONS.areaTypes.placed.id,
label: 'DAGGERHEART.GENERAL.type'
}),
shape: new fields.StringField({
nullable: false,
choices: CONFIG.DH.GENERAL.templateTypes,
initial: CONFIG.DH.GENERAL.templateTypes.circle.id,
label: 'DAGGERHEART.ACTIONS.Config.area.shape'
}),
/* Could be opened up to allow numbers to be input aswell. Probably best handled via an autocomplete in that case to allow the select options but also free text */
size: new fields.StringField({
nullable: false,
choices: CONFIG.DH.GENERAL.range,
initial: CONFIG.DH.GENERAL.range.veryClose.id,
label: 'DAGGERHEART.ACTIONS.Config.area.size'
}),
effects: new fields.ArrayField(new fields.DocumentIdField()),
});
super(element, options, context);
}
}