Skip to content

Commit

Permalink
Merge pull request #105 from kandashi/0.1.05
Browse files Browse the repository at this point in the history
Update nextUp.js
  • Loading branch information
kandashi authored Jun 25, 2021
2 parents 208cdeb + 0a5340f commit 2eff477
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/nextUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Hooks.on("renderActorSheet", NextUP.addPinButton)

Hooks.on("canvasReady", async () => {
await NextUpChangeImage();
if (!game.settings.get("Next-Up", "markerEnable")) return;
let tokens = canvas.tokens.placeables.filter(t => t.inCombat)
for (let t of tokens) { await NextUP.createTurnMarker(t.data._id) }
let token = canvas.tokens.get(game.combat?.current?.tokenId)
Expand Down Expand Up @@ -365,15 +366,15 @@ class NextUP {
}
});
switch (combatFocusType) {
case "0": sheet = await currentToken.actor.sheet._render(true);
case "0": sheet = await currentToken.actor.sheet.render(true);
break;
case "1": {
if (currentToken.data.actorLink === false) sheet = await currentToken.actor.sheet._render(true, { token: currentToken.actor.token });
if (currentToken.data.actorLink === false) sheet = await currentToken.actor.sheet.render(true);
else sheet = false;
}
break;
case "2": {
if (currentToken.actor.hasPlayerOwner === false) sheet = await currentToken.actor.sheet._render(true, { token: currentToken.actor.token });
if (currentToken.actor.hasPlayerOwner === false) sheet = await currentToken.actor.sheet.render(true);
else sheet = false;
}
break;
Expand Down Expand Up @@ -451,6 +452,7 @@ class NextUP {
}

static async createTurnMarker(tokenId) {
if (!game.settings.get("Next-Up", "markerEnable")) return;
let token = canvas.tokens.get(tokenId)
let prevMarker = token.children.filter(i => i.NUMaker)
if (prevMarker.length > 0) {
Expand Down

0 comments on commit 2eff477

Please sign in to comment.