ENH: Slow icon

master
U~man 2020-07-10 21:14:11 +02:00
parent 78869bb702
commit 30f68727dc
2 changed files with 5 additions and 2 deletions

View File

@ -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;
}

View File

@ -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' ? '<i class="fas fa-weight-hanging"></i>' : span.innerHTML;
})
let init = game.settings.get("ose", "individualInit");
if (!init) {
OseCombat.format(object, html, data);