mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Make the spotlight queue feature a toggle (default off) (#1418)
This commit is contained in:
parent
46a9aea029
commit
64caff6fb2
4 changed files with 20 additions and 4 deletions
|
|
@ -2504,6 +2504,11 @@
|
|||
"hint": "Apply variant rules from the Daggerheart system",
|
||||
"name": "Variant Rules",
|
||||
"actionTokens": "Action Tokens"
|
||||
},
|
||||
"SpotlightRequestQueue": {
|
||||
"name": "Spotlight Request Queue",
|
||||
"label": "Spotlight Request Queue",
|
||||
"hint": "Adds more structure to spotlight requests by ordering them from oldest to newest"
|
||||
}
|
||||
},
|
||||
"Resources": {
|
||||
|
|
|
|||
|
|
@ -57,21 +57,21 @@ 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 spotlightQueueEnabled = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.SpotlightRequestQueue);
|
||||
|
||||
const spotlightRequests = characters
|
||||
?.filter(x => !x.isNPC)
|
||||
?.filter(x => !x.isNPC && spotlightQueueEnabled)
|
||||
.filter(x => x.system.spotlight.requestOrderIndex > 0)
|
||||
.sort((a, b) => {
|
||||
const valueA = a.system.spotlight.requestOrderIndex;
|
||||
const valueB = b.system.spotlight.requestOrderIndex;
|
||||
|
||||
return valueA - valueB;
|
||||
});
|
||||
|
||||
Object.assign(context, {
|
||||
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||
adversaries,
|
||||
characters: characters?.filter(x => !x.isNPC).filter(x => x.system.spotlight.requestOrderIndex == 0),
|
||||
characters: characters?.filter(x => !x.isNPC).filter(x => !spotlightQueueEnabled || x.system.spotlight.requestOrderIndex == 0),
|
||||
spotlightRequests
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ export const gameSettings = {
|
|||
LevelTiers: 'LevelTiers',
|
||||
Countdowns: 'Countdowns',
|
||||
LastMigrationVersion: 'LastMigrationVersion',
|
||||
TagTeamRoll: 'TagTeamRoll'
|
||||
TagTeamRoll: 'TagTeamRoll',
|
||||
SpotlightRequestQueue: 'SpotlightRequestQueue',
|
||||
};
|
||||
|
||||
export const actionAutomationChoices = {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,16 @@ export const registerDHSettings = () => {
|
|||
registerMenuSettings();
|
||||
registerMenus();
|
||||
registerNonConfigSettings();
|
||||
|
||||
game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.SpotlightRequestQueue, {
|
||||
name: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.SpotlightRequestQueue.name'),
|
||||
label: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.SpotlightRequestQueue.label'),
|
||||
hint: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.SpotlightRequestQueue.hint'),
|
||||
scope: 'world',
|
||||
config: true,
|
||||
type: Boolean,
|
||||
onChange: () => ui.combat.render(),
|
||||
})
|
||||
};
|
||||
|
||||
const registerMenuSettings = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue