Skip to content

Commit

Permalink
rendering fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jul 14, 2021
1 parent ff75d8e commit 93aa6dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packs/macros.db
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"name":"Create Boss Bar MLT","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/unholy/hand-claw-glow-orange.webp","scope":"global","command":"//Put the name of the token in the MLT arguments field\n\nlet bbtoken = canvas.tokens.placeables.find(t=>t.data.name==args[0])\nif(!canvas.scene._bossBars || !canvas.scene._bossBars[bbtoken.id]){\nif(game.user.isGM)BossBar.create(bbtoken)\n}","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.OqEpN5Ub8wadJNAr"}},"_id":"LD5Wc6K0vLQw0att"}
{"name":"Remove custom bar for token","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/svg/dice-target.svg","scope":"global","command":"let ctoken = canvas.tokens.controlled[0]\nunsetFlagsForToken(ctoken)\nasync function unsetFlagsForToken(token){\nawait token.document.unsetFlag(\"bossbar\", \"bgTex\")\nawait token.document.unsetFlag(\"bossbar\", \"fgTex\")\n}","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.04DDbjukwigEJq1D"}},"_id":"NgsZIUucxqVrddbx"}
{"name":"Set custom bar for token","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/svg/dice-target.svg","scope":"global","command":"let ctoken = canvas.tokens.controlled[0]\nconst backgroundImg = \"\"\nconst foregroundImg = \"\"\nsetFlagsForToken(ctoken)\nasync function setFlagsForToken(token){\nawait token.document.setFlag(\"bossbar\", \"bgTex\",backgroundImg)\nawait token.document.setFlag(\"bossbar\", \"fgTex\",foregroundImg)\n}","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.bPTJoRUXU1MqO0CF"}},"_id":"ZxpprfiHveCnuyTR"}
{"name":"Create Boss Bar MLT(Camera Pan)","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/unholy/hand-fire-skeleton-pink.webp","scope":"global","command":"//Put the name of the token in the MLT arguments field\n\nlet bbtoken = canvas.tokens.placeables.find(t=>t.data.name==args[0])\nif(!canvas.scene._bossBars || !canvas.scene._bossBars[bbtoken.id]){\nif(game.user.isGM){\nBossBar.panCamera(bbtoken)\nBossBar.create(bbtoken)\n}\n}","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.ysnG5S2jR18S9QEF"}},"_id":"iWwnlmoMWqNGJ54U"}
{"name":"Add Selected Token to Boss Bar","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/unholy/hand-light-pink.webp","scope":"global","command":"BossBar.create(_token)","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.070NA2tmF2bhZ2Li"}},"_id":"dqmTmcs9mefSCdCv"}
{"name":"Remove Selected token from Boss Bar","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/unholy/strike-body-explode-disintegrate.webp","scope":"global","command":"canvas.scene._bossBars[_token.id].destroy()","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.SGGHqfDRzqwFcRv0"}},"_id":"i584asmB1rm9ID1Z"}
{"name":"Create Boss Bar MLT(Camera Pan)","type":"script","author":"Cspu3pxFr7tu7SU7","img":"icons/magic/unholy/hand-fire-skeleton-pink.webp","scope":"global","command":"//Put the name of the token in the MLT arguments field\n\nlet bbtoken = canvas.tokens.placeables.find(t=>t.data.name==args[0])\nif(!canvas.scene._bossBars || !canvas.scene._bossBars[bbtoken.id]){\nif(game.user.isGM){\nBossBar.panCamera(bbtoken)\nBossBar.create(bbtoken)\n}\n}","folder":null,"sort":0,"permission":{"default":0,"Cspu3pxFr7tu7SU7":3},"flags":{"advanced-macros":{"runAsGM":false},"core":{"sourceId":"Macro.ysnG5S2jR18S9QEF"}},"_id":"iWwnlmoMWqNGJ54U"}
6 changes: 4 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ Hooks.once("ready", function () {
scope: "world",
});

Hooks.on("renderApplication", async () => {
BossBar.renderBossBar();
Hooks.on("renderApplication", (app) => {
if (app.id == "controls" || app.id =="navigation" || app.id == "camera-views") {
BossBar.renderBossBar();
}
});
BossBar.renderBossBar();
});
Expand Down

0 comments on commit 93aa6dd

Please sign in to comment.