Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
version 3.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Nov 3, 2022
1 parent 5431746 commit 3997639
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mountup",
"title": "FoundryVTT Mount Up!",
"description": "Allows tokens to carry or be carried by other tokens. This is completely system agnostic, and fully customizable to fit right into your game.",
"version": "3.3.2",
"version": "3.3.3",
"main": "mountup.js",
"scripts": {
"publish": "gulp publish --update",
Expand Down
6 changes: 3 additions & 3 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "mountup",
"title": "Mount Up!",
"description": "Allows tokens to carry or be carried by other tokens. This is completely system agnostic, and fully customizable to fit right into your game.",
"version": "3.3.2",
"version": "3.3.3",
"authors": [
{
"name": "Brunhine"
Expand Down Expand Up @@ -69,8 +69,8 @@
"url": "https://github.com/p4535992/foundryvtt-mountup",
"manifest": "https://github.com/p4535992/foundryvtt-mountup/releases/latest/download/module.json",
"download": "https://github.com/p4535992/foundryvtt-mountup/releases/latest/download/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-mountup/blob/v3.3.2/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-mountup/blob/v3.3.2/changelog.md",
"readme": "https://github.com/p4535992/foundryvtt-mountup/blob/v3.3.3/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-mountup/blob/v3.3.3/changelog.md",
"bugs": "https://github.com/p4535992/foundryvtt-mountup/issues",
"allowBugReporter": true,
"manifestPlusVersion": "1.2.0",
Expand Down
67 changes: 67 additions & 0 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,41 @@ const API = {
warn(`No token found on the canvas for id '${token.id}'`, true);
}
}
// OLD
for (const token of tokens) {
if (token && token.document) {
if (getProperty(token.document, `flags.${"foundryvtt-mountup"}`)) {
const p = getProperty(token.document, `flags.${"foundryvtt-mountup"}`);
for (const key in p) {
const senseOrConditionIdKey = key;
const senseOrConditionValue = <any>p[key];
await token.document.unsetFlag("foundryvtt-mountup", senseOrConditionIdKey);
}
const attached = token.document.getFlag("token-attacher", `attached`);
if (attached) {
await window["tokenAttacher"].detachAllElementsFromToken(token, true);
}
info(`Cleaned up token '${token.name}'`, true);
}
} else {
warn(`No token found on the canvas for id '${token.id}'`, true);
}
}
for (const token of tokens) {
if (token && token.actor) {
if (getProperty(token.actor, `flags.${"foundryvtt-mountup"}`)) {
const p = getProperty(token.actor, `flags.${"foundryvtt-mountup"}`);
for (const key in p) {
const senseOrConditionIdKey = key;
const senseOrConditionValue = <any>p[key];
await token.actor.unsetFlag("foundryvtt-mountup", senseOrConditionIdKey);
}
info(`Cleaned up actor '${token.name}'`, true);
}
} else {
warn(`No token found on the canvas for id '${token.id}'`, true);
}
}
},

async cleanUpToken(token: Token) {
Expand Down Expand Up @@ -233,6 +268,38 @@ const API = {
} else {
warn(`No token found on the canvas for id '${token.id}'`, true);
}
// OLD
if (token && token.document) {
if (getProperty(token.document, `flags.${"foundryvtt-mountup"}`)) {
const p = getProperty(token.document, `flags.${"foundryvtt-mountup"}`);
for (const key in p) {
const senseOrConditionIdKey = key;
const senseOrConditionValue = <any>p[key];
await token.document.unsetFlag("foundryvtt-mountup", senseOrConditionIdKey);
}
const attached = token.document.getFlag("token-attacher", `attached`);
if (attached) {
await window["tokenAttacher"].detachAllElementsFromToken(token, true);
}
info(`Cleaned up token '${token.name}'`, true);
}
} else {
warn(`No token found on the canvas for id '${token.id}'`, true);
}

if (token && token.actor) {
if (getProperty(token.actor, `flags.${"foundryvtt-mountup"}`)) {
const p = getProperty(token.actor, `flags.${"foundryvtt-mountup"}`);
for (const key in p) {
const senseOrConditionIdKey = key;
const senseOrConditionValue = <any>p[key];
await token.actor.unsetFlag("foundryvtt-mountup", senseOrConditionIdKey);
}
info(`Cleaned up actor '${token.name}'`, true);
}
} else {
warn(`No token found on the canvas for id '${token.id}'`, true);
}
},

async cleanUpTokenDialog(token: Token) {
Expand Down

0 comments on commit 3997639

Please sign in to comment.