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",
|
"hint": "Apply variant rules from the Daggerheart system",
|
||||||
"name": "Variant Rules",
|
"name": "Variant Rules",
|
||||||
"actionTokens": "Action Tokens"
|
"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": {
|
"Resources": {
|
||||||
|
|
|
||||||
|
|
@ -57,21 +57,21 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
|
|
||||||
const adversaries = context.turns?.filter(x => x.isNPC) ?? [];
|
const adversaries = context.turns?.filter(x => x.isNPC) ?? [];
|
||||||
const characters = 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
|
const spotlightRequests = characters
|
||||||
?.filter(x => !x.isNPC)
|
?.filter(x => !x.isNPC && spotlightQueueEnabled)
|
||||||
.filter(x => x.system.spotlight.requestOrderIndex > 0)
|
.filter(x => x.system.spotlight.requestOrderIndex > 0)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const valueA = a.system.spotlight.requestOrderIndex;
|
const valueA = a.system.spotlight.requestOrderIndex;
|
||||||
const valueB = b.system.spotlight.requestOrderIndex;
|
const valueB = b.system.spotlight.requestOrderIndex;
|
||||||
|
|
||||||
return valueA - valueB;
|
return valueA - valueB;
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.assign(context, {
|
Object.assign(context, {
|
||||||
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||||
adversaries,
|
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
|
spotlightRequests
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ export const gameSettings = {
|
||||||
LevelTiers: 'LevelTiers',
|
LevelTiers: 'LevelTiers',
|
||||||
Countdowns: 'Countdowns',
|
Countdowns: 'Countdowns',
|
||||||
LastMigrationVersion: 'LastMigrationVersion',
|
LastMigrationVersion: 'LastMigrationVersion',
|
||||||
TagTeamRoll: 'TagTeamRoll'
|
TagTeamRoll: 'TagTeamRoll',
|
||||||
|
SpotlightRequestQueue: 'SpotlightRequestQueue',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const actionAutomationChoices = {
|
export const actionAutomationChoices = {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,16 @@ export const registerDHSettings = () => {
|
||||||
registerMenuSettings();
|
registerMenuSettings();
|
||||||
registerMenus();
|
registerMenus();
|
||||||
registerNonConfigSettings();
|
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 = () => {
|
const registerMenuSettings = () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue