module/combat-tracker.js
/**
     * Handle a Combatant control toggle
     * @private
     * @param {Event} event   The originating mousedown event
     */
Handle a Combatant control toggle
@private
@param {Event} event   The originating mousedown event
Handle a Combatant control toggle @private @param { Event } event The originating mousedown event
async _onCombatantControl(event) {
        event.preventDefault();
        event.stopPropagation();
        const btn = event.currentTarget;
        const li = btn.closest(".combatant");
        const combat = this.viewed;
        const c = combat.combatants.get(li.dataset.combatantId);
        switch (btn.dataset.control) {
            case "toggleHidden":
                return c.update({ hidden: !c.hidden });
            case "toggleDefeated":
                return this._onToggleDefeatedStatus(c);
            case "rollInitiative":
                let roll = new game.quest.QuestRoll("1d20");
                await roll.evaluate({ async: true });
                roll.toMessage({
                    user: game.user.id,
                    speaker: ChatMessage.getSpeaker({ actor: c.actor })
                });
                return true;
        }
    }
async _onCombatantControl ( event ) { event . preventDefault ( ) ; event . stopPropagation ( ) ; const btn = event . currentTarget ; const li = btn . closest ( ".combatant" ) ; const combat = this . viewed ; const c = combat . combatants . get ( li . dataset . combatantId ) ; switch ( btn . dataset . control ) { case "toggleHidden" : return c . update ( { hidden : ! c . hidden } ) ; case "toggleDefeated" : return this . _onToggleDefeatedStatus ( c ) ; case "rollInitiative" : let roll = new game . quest . QuestRoll ( "1d20" ) ; await roll . evaluate ( { async : true } ) ; roll . toMessage ( { user : game . user . id , speaker : ChatMessage . getSpeaker ( { actor : c . actor } ) } ) ; return true ; } }
Handle a Combatant control toggle
 @private
 @param {Event} event   The originating mousedown event
Handle a Combatant control toggle @private @param { Event } event The originating mousedown event
// Switch control action // Toggle combatant defeated flag // Roll combatant initiative