Skip to content

Commit

Permalink
V12
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Jun 14, 2024
1 parent 4a27aea commit 197e591
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": "This is auto replaced",
"compatibility": {
"minimum": "10",
"verified": "11"
"verified": "12"
},
"scripts": [],
"esmodules": [
Expand Down
4 changes: 2 additions & 2 deletions scripts/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -52,4 +52,4 @@ export function registerHotkeysPost() {

}

}
}
18 changes: 9 additions & 9 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -656,15 +656,15 @@ 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;
}

let tags = foundry.utils.getProperty(documentData, CONSTANTS.TAG_PROPERTY);

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) {
Expand All @@ -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}`);
}
}

Expand All @@ -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}`);
}
}
});
Expand All @@ -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));
}
}

Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 197e591

Please sign in to comment.