Get the PlayerSheet working and actually saving data, using the data models instead of the template.json

This commit is contained in:
Oliver-Akins 2023-11-29 00:08:19 -07:00
parent 6e3510ddd4
commit 58facf1490
11 changed files with 339 additions and 234 deletions

View file

@ -0,0 +1,57 @@
export class PlayerData extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
stats: new fields.SchemaField({
build: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(`build args`, args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
meta: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
presence: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
hands: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
tilt: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
rng: new fields.StringField({
blank: true,
trim: true,
options(...args) {
console.log(args);
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
},
}),
}),
};
};
};