diff --git a/src/module.json b/src/module.json index 49b8d5a..dfc46a4 100644 --- a/src/module.json +++ b/src/module.json @@ -5,7 +5,7 @@ "version": "4.1.6", "compatibility": { "minimum": 11, - "verified": 12.327, + "verified": 12.330, "maximum": 12.999 }, "authors": [ @@ -149,9 +149,9 @@ "type": "system", "manifest": "https://raw.githubusercontent.com/foundryvtt/dnd5e/master/system.json", "compatibility": { - "minimum": "3.0.0", - "verified": "3.2.1", - "maximum": "3.2.999" + "minimum": "3.3.0", + "verified": "3.3.1", + "maximum": "3.3.999" } } ], diff --git a/src/scripts/magic-item-entry/AbstractMagicItemEntry.js b/src/scripts/magic-item-entry/AbstractMagicItemEntry.js index f66dc80..aa4955d 100644 --- a/src/scripts/magic-item-entry/AbstractMagicItemEntry.js +++ b/src/scripts/magic-item-entry/AbstractMagicItemEntry.js @@ -5,7 +5,7 @@ import { MagicItemHelpers } from "../magic-item-helpers"; export class AbstractMagicItemEntry { constructor(data) { - mergeObject(this, data); + foundry.utils.mergeObject(this, data); // Patch retrocompatbility if (this.pack?.startsWith("magic-items")) { this.pack = this.pack.replace("magic-items-2.", `${CONSTANTS.MODULE_ID}.`); diff --git a/src/scripts/magic-item-entry/MagicItemTable.js b/src/scripts/magic-item-entry/MagicItemTable.js index 835d9f4..bc535a0 100644 --- a/src/scripts/magic-item-entry/MagicItemTable.js +++ b/src/scripts/magic-item-entry/MagicItemTable.js @@ -29,7 +29,7 @@ export class MagicItemTable extends AbstractMagicItemEntry { if (!game.modules.get("ready-set-roll-5e")?.active) { ChatMessage.create( - mergeObject(chatData, { + foundry.utils.mergeObject(chatData, { "flags.dnd5e.itemData": item, }), ); diff --git a/src/scripts/magic-item-helpers.js b/src/scripts/magic-item-helpers.js index c45b4c0..8816f26 100644 --- a/src/scripts/magic-item-helpers.js +++ b/src/scripts/magic-item-helpers.js @@ -4,7 +4,7 @@ import { isRealNumber, isEmptyObject } from "./lib/lib.js"; export class MagicItemHelpers { static isUsingNew5eSheet(sheet) { - return sheet?.constructor?.name === "ActorSheet5eCharacter2"; + return sheet?.constructor?.name === "ActorSheet5eCharacter2" || sheet?.constructor?.name === "ActorSheet5eNPC2"; } static isMidiItemEffectWorkflowOn() { diff --git a/src/scripts/magic-item-owned-entry/AbstractOwnedMagicItemEntry.js b/src/scripts/magic-item-owned-entry/AbstractOwnedMagicItemEntry.js index 7696592..0f0e804 100644 --- a/src/scripts/magic-item-owned-entry/AbstractOwnedMagicItemEntry.js +++ b/src/scripts/magic-item-owned-entry/AbstractOwnedMagicItemEntry.js @@ -195,7 +195,7 @@ export class AbstractOwnedMagicItemEntry { existingEffect.update({ disabled: !existingEffect.disabled }); return; } - effect = mergeObject(effect, { + effect = foundry.utils.mergeObject(effect, { disabled: false, transfer: false, origin: item.uuid, diff --git a/src/scripts/magic-item-owned-entry/OwnedMagicItemFeat.js b/src/scripts/magic-item-owned-entry/OwnedMagicItemFeat.js index 1967dc4..59b9c63 100644 --- a/src/scripts/magic-item-owned-entry/OwnedMagicItemFeat.js +++ b/src/scripts/magic-item-owned-entry/OwnedMagicItemFeat.js @@ -8,11 +8,11 @@ export class OwnedMagicItemFeat extends AbstractOwnedMagicItemEntry { if (!this.ownedItem) { let data = await this.item.data(); - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "system.uses": null, }); - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "flags.core": { sourceId: this.item.uuid, }, diff --git a/src/scripts/magic-item-owned-entry/OwnedMagicItemSpell.js b/src/scripts/magic-item-owned-entry/OwnedMagicItemSpell.js index 1f0fc02..dd4bb04 100644 --- a/src/scripts/magic-item-owned-entry/OwnedMagicItemSpell.js +++ b/src/scripts/magic-item-owned-entry/OwnedMagicItemSpell.js @@ -12,29 +12,29 @@ export class OwnedMagicItemSpell extends AbstractOwnedMagicItemEntry { let data = await this.item.data(); if (typeof data.system.save.scaling === "undefined") { - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "system.save.scaling": "spell", }); } if (this.item.flatDc) { - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "system.save.scaling": "flat", "system.save.dc": this.item.dc, }); } if (!MagicItemHelpers.isLevelScalingSettingOn()) { - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "system.scaling": "none", }); } - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "system.preparation": { mode: "magicitems" }, }); - data = mergeObject(data, { + data = foundry.utils.mergeObject(data, { "flags.core": { sourceId: this.item.uuid, }, diff --git a/src/scripts/magic-item/MagicItem.js b/src/scripts/magic-item/MagicItem.js index 38b3dce..b3d6567 100644 --- a/src/scripts/magic-item/MagicItem.js +++ b/src/scripts/magic-item/MagicItem.js @@ -7,7 +7,7 @@ import { NumberUtils } from "../utils/number.js"; export class MagicItem { constructor(flagsData) { - const data = mergeObject(this.defaultData(), flagsData || {}, { inplace: false }); + const data = foundry.utils.mergeObject(this.defaultData(), flagsData || {}, { inplace: false }); this.enabled = data.enabled; this.equipped = data.equipped; @@ -182,7 +182,7 @@ export class MagicItem { } clear() { - mergeObject(this, this.defaultData()); + foundry.utils.mergeObject(this, this.defaultData()); this.spells = []; this.feats = []; this.tables = []; diff --git a/src/scripts/magicItemtab.js b/src/scripts/magicItemtab.js index 9fdc455..2bd47d1 100644 --- a/src/scripts/magicItemtab.js +++ b/src/scripts/magicItemtab.js @@ -168,7 +168,7 @@ export class MagicItemTab { if (entity && magicItem.compatible(entity)) { magicItem.addEntity(entity, pack); - item.update({ + await item.update({ flags: { [CONSTANTS.MODULE_ID]: magicItem.serializeData(), }, diff --git a/src/templates/magic-item-feat-sheet-v2.hbs b/src/templates/magic-item-feat-sheet-v2.hbs index 1536b09..158aaee 100644 --- a/src/templates/magic-item-feat-sheet-v2.hbs +++ b/src/templates/magic-item-feat-sheet-v2.hbs @@ -40,37 +40,38 @@ data-item-id="{{feat.id}}" data-item-uuid="{{feat.uuid}}" data-entry-id="{{../id}}" - draggable="true" - > -