From ee77f109579052afc119969523993fe13a6f6dc4 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 19 Apr 2024 18:51:56 -0600 Subject: [PATCH] Remove methods that don't need to be overridden for StringField --- module/models/fields/DiceField.mjs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/module/models/fields/DiceField.mjs b/module/models/fields/DiceField.mjs index 294e1a9..7534101 100644 --- a/module/models/fields/DiceField.mjs +++ b/module/models/fields/DiceField.mjs @@ -4,7 +4,7 @@ import { statDice } from "../../config.mjs"; * A subclass of StringField that allows ActiveEffects to integrate with dice * values and increase/decrease the value step-wise according to the dice ladder. */ -export class DiceField extends foundry.data.fields.DataField { +export class DiceField extends foundry.data.fields.StringField { static get _defaults() { return foundry.utils.mergeObject(super._defaults, { trim: true, @@ -22,15 +22,6 @@ export class DiceField extends foundry.data.fields.DataField { console.log(this.choices) }; - applyChange(...args) { - console.log(`DiceField.applyChange`, args); - return super.applyChange(...args) - } - - _cast(value) { - return String(value); - } - _castChangeDelta(delta) { console.log(`DiceField._castChangeDelta(${delta})`) return parseInt(delta) ?? 0; @@ -70,4 +61,9 @@ export class DiceField extends foundry.data.fields.DataField { console.log(`.dungeon | Post: value=${value}; delta=${delta}`); return value }; + + _applyChangeCustom(...args) { + console.log(`.dungeon | Dicefield._applyChangeCustom`) + return super._applyChangeCustom(...args); + } };