From a9cc3244df91cec65680498e943dcc09c445d83c Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 28 Dec 2024 14:21:27 -0700 Subject: [PATCH] RC-37 | Abilities | Move & Run Display --- Apps/HeroSummaryCardV1/content.hbs | 10 +++++ Apps/HeroSummaryCardV1/style.css | 43 ++++++++++++++++--- langs/en-ca.json | 7 +++ module/Apps/ActorSheets/HeroSummaryCardV1.mjs | 6 +++ 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/Apps/HeroSummaryCardV1/content.hbs b/Apps/HeroSummaryCardV1/content.hbs index 9b07e8c..4e92245 100644 --- a/Apps/HeroSummaryCardV1/content.hbs +++ b/Apps/HeroSummaryCardV1/content.hbs @@ -68,8 +68,18 @@ {{/each}} {{!-- Health --}} +
{{!-- Move & Run --}} +
+
+ {{speed.move}} + {{speed.run}} +
+ +
{{!-- * Equipment --}} diff --git a/Apps/HeroSummaryCardV1/style.css b/Apps/HeroSummaryCardV1/style.css index 833e76e..1005652 100644 --- a/Apps/HeroSummaryCardV1/style.css +++ b/Apps/HeroSummaryCardV1/style.css @@ -60,13 +60,13 @@ /* grid-template-rows: minmax(0, 3fr) minmax(0, 1fr); */ grid-template-columns: repeat(6, minmax(0, 1fr)); - .ability { - display: grid; - grid-template-rows: minmax(0, 3fr) minmax(0, 1fr); - justify-items: center; - align-items: center; - } + } + .ability { + display: grid; + grid-template-rows: minmax(0, 3fr) minmax(0, 1fr); + justify-items: center; + align-items: center; label, .label { width: 100%; text-align: center; @@ -90,5 +90,36 @@ width: 70%; text-align: center; } + + &.dual { + position: relative; + font-size: 1rem; + --distance-from-edge: 3px; + + &::after { + display: block; + content: ""; + width: 69%; + height: 2px; + background: black; + transform: rotate(-45deg); + } + + > .value, + > .max { + width: 50%; + position: absolute; + text-align: center; + } + + > .value { + top: var(--distance-from-edge); + left: var(--distance-from-edge); + } + > .max { + bottom: var(--distance-from-edge); + right: var(--distance-from-edge); + } + } } } diff --git a/langs/en-ca.json b/langs/en-ca.json index 169cf6d..c238daf 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -10,6 +10,8 @@ }, "common": { "empty": "---", + "move": "Move", + "run": "Run", "fate": { "North": "North", "East": "East", @@ -28,6 +30,11 @@ "name": "Abbreviate Access Names", "hint": "Shortens the Access level names the way the book does. (e.g. \"Common\" becomes \"C\")" } + }, + "Apps": { + "HeroSummaryCardV1": { + "move-run": "@RipCrypt.common.move • @RipCrypt.common.run" + } } } } diff --git a/module/Apps/ActorSheets/HeroSummaryCardV1.mjs b/module/Apps/ActorSheets/HeroSummaryCardV1.mjs index 8bf73b3..596ab13 100644 --- a/module/Apps/ActorSheets/HeroSummaryCardV1.mjs +++ b/module/Apps/ActorSheets/HeroSummaryCardV1.mjs @@ -48,6 +48,7 @@ export class HeroSummaryCardV1 extends HandlebarsApplicationMixin(ActorSheetV2) ctx = await this.prepareFatePath(ctx); ctx = await this.prepareAbilityRow(ctx); + ctx = await this.prepareSpeed(ctx); partId = partId.slice(0,1).toUpperCase() + partId.slice(1); if (this[`_prepare${partId}Context`] != null) { @@ -84,6 +85,11 @@ export class HeroSummaryCardV1 extends HandlebarsApplicationMixin(ActorSheetV2) }; return ctx; }; + + async prepareSpeed(ctx) { + ctx.speed = ctx.actor.system.speed; + return ctx; + }; // #endregion // #region Actions