diff --git a/module/applications/ui/countdownEdit.mjs b/module/applications/ui/countdownEdit.mjs index 0765e9fb..1dbc56be 100644 --- a/module/applications/ui/countdownEdit.mjs +++ b/module/applications/ui/countdownEdit.mjs @@ -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( diff --git a/module/applications/ui/countdowns.mjs b/module/applications/ui/countdowns.mjs index 46f76c3d..73e36241 100644 --- a/module/applications/ui/countdowns.mjs +++ b/module/applications/ui/countdowns.mjs @@ -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) diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index d2b8dd64..188efafb 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -959,7 +959,7 @@ export const countdownAppMode = { iconOnly: 'icon-only' }; -export const countdownType = { +export const countdownTypes = { encounter: { id: 'encounter', label: 'DAGGERHEART.CONFIG.CountdownType.encounter.label', diff --git a/module/data/countdowns.mjs b/module/data/countdowns.mjs index 4252d87d..6630c302 100644 --- a/module/data/countdowns.mjs +++ b/module/data/countdowns.mjs @@ -35,8 +35,8 @@ export class DhCountdown extends foundry.abstract.DataModel { return { type: new fields.StringField({ required: true, - choices: CONFIG.DH.GENERAL.countdownType, - initial: CONFIG.DH.GENERAL.countdownType.encounter.id, + choices: CONFIG.DH.GENERAL.countdownTypes, + initial: CONFIG.DH.GENERAL.countdownTypes.encounter.id, label: 'DAGGERHEART.GENERAL.type' }), name: new fields.StringField({ @@ -100,7 +100,7 @@ export class DhCountdown extends foundry.abstract.DataModel { : undefined; return { - type: type ?? CONFIG.DH.GENERAL.countdownType.encounter.id, + type: type ?? CONFIG.DH.GENERAL.countdownTypes.encounter.id, name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Countdown.newCountdown'), img: 'icons/magic/time/hourglass-yellow-green.webp', ownership: ownership, diff --git a/module/data/fields/action/countdownField.mjs b/module/data/fields/action/countdownField.mjs index e963fa67..53e132c9 100644 --- a/module/data/fields/action/countdownField.mjs +++ b/module/data/fields/action/countdownField.mjs @@ -8,8 +8,8 @@ export default class CountdownField extends fields.ArrayField { ...game.system.api.data.countdowns.DhCountdown.defineSchema(), type: new fields.StringField({ required: true, - choices: CONFIG.DH.GENERAL.countdownType, - initial: CONFIG.DH.GENERAL.countdownType.encounter.id, + choices: CONFIG.DH.GENERAL.countdownTypes, + initial: CONFIG.DH.GENERAL.countdownTypes.encounter.id, label: 'DAGGERHEART.GENERAL.type' }), name: new fields.StringField({ diff --git a/templates/ui/countdowns/countdowns-view.hbs b/templates/ui/countdowns/countdowns-view.hbs index b4d5adb1..7727c4b6 100644 --- a/templates/ui/countdowns/countdowns-view.hbs +++ b/templates/ui/countdowns/countdowns-view.hbs @@ -6,7 +6,7 @@ {{/unless}}