add title. remove localization from settings file since it didn't work.

This commit is contained in:
IrkTheImp 2025-06-28 00:47:12 -05:00
parent a4c7533743
commit 32c224c472
4 changed files with 13 additions and 4 deletions

View file

@ -171,9 +171,11 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
if (obj.hasOwnProperty(key)) {
const value = obj[key];
if (typeof value === 'object' && value !== null) {
obj[key] = this.localizeObject(value);
} else {
if (typeof value === 'string' && value.startsWith('DAGGERHEART.')) {
obj[key] = game.i18n.localize(value);
console.log(obj[key]);
}
}
}

View file

@ -17,24 +17,29 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
initial: () => [2, 1, 1, 0, 0, -1]
}),
currency: new fields.SchemaField({
title: new fields.StringField({
required: true,
initial: 'Gold',
label: 'DAGGERHEART.Settings.Homebrew.Currency.currencyName'
}),
coins: new fields.StringField({
required: true,
initial: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Coins'),
initial: 'Coins',
label: 'DAGGERHEART.Settings.Homebrew.Currency.coinName'
}),
handfulls: new fields.StringField({
required: true,
initial: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Handfulls'),
initial: 'Handfulls',
label: 'DAGGERHEART.Settings.Homebrew.Currency.handfullName'
}),
bags: new fields.StringField({
required: true,
initial: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Bags'),
initial: 'Bags',
label: 'DAGGERHEART.Settings.Homebrew.Currency.bagName'
}),
chests: new fields.StringField({
required: true,
initial: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Chests'),
initial: 'Chests',
label: 'DAGGERHEART.Settings.Homebrew.Currency.chestName'
})
}),