This commit is contained in:
WBHarry 2026-03-12 17:41:20 +01:00
parent 154b518383
commit b649ec5d08
5 changed files with 87 additions and 76 deletions

View file

@ -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",

View file

@ -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) : {}

View file

@ -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'
]);
};

View file

@ -2,20 +2,6 @@
<fieldset>
<div class="title-hint">{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.hint"}}</div>
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalAnimations"}}</h3>
<div class="split-section">
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.critical.name"}}</label>
{{formInput fields.diceSoNice.fields.sfx.fields.critical.fields.class value=setting.diceSoNice.sfx.critical.class blank="" localize=true}}
</div>
{{#if isGM}}
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.defaultAnimations"}}</label>
<input type="checkbox" class="default-animations-input" {{checked globalOverrides.diceSoNice.sfx.overrideEnabled}} />
</div>
{{/if}}
</div>
<section class='tab-navigation'>
<div class='navigation-container'>
<div class="navigation-inner-container">
@ -33,67 +19,26 @@
</section>
{{#each dsnTabs as |dsnTab|}}
<section class="tab {{#if dsnTab.active}} active{{/if}}" data-group="{{dsnTab.group}}" data-tab="{{dsnTab.id}}">
{{#if dsnTab.diceTab}}
{{> "systems/daggerheart/templates/settings/appearance-settings/diceSoNiceTab.hbs" dsnTab }}
{{else}}
<div class="field-section">
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceAppearance"}}</h3>
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.system"}}</label>
{{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}}
</div>
<div class="split-section">
{{#if ../isGM}}
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalSettings"}}</h3>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.foreground"}}</label>
{{formInput fields.foreground value=values.foreground localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.background"}}</label>
{{formInput fields.background value=values.background localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.outline"}}</label>
{{formInput fields.outline value=values.outline localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.edge"}}</label>
{{formInput fields.edge value=values.edge localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.colorset"}}</label>
{{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.texture"}}</label>
{{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.material"}}</label>
{{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.font"}}</label>
{{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}}
</div>
</div>
{{#if dsnTab.animations}}
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.animations"}}</h3>
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.higher.name"}}</label>
{{formInput fields.sfx.fields.higher.fields.class value=values.sfx.higher.class blank="" localize=true}}
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.defaultAnimations"}}</label>
<input type="checkbox" class="default-animations-input" {{checked ../globalOverrides.diceSoNice.sfx.overrideEnabled}} />
</div>
{{/if}}
<div class="diceSoNice-footer">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.previewAnimation"}}</label>
<select name="{{concat dsnTab.id "PreviewAnimation"}}">
{{selectOptions @root.animationEvents selected=@root.previewAnimation blank="" localize=true }}
</select>
<button type="button" data-action="preview" data-key="{{dsnTab.id}}">
<i class="fa-solid fa-dice"></i>
<span>{{localize "DAGGERHEART.GENERAL.preview"}}</span>
</button>
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.globalAnimations"}}</h3>
<div class="split-section">
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.critical.name"}}</label>
{{formInput ../fields.diceSoNice.fields.sfx.fields.critical.fields.class value=../setting.diceSoNice.sfx.critical.class blank="" localize=true}}
</div>
</div>
</div>
{{/if}}
</section>
{{/each}}
</fieldset>

View file

@ -0,0 +1,61 @@
<div class="field-section">
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceAppearance"}}</h3>
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.system"}}</label>
{{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}}
</div>
<div class="split-section">
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.foreground"}}</label>
{{formInput fields.foreground value=values.foreground localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.background"}}</label>
{{formInput fields.background value=values.background localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.outline"}}</label>
{{formInput fields.outline value=values.outline localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.edge"}}</label>
{{formInput fields.edge value=values.edge localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.colorset"}}</label>
{{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.texture"}}</label>
{{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.material"}}</label>
{{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}}
</div>
<div class="label-container">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.font"}}</label>
{{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}}
</div>
</div>
{{#if dsnTab.animations}}
<h3>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.animations"}}</h3>
<div class="label-container full-width">
<label>{{localize "DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.higher.name"}}</label>
{{formInput fields.sfx.fields.higher.fields.class value=values.sfx.higher.class blank="" localize=true}}
</div>
{{/if}}
<div class="diceSoNice-footer">
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.previewAnimation"}}</label>
<select name="{{concat dsnTab.id "PreviewAnimation"}}">
{{selectOptions @root.animationEvents selected=@root.previewAnimation blank="" localize=true }}
</select>
<button type="button" data-action="preview" data-key="{{dsnTab.id}}">
<i class="fa-solid fa-dice"></i>
<span>{{localize "DAGGERHEART.GENERAL.preview"}}</span>
</button>
</div>
</div>