Autmor / yourTurn

Foundry Module that adds a visual display whenever the turn changes.
6 stars 15 forks source link

how to disable next combatant + small code edit for clean remove #26

Open Abriel-FR opened 9 months ago

Abriel-FR commented 9 months ago

Hello, First thank for this mod that i appreciate !

My need is that i want disable the next combatant for reason :) i changed the next combattant to false in the code, in work perfectly BUT it still revert a "null" ugly text :)

So here i share my edit in the yourTurn.js :

static getNextTurnHtml(combatant)
{
    let displayNext = false;

    let name = combatant.name;
    let imgClass = "yourTurnImg yourTurnSubheading";

    if (game.modules.get('combat-utility-belt')?.active) 
    {
        if(game.cub.hideNames.shouldReplaceName(combatant?.actor))
        {
            name = game.cub.hideNames.getReplacementName(combatant?.actor)
            imgClass = imgClass + " silhoutte";
        }        
    }

    //displayNext = (j != combat.turns.length);

    if(displayNext)
    {
        let rv = `<div class="yourTurnSubheading last">${game.i18n.localize('YOUR-TURN.NextUp')}:  <img class="${imgClass}" src="${combatant.actor.img}"></img>${name}</div>`;
        console.log(rv);
        return rv;
    }
    else
    {
        return  " ";
    }

The obvious change true -> false :
let displayNext = false;

the subtil one, so no text appear : null -> " ": else { return " "; } Juste wanted to share that. Can be modified if you do an update in the futur.