diff --git a/lang/en.json b/lang/en.json index bf2f0fc3..65bd866f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1549,7 +1549,9 @@ "foreground": "Foreground", "background": "Background", "outline": "Outline", - "edge": "Edge" + "edge": "Edge", + "texture": "Texture", + "colorset": "Colorset" } }, "variantRules": { diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index 78f067c7..a03bef9a 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -36,10 +36,37 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App } }; + /** @inheritdoc */ + static TABS = { + diceSoNice: { + tabs: [ + { id: 'hope', label: 'DAGGERHEART.GENERAL.hope' }, + { id: 'fear', label: 'DAGGERHEART.GENERAL.fear' }, + { id: 'advantage', label: 'DAGGERHEART.GENERAL.Advantage.full' }, + { id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Advantage.full' } + ], + initial: 'hope' + } + }; + + changeTab(tab, group, options) { + super.changeTab(tab, group, options); + + this.render(); + } + async _prepareContext(_options) { const context = await super._prepareContext(_options); context.settingFields = this.settings; + context.diceSoNiceTextures = game.dice3d?.exports?.TEXTURELIST ?? {}; + context.diceSoNiceColorsets = game.dice3d?.exports?.COLORSETS ?? {}; + context.diceTab = { + key: this.tabGroups.diceSoNice, + source: this.settings._source.diceSoNice[this.tabGroups.diceSoNice], + fields: this.settings.schema.fields.diceSoNice.fields[this.tabGroups.diceSoNice].fields + }; + return context; } @@ -65,4 +92,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App this.close(); } + + _getTabs(tabs) { + for (const v of Object.values(tabs)) { + v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active; + v.cssClass = v.active ? 'active' : ''; + } + + return tabs; + } } diff --git a/module/data/settings/Appearance.mjs b/module/data/settings/Appearance.mjs index d8b4c687..81865f10 100644 --- a/module/data/settings/Appearance.mjs +++ b/module/data/settings/Appearance.mjs @@ -20,25 +20,33 @@ export default class DhAppearance extends foundry.abstract.DataModel { foreground: new fields.ColorField({ required: true, initial: '#ffffff' }), background: new fields.ColorField({ required: true, initial: '#ffe760' }), outline: new fields.ColorField({ required: true, initial: '#000000' }), - edge: new fields.ColorField({ required: true, initial: '#ffffff' }) + edge: new fields.ColorField({ required: true, initial: '#ffffff' }), + texture: new fields.StringField({ initial: 'bloodmoon' }), + colorset: new fields.StringField({ initial: 'inspired' }) }), fear: new fields.SchemaField({ foreground: new fields.ColorField({ required: true, initial: '#000000' }), background: new fields.ColorField({ required: true, initial: '#0032b1' }), outline: new fields.ColorField({ required: true, initial: '#ffffff' }), - edge: new fields.ColorField({ required: true, initial: '#000000' }) + edge: new fields.ColorField({ required: true, initial: '#000000' }), + texture: new fields.StringField({ initial: 'bloodmoon' }), + colorset: new fields.StringField({ initial: 'inspired' }) }), advantage: new fields.SchemaField({ foreground: new fields.ColorField({ required: true, initial: '#ffffff' }), background: new fields.ColorField({ required: true, initial: '#008000' }), outline: new fields.ColorField({ required: true, initial: '#000000' }), - edge: new fields.ColorField({ required: true, initial: '#ffffff' }) + edge: new fields.ColorField({ required: true, initial: '#ffffff' }), + texture: new fields.StringField({ initial: 'bloodmoon' }), + colorset: new fields.StringField({ initial: 'inspired' }) }), disadvantage: new fields.SchemaField({ foreground: new fields.ColorField({ required: true, initial: '#000000' }), background: new fields.ColorField({ required: true, initial: '#b30000' }), outline: new fields.ColorField({ required: true, initial: '#ffffff' }), - edge: new fields.ColorField({ required: true, initial: '#000000' }) + edge: new fields.ColorField({ required: true, initial: '#000000' }), + texture: new fields.StringField({ initial: 'bloodmoon' }), + colorset: new fields.StringField({ initial: 'inspired' }) }) }), showGenericStatusEffects: new fields.BooleanField({ diff --git a/templates/settings/appearance-settings.hbs b/templates/settings/appearance-settings.hbs index f297a28f..c31ac4b2 100644 --- a/templates/settings/appearance-settings.hbs +++ b/templates/settings/appearance-settings.hbs @@ -14,30 +14,56 @@