diff --git a/css/deltagreen.css b/css/deltagreen.css index ded1f8e..169e174 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -56,13 +56,13 @@ /* Character Sheet Style Options */ -form.outlaw-style, -form.cowboy-style { +.window-content.outlaw-style, +.window-content.cowboy-style { background: url("../assets/img/StainedPlainPaper10b.webp") !important; background-size: 100% !important; } -form.program-style { +.window-content.program-style { background: url("../assets/img/StainedPlainPaper10a.webp") !important; background-size: 100% !important; } @@ -76,11 +76,11 @@ form.program-style { font-family: "PublicSans", sans-serif !important; } -.outlaw-style .cowboy-style .tabs .item { +.outlaw-style .cowboy-style .tabs [data-action="tab"] { background: rgba(173, 151, 101, 0.3); } -.program-style .tabs .item { +.program-style .tabs [data-action="tab"] { background: rgba(138, 136, 133, 0.3); } @@ -369,7 +369,7 @@ explicitly define a number of rows, rather than columns. */ padding-bottom: 0px !important; } -.deltagreen .tabs .item { +.deltagreen .tabs [data-action="tab"] { font-weight: bold; vertical-align: middle !important; line-height: inherit; @@ -382,7 +382,7 @@ explicitly define a number of rows, rather than columns. */ /*background: rgba(173, 151, 101, 0.3);*/ } -.deltagreen .tabs .item.active { +.deltagreen .tabs [data-action="tab"].active { text-shadow: none; font-style: italic; border: #000; @@ -390,12 +390,12 @@ explicitly define a number of rows, rather than columns. */ border-style: solid; } -.deltagreen .program-style .tabs .item.active { +.deltagreen .program-style .tabs [data-action="tab"].active { background-color: #000000; color: #ffffff; } -.deltagreen .cowboy-style .tabs .item.active { +.deltagreen .cowboy-style .tabs [data-action="tab"].active { background-color: rgba(156, 115, 18, 0.3); color: #000000; } diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 5f52a50..2ef9ae8 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -13,16 +13,8 @@ const { ActorSheetV2 } = foundry.applications.sheets; export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { /** @override */ static DEFAULT_OPTIONS = /** @type {const} */ ({ - classes: ["deltagreen", "sheet", "actor"], - template: "systems/deltagreen/templates/actor/actor-sheet.html", + css: ["actor"], position: { width: 750, height: 770 }, - tabs: [ - { - navSelector: ".sheet-tabs", - contentSelector: ".sheet-body", - initial: "skills", - }, - ], }); static TABS = /** @type {const} */ ({ @@ -30,13 +22,13 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { initial: "skills", labelPrefix: "DG.Navigation", tabs: [ - { id: "skills" }, - { id: "physical" }, - { id: "motivations" }, - { id: "gear" }, - { id: "bio" }, - { id: "bonds" }, - { id: "about" }, + { id: "skills", label: "Skills" }, + { id: "physical", label: "Physical" }, + { id: "motivations", label: "Mental" }, + { id: "gear", label: "Gear" }, + { id: "bio", label: "CV" }, + { id: "bonds", label: "Contacts" }, + { id: "about", icon: "fas fa-question-circle", label: "" }, ], }, }); @@ -45,6 +37,9 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { main: { template: `systems/${DG.ID}/templates/actor/actor-sheet.html`, }, + tabs: { + template: `templates/generic/tab-navigation.hbs`, // From FoundryVTT + }, }); /* -------------------------------------------- */ @@ -75,19 +70,6 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { return "systems/deltagreen/templates/actor/limited-sheet.html"; } - /** @inheritdoc */ - async _prepareContext(options) { - const context = await super._prepareContext(options); - - // // Prepare tabs - // context.tabs = {}; - // Object.keys(DeltaGreenActorSheet.TABS).forEach((tabGroup) => { - // context.tabs[tabGroup] = this._prepareTabs(tabGroup); - // }); - - return context; - } - /** @override */ async getData() { const data = super.getData(); diff --git a/module/base-sheet.js b/module/base-sheet.js index 771ee10..62221fe 100644 --- a/module/base-sheet.js +++ b/module/base-sheet.js @@ -14,6 +14,14 @@ const DGSheetMixin = (Base) => { /** @inheritdoc */ static TEMPLATE_PATH = /** @type {const} */ (`systems/${DG.ID}/templates`); + static get THEME() { + return game.settings.get(DG.ID, "characterSheetStyle"); + } + + get THEME() { + return this.constructor.THEME; + } + /** @inheritdoc */ async _prepareContext(options) { const context = await super._prepareContext(options); @@ -24,6 +32,16 @@ const DGSheetMixin = (Base) => { return context; } + /** @inheritdoc */ + + async _onFirstRender(context, options) { + await super._onFirstRender(context, options); + + const html = this.element; + html + .querySelector(".window-content") + .classList.add(`${this.THEME}-style`); + } /** @inheritdoc */ async _onRender(context, options) { diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 3679bfc..efb6bc1 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -1,4 +1,4 @@ -
+ {{!-- Sheet Header --}}
@@ -76,17 +76,6 @@
- {{!-- Sheet Tab Navigation --}} - - {{!-- Sheet Body --}}