diff --git a/module/settings/settings.mjs b/module/settings/settings.mjs index e63a148..c65ce51 100644 --- a/module/settings/settings.mjs +++ b/module/settings/settings.mjs @@ -1,17 +1,21 @@ +import { BASICFANTASYRPG } from "../helpers/config.mjs" + /** * pseudo-enum to make setting ID references less error prone */ export const SETTINGS = { // AUTO_ROLL_TOKEN_HP: 'autoRollTokenHP', - SAVE_DEATH_NAME: 'saveDeathName', - SAVE_WANDS_NAME: 'saveWandsName', - SAVE_PARALYSIS_NAME: 'saveParalysisName', - SAVE_BREATH_NAME: 'saveBreathName', - SAVE_SPELLS_NAME: 'saveSpellsName', + // use the saves keys as the setting ID to make retrieval easy. + // So long as the system.key is unique, it's fine. + SAVE_DEATH_NAME: 'death', + SAVE_WANDS_NAME: 'wands', + SAVE_PARALYSIS_NAME: 'paralysis', + SAVE_BREATH_NAME: 'breath', + SAVE_SPELLS_NAME: 'spells', } // Use this internally for now. Refactoring the whole system is too big a job! -const SYSTEM_ID = 'basicfantasyrpg' +export const SYSTEM_ID = 'basicfantasyrpg' /** * Array of setting IDs for the settings that should be hidden from diff --git a/module/sheets/actor-sheet.mjs b/module/sheets/actor-sheet.mjs index fe40633..29bd223 100644 --- a/module/sheets/actor-sheet.mjs +++ b/module/sheets/actor-sheet.mjs @@ -1,5 +1,6 @@ import {successChatMessage} from '../helpers/chat.mjs'; import {onManageActiveEffect, prepareActiveEffectCategories} from '../helpers/effects.mjs'; +import { SYSTEM_ID } from '../settings/settings.mjs'; /** * Extend the basic ActorSheet with some very simple modifications @@ -85,7 +86,7 @@ export class BasicFantasyRPGActorSheet extends ActorSheet { _prepareActorData(context) { // Handle saves. for (let [k, v] of Object.entries(context.data.saves)) { - v.label = game.i18n.localize(CONFIG.BASICFANTASYRPG.saves[k]) ?? k; + v.label = game.settings.get(SYSTEM_ID, k) ?? k } }