From 30f68727dc638e9edcc251c824f591c6b4479d7a Mon Sep 17 00:00:00 2001 From: U~man Date: Fri, 10 Jul 2020 21:14:11 +0200 Subject: [PATCH] ENH: Slow icon --- src/module/combat.js | 2 +- src/ose.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/module/combat.js b/src/module/combat.js index ad64c8c..172b633 100644 --- a/src/module/combat.js +++ b/src/module/combat.js @@ -18,7 +18,7 @@ export class OseCombat { // Set init for (let i = 0; i < data.combatants.length; ++i) { if (data.combatants[i].actor.data.data.isSlow) { - data.combatants[i].initiative = -1; + data.combatants[i].initiative = -789; } else { data.combatants[i].initiative = groups[data.combatants[i].flags.ose.group].initiative; } diff --git a/src/ose.js b/src/ose.js index 77ec6be..9b1532c 100644 --- a/src/ose.js +++ b/src/ose.js @@ -109,12 +109,15 @@ Hooks.on("preUpdateCombatant", (combat, combatant, data, diff, id) => { }); } else if (data.initiative && init) { if (combatant.actor.data.data.isSlow) { - data.initiative = -1; + data.initiative = -789; } } }); Hooks.on("renderCombatTracker", (object, html, data) => { + html.find('.initiative').each((_, span) => { + span.innerHTML = span.innerHTML == '-789.00' ? '' : span.innerHTML; + }) let init = game.settings.get("ose", "individualInit"); if (!init) { OseCombat.format(object, html, data);