This commit is contained in:
WBHarry 2026-06-15 15:39:09 +02:00
parent 2a16b15140
commit 351f97f391
6 changed files with 13 additions and 14 deletions

View file

@ -45,7 +45,7 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
context.isGM = game.user.isGM;
context.ownershipDefaultOptions = CONFIG.DH.GENERAL.basicOwnershiplevels;
context.defaultOwnership = this.data.defaultOwnership;
context.countdownTypes = CONFIG.DH.GENERAL.countdownType;
context.countdownTypes = CONFIG.DH.GENERAL.countdownTypes;
context.countdownProgressionTypes = CONFIG.DH.GENERAL.countdownProgressionTypes;
context.countdownLoopingTypes = CONFIG.DH.GENERAL.countdownLoopingTypes;
context.hideNewCountdowns = this.hideNewCountdowns;
@ -62,7 +62,7 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
const randomizeValid = !new Roll(countdown.progress.startFormula ?? '').isDeterministic;
acc[key] = {
...countdown,
typeName: game.i18n.localize(CONFIG.DH.GENERAL.countdownType[countdown.type].label),
typeName: game.i18n.localize(CONFIG.DH.GENERAL.countdownTypes[countdown.type].label),
progress: {
...countdown.progress,
typeName: game.i18n.localize(

View file

@ -1,6 +1,5 @@
import { waitForDiceSoNice } from '../../helpers/utils.mjs';
import { emitGMUpdate, GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
import { SYSTEM } from './../../../module/config/system.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
@ -39,7 +38,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
},
actions: {
toggleViewMode: DhCountdowns.#onToggleViewMode,
onToggleCountdownTypes: DhCountdowns.#onToggleCountdownTypes,
toggleCountdownTypes: DhCountdowns.#onToggleCountdownTypes,
editCountdowns: DhCountdowns.#onEditCountdowns,
loopCountdown: DhCountdowns.#onLoopCountdown,
decreaseCountdown: (_, target) => this.editCountdown(false, target),
@ -65,7 +64,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
* @returns {string[]}
*/
get visibleCountdownTypes() {
const { encounter, narrative } = SYSTEM.GENERAL.countdownType;
const { encounter, narrative } = CONFIG.DH.GENERAL.countdownTypes;
return game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
?? [encounter.id, narrative.id];
}
@ -173,7 +172,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
loopTooltip: isLooping && game.i18n.localize(loopTooltip)
};
return acc;
}, Object.keys(CONFIG.DH.GENERAL.countdownType).reduce((acc, key) => {
}, Object.keys(CONFIG.DH.GENERAL.countdownTypes).reduce((acc, key) => {
acc[key] = {};
return acc;
}, {}));
@ -191,7 +190,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
context.userCountdownTypes = this.visibleCountdownTypes;
context.typeToggles =
Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({
Object.values(CONFIG.DH.GENERAL.countdownTypes).map(type => ({
type: type.id,
label: game.i18n.localize(type.shortLabel),
active: context.userCountdownTypes.includes(type.id)