From 197e59169b700aaf330451a516c216eebad227cf Mon Sep 17 00:00:00 2001 From: Haxxer Date: Fri, 14 Jun 2024 15:11:51 +0100 Subject: [PATCH] V12 --- module.json | 2 +- scripts/hotkeys.js | 4 ++-- scripts/module.js | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module.json b/module.json index f069807..5437dfc 100644 --- a/module.json +++ b/module.json @@ -13,7 +13,7 @@ "version": "This is auto replaced", "compatibility": { "minimum": "10", - "verified": "11" + "verified": "12" }, "scripts": [], "esmodules": [ diff --git a/scripts/hotkeys.js b/scripts/hotkeys.js index 99cd04c..980cfc7 100644 --- a/scripts/hotkeys.js +++ b/scripts/hotkeys.js @@ -5,7 +5,7 @@ export const hotkeyState = { } function isVersion9() { - return isNewerVersion((game?.version ?? game.data.version), "9.00"); + return foundry.utils.isNewerVersion((game?.version ?? game.data.version), "9.00"); } export function registerHotkeysPre() { @@ -52,4 +52,4 @@ export function registerHotkeysPost() { } -} \ No newline at end of file +} diff --git a/scripts/module.js b/scripts/module.js index c7cac3c..1d02652 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -638,7 +638,7 @@ class TaggerHandler { }else{ tags = Tagger._validateTags(tags, "_applyTags"); } - setProperty(updateData, propertyName, tags); + foundry.utils.setProperty(updateData, propertyName, tags); } static preCreateApplyTags(inDocument, documentData) { @@ -656,7 +656,7 @@ class TaggerHandler { const preprocessed = foundry.utils.getProperty(documentData, `${CONSTANTS.DATA_PROPERTY}.preprocessed`); if (preprocessed) { - setProperty(documentData, `${CONSTANTS.DATA_PROPERTY}.preprocessed`, false); + foundry.utils.setProperty(documentData, `${CONSTANTS.DATA_PROPERTY}.preprocessed`, false); return; } @@ -664,7 +664,7 @@ class TaggerHandler { if (tags) { tags = this.applyRules(tags); - setProperty(documentData, CONSTANTS.TAG_PROPERTY, tags); + foundry.utils.setProperty(documentData, CONSTANTS.TAG_PROPERTY, tags); } if (game.modules.get("token-attacher")?.active) { @@ -681,7 +681,7 @@ class TaggerHandler { if (locationName && locationName.startsWith("[Tagger] ")) { const tags = locationName.replace("[Tagger] ", ""); const newTags = this.applyRules(tags).join(", "); - setProperty(documentData, `flags.monks-active-tiles.actions.${i}.data.` + nameProperty, `[Tagger] ${newTags}`); + foundry.utils.setProperty(documentData, `flags.monks-active-tiles.actions.${i}.data.` + nameProperty, `[Tagger] ${newTags}`); } } @@ -690,7 +690,7 @@ class TaggerHandler { if (locationId && locationId.startsWith("tagger:")) { const tags = locationId.replace("tagger:", ""); const newTags = this.applyRules(tags).join(", "); - setProperty(documentData, `flags.monks-active-tiles.actions.${i}.data.` + idProperty, `tagger:${newTags}`); + foundry.utils.setProperty(documentData, `flags.monks-active-tiles.actions.${i}.data.` + idProperty, `tagger:${newTags}`); } } }); @@ -700,17 +700,17 @@ class TaggerHandler { let reparse = false; if (typeof monkEntity === "string") { monkEntity = JSON.parse(monkEntity); - setProperty(documentData, `flags.monks-active-tiles.entity`, monkEntity); + foundry.utils.setProperty(documentData, `flags.monks-active-tiles.entity`, monkEntity); reparse = true; } let entityId = foundry.utils.getProperty(monkEntity, "id"); if (entityId && entityId.startsWith("tagger:")) { const tags = entityId.replace("tagger:", ""); const newTags = this.applyRules(tags).join(", "); - setProperty(documentData, `flags.monks-active-tiles.entity.id`, `tagger:${newTags}`); + foundry.utils.setProperty(documentData, `flags.monks-active-tiles.entity.id`, `tagger:${newTags}`); } if(reparse){ - setProperty(documentData, `flags.monks-active-tiles.entity`, JSON.stringify(monkEntity)); + foundry.utils.setProperty(documentData, `flags.monks-active-tiles.entity`, JSON.stringify(monkEntity)); } } @@ -724,7 +724,7 @@ class TaggerHandler { for (const objects of Object.values(prototypeAttached)) { for (const object of objects) { this.applyCreateTags(object) - setProperty(object, `${CONSTANTS.DATA_PROPERTY}.preprocessed`, true); + foundry.utils.setProperty(object, `${CONSTANTS.DATA_PROPERTY}.preprocessed`, true); } } }