diff --git a/changelog.md b/changelog.md index d0ac216..86c317d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # Changelog ## 3.2.x simple or +## 3.2.3 +- some reported module incompatibility fixes ## 3.2.2 - automatically fix broken tools (dnd5e) - add flag to created or updated items diff --git a/module.json b/module.json index c0f1f79..3cbfd36 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "title": "Beaver's Crafting Module", "description": "A Module for not only Crafting. But also Tracking any activities, Skill challenges, Quest and Progress, Faction reputation and more", "id": "beavers-crafting", - "version": "3.2.2", + "version": "3.2.3", "authors": [ { "name": "angryBeaver", diff --git a/package-lock.json b/package-lock.json index db9ca08..4bb5eec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "beavers-crafting", - "version": "3.2.2", + "version": "3.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "beavers-crafting", - "version": "3.2.2", + "version": "3.2.3", "dependencies": { "save-dev": "^0.0.1-security" }, diff --git a/package.json b/package.json index 45874a1..9a09b9d 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { "name": "beavers-crafting", "title": "Beaver's Crafting", - "version": "3.2.2", + "version": "3.2.3", "description": "Crafting", - "devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules", + "#devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules", "#devDir": "C:\\data\\Data\\modules", + "devDir": "D:\\Vtts\\v10\\Data\\modules", + "#devDir": "D:\\Vtts\\v11\\Data\\modules", "main": "src/main.js", "scripts": { "build": "npx gulp", diff --git a/src/AnyOf.ts b/src/AnyOf.ts index 9072aa4..c0836c4 100644 --- a/src/AnyOf.ts +++ b/src/AnyOf.ts @@ -12,14 +12,14 @@ export class AnyOf { return ( item?.type === beaversSystemInterface.configLootItemType && ( item?.system?.source === Settings.ANYOF_SUBTYPE || - getProperty(item,`flags.beavers-crafting.subtype`) === Settings.ANYOF_SUBTYPE + getProperty(item,`flags.${Settings.NAMESPACE}.subtype`) === Settings.ANYOF_SUBTYPE ) ); } constructor(item) { const flags = getProperty(item,`flags.${Settings.NAMESPACE}.anyOf`) || {}; - const data = mergeObject(this.defaultData(), flags || {}, {inplace: false}); + const data = mergeObject(this.defaultData(), flags, {inplace: false}); this.macro = data.macro; this.img = item.img; this.name = item.name; diff --git a/src/Crafting.ts b/src/Crafting.ts index d75ab91..da15825 100644 --- a/src/Crafting.ts +++ b/src/Crafting.ts @@ -503,7 +503,7 @@ export class Crafting implements CraftingData { } } }; - setProperty(update, `flags.beavers-crafting.crafting.${uuid}`, this.serialize()); + setProperty(update, `flags.${Settings.NAMESPACE}.crafting.${uuid}`, this.serialize()); await this.actor.update(update); } diff --git a/src/Recipe.ts b/src/Recipe.ts index d27df27..61e5524 100644 --- a/src/Recipe.ts +++ b/src/Recipe.ts @@ -55,14 +55,14 @@ export class Recipe implements RecipeData { // @ts-ignore return (item?.type === beaversSystemInterface.configLootItemType && ( item?.system?.source === Settings.RECIPE_SUBTYPE || - getProperty(item, `flags.beavers-crafting.subtype`) === Settings.RECIPE_SUBTYPE + getProperty(item, `flags.${Settings.NAMESPACE}.subtype`) === Settings.RECIPE_SUBTYPE ) ) } static fromItem(item): Recipe { const flags = getProperty(item,`flags.${Settings.NAMESPACE}.recipe`) || {}; - const data = mergeObject({input: {}, output: {}, required: {}}, flags || {}, {inplace: false}); + const data = mergeObject({input: {}, output: {}, required: {}}, flags, {inplace: false}); return new Recipe(item.uuid, item.id, item.name, item.img, data); } diff --git a/src/apps/ActorSheetTab.ts b/src/apps/ActorSheetTab.ts index 3f51bbe..25286c6 100644 --- a/src/apps/ActorSheetTab.ts +++ b/src/apps/ActorSheetTab.ts @@ -26,7 +26,7 @@ export class ActorSheetTab { async init() { const label = game["i18n"].localize("beaversCrafting.actorSheet.tab"); - const flag = getProperty(this.app.actor,`flags.beavers-crafting.crafting`) || {}; + const flag = getProperty(this.app.actor,`flags.${Settings.NAMESPACE}.crafting`) || {}; const unsortedFolders = {}; for(const [x,y] of Object.entries(flag)){ const craftingData = (y as CraftingData); diff --git a/src/main.js b/src/main.js index 8970e26..6afb91f 100644 --- a/src/main.js +++ b/src/main.js @@ -83,10 +83,10 @@ Hooks.once("beavers-system-interface.ready", async function(){ //add Subtype to create Item Hooks.on("preCreateItem", (doc, createData, options, user) => { - if (getProperty(createData, `flags.beavers-crafting.subtype`) === 'recipe' ) { + if (getProperty(createData, `flags.${Settings.NAMESPACE}.subtype`) === 'recipe' ) { doc.updateSource({"flags.beavers-crafting.subtype": Settings.RECIPE_SUBTYPE,"img":"icons/sundries/scrolls/scroll-worn-tan.webp"}); } - if (getProperty(createData,`flags.beavers-crafting.subtype`) === 'anyOf' ) { + if (getProperty(createData,`flags.${Settings.NAMESPACE}.subtype`) === 'anyOf' ) { doc.updateSource({"flags.beavers-crafting.subtype": Settings.ANYOF_SUBTYPE,"img":"modules/beavers-crafting/icons/anyOf.png"}); } }); diff --git a/src/migration.ts b/src/migration.ts index d100d0f..c53c75b 100644 --- a/src/migration.ts +++ b/src/migration.ts @@ -83,7 +83,7 @@ export async function migrateRecipeSkillToTests() { ui.notifications?.warn("Beavers Crafting |" + e); } } - const flag = getProperty(actor, `flags.beavers-crafting.crafting`) || {}; + const flag = getProperty(actor, `flags.${Settings.NAMESPACE}.crafting`) || {}; for (const [x, y] of Object.entries(flag)) { try { const craftingData = (y as CraftingData); @@ -120,7 +120,7 @@ export async function migrateDeprecateTools() { ui.notifications?.warn("Beavers Crafting |" + e); } } - const flag = getProperty(actor, `flags.beavers-crafting.crafting`) || {}; + const flag = getProperty(actor, `flags.${Settings.NAMESPACE}.crafting`) || {}; for (const [x, y] of Object.entries(flag)) { try { const craftingData = (y as CraftingData);