From fc5809646665fd07e65fa149c7972aee27a5df31 Mon Sep 17 00:00:00 2001 From: DC23 Date: Wed, 27 Nov 2024 16:36:44 +1100 Subject: [PATCH] making saves-settings.hbs template more generic. fixed required attribute bug for when it is passed into the template as false (it was correct for values of true). #69 --- module/settings/saves-settings.mjs | 3 ++- ...s-settings.hbs => string-array-settings.hbs} | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) rename templates/settings/{saves-settings.hbs => string-array-settings.hbs} (66%) diff --git a/module/settings/saves-settings.mjs b/module/settings/saves-settings.mjs index a2d3aeb..bb71974 100644 --- a/module/settings/saves-settings.mjs +++ b/module/settings/saves-settings.mjs @@ -40,7 +40,7 @@ class SavesSettings extends FormApplication { return foundry.utils.mergeObject(super.defaultOptions, { popOut: true, width: 400, - template: `systems/${SYSTEM_ID}/templates/settings/saves-settings.hbs`, + template: `systems/${SYSTEM_ID}/templates/settings/string-array-settings.hbs`, id: SETTINGS.SAVES_MENU, title: 'BASICFANTASYRPG.Settings.SavesMenu.name', }) @@ -55,6 +55,7 @@ class SavesSettings extends FormApplication { id: v, label: SavesSettings.defaultSaves[v], value: initialValues[v], + required: true, } }) return data diff --git a/templates/settings/saves-settings.hbs b/templates/settings/string-array-settings.hbs similarity index 66% rename from templates/settings/saves-settings.hbs rename to templates/settings/string-array-settings.hbs index 36aca2a..dbc87ff 100644 --- a/templates/settings/saves-settings.hbs +++ b/templates/settings/string-array-settings.hbs @@ -1,17 +1,18 @@ -{{#*inline "savePartial"}} +{{!-- fa + --}} + +{{#*inline "stringFieldPartial"}}
- +
{{/inline}} +{{log this}}
-
- {{localize "BASICFANTASYRPG.Settings.SavesMenu.name"}}: - {{#each this}} - {{> savePartial}} - {{/each}} -
+ {{#each this}} + {{> stringFieldPartial}} + {{/each}}