Filter types choices

This commit is contained in:
Dapoolp 2025-07-29 13:16:17 +02:00
parent 0512e4cad0
commit 18aed3a9f0
5 changed files with 44 additions and 21 deletions

View file

@ -4,7 +4,7 @@ export class DHActionRollData extends foundry.abstract.DataModel {
/** @override */
static defineSchema() {
return {
type: new fields.StringField({ nullable: true, initial: null, choices: this.getRollTypes() }),
type: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.GENERAL.rollTypes }),
trait: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.ACTOR.abilities }),
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }),
@ -45,15 +45,6 @@ export class DHActionRollData extends foundry.abstract.DataModel {
};
}
static getRollTypes() {
console.log(this.parent, this._source)
return CONFIG.DH.GENERAL.rollTypes;
}
_configure() {
console.log(this)
}
getFormula() {
if (!this.type) return;
let formula = '';
@ -80,6 +71,5 @@ export class DHActionRollData extends foundry.abstract.DataModel {
export default class RollField extends fields.EmbeddedDataField {
constructor(options, context = {}) {
super(DHActionRollData, options, context);
console.log(this)
}
}