Get most of the custom Initiative sorting stuff through the door

This commit is contained in:
Oliver-Akins 2025-02-14 00:04:48 -07:00
parent ed93e9f927
commit e302b56a4e
10 changed files with 142 additions and 14 deletions

View file

@ -116,7 +116,7 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
ctx.fate.selected = ctx.actor.system.fate;
ctx.fate.options = [
{ label: `RipCrypt.common.empty`, v: `` },
...gameTerms.FatePath
...Object.values(gameTerms.FatePath)
.map(v => ({ label: `RipCrypt.common.path.${v}`, value: v })),
];
return ctx;

View file

@ -0,0 +1,27 @@
import { Logger } from "../../utils/Logger.mjs";
const { CombatTracker } = foundry.applications.sidebar.tabs;
export class RipCryptCombatTracker extends CombatTracker {
/**
* @override
*/
async _prepareTurnContext(combat, combatant, index) {
Logger.debug(`_prepareTurnContext`);
const turn = await super._prepareTurnContext(combat, combatant, index);
// if ( !this.viewed ) return;
// ! TODO: This is causing an error while the combat is not active, but is fine when it's active, this needs to be fixed
Logger.debug(turn, combatant);
const groupKey = combatant.groupKey;
if (groupKey) {
turn.active ||= combat.combatant.groupKey === groupKey;
if (turn.active && !turn.css.includes(`active`)) {
turn.css += `active`;
};
};
return turn;
}
};