From f05311d7c886bf52dc52cddb88727403f674e6db Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 6 Apr 2026 22:47:53 -0600 Subject: [PATCH] Hide the "% used" indicator when there is no maximum capacity, and add a placeholder to be more explicit for the input --- langs/en-ca.json | 1 + module/apps/PlayerSheet.mjs | 1 + styles/elements/input.css | 4 ++++ templates/PlayerSheet/item-lists.hbs | 15 +++++++++------ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/langs/en-ca.json b/langs/en-ca.json index 8cd6796..a21cfbd 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -87,6 +87,7 @@ "max-value": "Maximum value", "carry-capacity-used": "({percent}% Used)", "carrying-capacity": { + "placeholder": "Unlimited", "title": "Carrying Capacity:", "label": "Maximum carrying weight" }, diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index 3840238..22903f9 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -272,6 +272,7 @@ export class PlayerSheet extends }; ctx.totalWeight = config.weightFormatter(totalWeight); + ctx.hasCarryingCapacity = this.actor.system.carryCapacity != null; ctx.carryCapacityPercent = Math.round(totalWeight / this.actor.system.carryCapacity * 100); }; diff --git a/styles/elements/input.css b/styles/elements/input.css index 677ab94..93396b2 100644 --- a/styles/elements/input.css +++ b/styles/elements/input.css @@ -1,6 +1,10 @@ .taf > .window-content input { border: none; + &::placeholder { + color: color-mix(in srgb, currentColor 40%, transparent 60%); + } + &.large { --input-height: 2.5rem; font-size: 1.75rem; diff --git a/templates/PlayerSheet/item-lists.hbs b/templates/PlayerSheet/item-lists.hbs index bd1bc30..ed6abf0 100644 --- a/templates/PlayerSheet/item-lists.hbs +++ b/templates/PlayerSheet/item-lists.hbs @@ -7,12 +7,14 @@

{{localize "taf.Apps.PlayerSheet.carrying-capacity.title"}}

-
- {{localize - "taf.Apps.PlayerSheet.carry-capacity-used" - percent=carryCapacityPercent - }} -
+ {{#if hasCarryCapacity}} +
+ {{localize + "taf.Apps.PlayerSheet.carry-capacity-used" + percent=carryCapacityPercent + }} +
+ {{/if}}