All data fields added and wired up for use

This commit is contained in:
Chris Ryan 2025-11-14 18:16:37 +10:00
parent 596e149968
commit fbd21274a6
5 changed files with 67 additions and 20 deletions

View file

@ -1,4 +1,3 @@
export const presetTemplateTypes = {
circle: {
id: 'circle',
@ -14,6 +13,7 @@ export const presetTemplateTypes = {
export default class DhPresetTemplate extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
const fillColor = game.user?.color.toString() || '#777777';
return {
type: new fields.StringField({
@ -25,8 +25,24 @@ export default class DhPresetTemplate extends foundry.abstract.DataModel {
range: new fields.StringField({
required: true,
initial: "15",
label: 'DAGGERHEART.GENERAL.type'
label: 'DAGGERHEART.GENERAL.range'
}),
angle: new fields.NumberField({
label: 'DAGGERHEART.GENERAL.angle'
}),
direction: new fields.NumberField({
initial: 0,
label: 'DAGGERHEART.GENERAL.direction'
}),
width: new fields.NumberField({
label: 'DAGGERHEART.GENERAL.width'
}),
fillColor: new fields.StringField({
required: true,
initial: fillColor,
label: 'DAGGERHEART.GENERAL.fillColor'
})
};
}
}