From b649ec5d0828087f8e2efb10575b13273b563603 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Thu, 12 Mar 2026 17:41:20 +0100 Subject: [PATCH] . --- lang/en.json | 1 + .../settings/appearanceSettings.mjs | 5 +- module/systemRegistration/handlebars.mjs | 3 +- .../appearance-settings/diceSoNice.hbs | 93 ++++--------------- .../appearance-settings/diceSoNiceTab.hbs | 61 ++++++++++++ 5 files changed, 87 insertions(+), 76 deletions(-) create mode 100644 templates/settings/appearance-settings/diceSoNiceTab.hbs diff --git a/lang/en.json b/lang/en.json index 4e724675..c11d926c 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2752,6 +2752,7 @@ "label": "Appearance Settings", "hint": "Modify the look of various parts of the system", "duality": "Duality Rolls", + "globalSettings": "GM Settings", "globalAnimations": "Global Animations", "diceAppearance": "Dice Appearance", "animations": "Animations", diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index 87135b06..9827ad48 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -50,7 +50,8 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App { id: 'hope', label: 'DAGGERHEART.GENERAL.hope' }, { id: 'fear', label: 'DAGGERHEART.GENERAL.fear' }, { id: 'advantage', label: 'DAGGERHEART.GENERAL.Advantage.full' }, - { id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Disadvantage.full' } + { id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Disadvantage.full' }, + { id: 'general', label: 'DAGGERHEART.GENERAL.general' } ], initial: 'hope' } @@ -102,6 +103,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App context.tabs = this._prepareTabs('general'); context.dsnTabs = this._prepareTabs('diceSoNice'); + context.isGM = game.user.isGM; return context; @@ -174,6 +176,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App (acc, key) => ({ ...acc, [key]: { + diceTab: key !== 'general', values: this.setting.diceSoNice[key], fields: this.setting.schema.getField(`diceSoNice.${key}`).fields, animations: ['hope', 'fear'].includes(key) ? getAnimationsOptions(key) : {} diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index 9ccb16f4..f51e1035 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -46,6 +46,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/button-part.hbs', 'systems/daggerheart/templates/ui/itemBrowser/itemContainer.hbs', - 'systems/daggerheart/templates/scene/dh-config.hbs' + 'systems/daggerheart/templates/scene/dh-config.hbs', + 'systems/daggerheart/templates/settings/appearance-settings/diceSoNiceTab.hbs' ]); }; diff --git a/templates/settings/appearance-settings/diceSoNice.hbs b/templates/settings/appearance-settings/diceSoNice.hbs index 3e46b38e..c76ee7e3 100644 --- a/templates/settings/appearance-settings/diceSoNice.hbs +++ b/templates/settings/appearance-settings/diceSoNice.hbs @@ -2,20 +2,6 @@
{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.hint"}}
-

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalAnimations"}}

-
-
- - {{formInput fields.diceSoNice.fields.sfx.fields.critical.fields.class value=setting.diceSoNice.sfx.critical.class blank="" localize=true}} -
- {{#if isGM}} -
- - -
- {{/if}} -
-
{{#each dsnTabs as |dsnTab|}}
-
-

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceAppearance"}}

- -
- - {{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}} + {{#if dsnTab.diceTab}} + {{> "systems/daggerheart/templates/settings/appearance-settings/diceSoNiceTab.hbs" dsnTab }} + {{else}} +
+ {{#if ../isGM}} +

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalSettings"}}

+
+ + +
+ {{/if}} +

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalAnimations"}}

+
+
+ + {{formInput ../fields.diceSoNice.fields.sfx.fields.critical.fields.class value=../setting.diceSoNice.sfx.critical.class blank="" localize=true}} +
+
-
-
- - {{formInput fields.foreground value=values.foreground localize=true}} -
-
- - {{formInput fields.background value=values.background localize=true}} -
-
- - {{formInput fields.outline value=values.outline localize=true}} -
-
- - {{formInput fields.edge value=values.edge localize=true}} -
-
- - {{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}} -
-
- - {{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}} -
-
- - {{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}} -
-
- - {{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}} -
-
- - {{#if dsnTab.animations}} -

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.animations"}}

-
- - {{formInput fields.sfx.fields.higher.fields.class value=values.sfx.higher.class blank="" localize=true}} -
- {{/if}} - - -
+ {{/if}}
{{/each}}
diff --git a/templates/settings/appearance-settings/diceSoNiceTab.hbs b/templates/settings/appearance-settings/diceSoNiceTab.hbs new file mode 100644 index 00000000..fad5b7b0 --- /dev/null +++ b/templates/settings/appearance-settings/diceSoNiceTab.hbs @@ -0,0 +1,61 @@ +
+

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceAppearance"}}

+ +
+ + {{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}} +
+
+
+ + {{formInput fields.foreground value=values.foreground localize=true}} +
+
+ + {{formInput fields.background value=values.background localize=true}} +
+
+ + {{formInput fields.outline value=values.outline localize=true}} +
+
+ + {{formInput fields.edge value=values.edge localize=true}} +
+
+ + {{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}} +
+
+ + {{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}} +
+
+ + {{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}} +
+
+ + {{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}} +
+
+ + {{#if dsnTab.animations}} +

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.animations"}}

+
+ + {{formInput fields.sfx.fields.higher.fields.class value=values.sfx.higher.class blank="" localize=true}} +
+ {{/if}} + + +
\ No newline at end of file