diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index 7b1227c..c82f66b 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -94,6 +94,17 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { this._prepareSkillTooltips(); } + // Handle private sanity setting, override for GMs. + const keepSanityPrivate = game.settings.get( + "deltagreen", + "keepSanityPrivate", + ); + const hideSan = keepSanityPrivate && !game.user.isGM; + + context.maxSan = hideSan ? "???" : this.actor.system.sanity.max; + context.currentSan = hideSan ? "???" : this.actor.system.sanity.value; + context.keepSanityPrivate = keepSanityPrivate; + // Set sanity block per actor type. context.sanityInputs = await foundry.applications.handlebars.renderTemplate( `${DGActorSheet.TEMPLATE_PATH}/partials/sanity-${this.actor.type}.html`, diff --git a/templates/actor/partials/sanity-agent.html b/templates/actor/partials/sanity-agent.html index 3a84228..d3658d2 100644 --- a/templates/actor/partials/sanity-agent.html +++ b/templates/actor/partials/sanity-agent.html @@ -1,27 +1,14 @@ -{{#if (keepSanityPrivate)}} - -/ -
-
???
-
-{{else}} /
-
{{numberFormat actor.system.sanity.max decimals=0 sign=false}}
+
{{ maxSan }}
-{{/if}}