diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index fff05d7..f42fbee 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -49,7 +49,9 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { this.actor, ); + // Early return if this is a vehicle. if (this.actor.type === "vehicle") return context; + // Make it easy for the sheet handlebars to understand how to sort the skills. context.sortSkillsSetting = game.settings.get("deltagreen", "sortSkills"); @@ -173,6 +175,12 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { this.actor.system.sortedCustomSkills = sortedCustomSkills; } + // Set sanity block per actor type. + context.sanityInputs = await foundry.applications.handlebars.renderTemplate( + `${DGActorSheet.TEMPLATE_PATH}/partials/sanity-${this.actor.type}.html`, + context, + ); + // Set title for Physical Attributes. context.physicalAttributesTitle = game.i18n.localize( "DG.Sheet.BlockHeaders.Attributes", diff --git a/module/templates.js b/module/templates.js index a8957d5..d83d158 100644 --- a/module/templates.js +++ b/module/templates.js @@ -11,6 +11,7 @@ export default async function preloadHandlebarsTemplates() { "systems/deltagreen/templates/actor/npc-limited-sheet.html", "systems/deltagreen/templates/dialog/modify-percentile-roll.html", "systems/deltagreen/templates/actor/vehicle-sheet.html", + "systems/deltagreen/templates/actor/partials/sanity-partial.html", "systems/deltagreen/templates/actor/partials/custom-skills-partial.html", "systems/deltagreen/templates/actor/partials/cv-partial.html", "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html", diff --git a/templates/actor/partials/sanity-agent.html b/templates/actor/partials/sanity-agent.html new file mode 100644 index 0000000..ff9d9db --- /dev/null +++ b/templates/actor/partials/sanity-agent.html @@ -0,0 +1,13 @@ + +/ +
+
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
+
diff --git a/templates/actor/partials/sanity-npc.html b/templates/actor/partials/sanity-npc.html new file mode 100644 index 0000000..1055dcf --- /dev/null +++ b/templates/actor/partials/sanity-npc.html @@ -0,0 +1,11 @@ + +{{localize 'DG.NPCSheet.BreakPointAbbreviation'}}: + diff --git a/templates/actor/partials/sanity-partial.html b/templates/actor/partials/sanity-partial.html new file mode 100644 index 0000000..9c72bdc --- /dev/null +++ b/templates/actor/partials/sanity-partial.html @@ -0,0 +1,14 @@ +
+ +
{{{ sanityInputs }}}
+
diff --git a/templates/actor/partials/sanity-unnatural.html b/templates/actor/partials/sanity-unnatural.html new file mode 100644 index 0000000..838996c --- /dev/null +++ b/templates/actor/partials/sanity-unnatural.html @@ -0,0 +1,7 @@ + +/ + diff --git a/templates/actor/parts/header.html b/templates/actor/parts/header.html index 848c171..9831979 100644 --- a/templates/actor/parts/header.html +++ b/templates/actor/parts/header.html @@ -70,40 +70,7 @@ {{!-- Sanity --}} -
- -
- {{#if (keepSanityPrivate) }} - - / -
-
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
-
- {{/if}} - {{#unless (keepSanityPrivate)}} - - / -
-
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
-
- {{/unless}} -
-
+ {{> "systems/deltagreen/templates/actor/partials/sanity-partial.html" }}