Action Macro working again

This commit is contained in:
Dapoolp 2025-08-12 03:58:25 +02:00
parent 7a798901cc
commit 6533877b79
9 changed files with 19 additions and 65 deletions

View file

@ -8,3 +8,4 @@ export { default as BeastformField } from './beastformField.mjs';
export { default as DamageField } from './damageField.mjs';
export { default as HealingField } from './healingField.mjs';
export { default as RollField } from './rollField.mjs';
export { default as MacroField } from './macroField.mjs';

View file

@ -0,0 +1,7 @@
const fields = foundry.data.fields;
export default class MacroField extends fields.DocumentUUIDField {
constructor(context = {}) {
super({ type: "Macro" }, context);
}
}

View file

@ -84,7 +84,7 @@ export class ActionField extends foundry.data.fields.ObjectField {
getModel(value) {
return (
game.system.api.models.actions.actionsTypes[value.type] ??
game.system.api.models.actions.actionsTypes.attack
null
);
}
@ -93,7 +93,6 @@ export class ActionField extends foundry.data.fields.ObjectField {
/** @override */
_cleanType(value, options) {
if (!(typeof value === 'object')) value = {};
const cls = this.getModel(value);
if (cls) return cls.cleanData(value, options);
return value;