mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
add spotlight requests section to combat tracker
This commit is contained in:
parent
66218ff943
commit
5b4efdbb78
3 changed files with 11 additions and 4 deletions
|
|
@ -1884,6 +1884,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"SpotlightRequests": {
|
||||
"singular": "Spotlight Request",
|
||||
"plural": "Spotlight Requests"
|
||||
},
|
||||
"Tabs": {
|
||||
"details": "Details",
|
||||
"attack": "Attack",
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
const adversaries = context.turns?.filter(x => x.isNPC) ?? [];
|
||||
const characters = context.turns?.filter(x => !x.isNPC) ?? [];
|
||||
|
||||
const sortedCharacters = characters
|
||||
const spotlightRequests = characters
|
||||
?.filter(x => !x.isNPC)
|
||||
.filter(x => x.system.spotlight.requestOrderIndex > 0)
|
||||
.sort((a, b) => {
|
||||
|
|
@ -44,13 +44,13 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
const valueB = b.system.spotlight.requestOrderIndex;
|
||||
|
||||
return valueA - valueB;
|
||||
})
|
||||
.concat(characters?.filter(x => !x.isNPC).filter(x => x.system.spotlight.requestOrderIndex == 0));
|
||||
});
|
||||
|
||||
Object.assign(context, {
|
||||
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||
adversaries,
|
||||
characters: sortedCharacters
|
||||
characters: characters?.filter(x => !x.isNPC).filter(x => x.system.spotlight.requestOrderIndex == 0),
|
||||
spotlightRequests
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<div class="combat-tracker">
|
||||
{{#if (gt this.spotlightRequests.length 0)}}
|
||||
{{> 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.SpotlightRequests.plural") turns=this.spotlightRequests}}
|
||||
{{/if}}
|
||||
{{#if (gt this.characters.length 0)}}
|
||||
{{> 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.Character.plural") turns=this.characters}}
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue