From 26ff989aa9972f76edcc20e2f9fa365415e4c2a2 Mon Sep 17 00:00:00 2001 From: KitCat Date: Tue, 19 Mar 2024 16:01:10 +0000 Subject: [PATCH] Add tooltips and non-lethal damage to portrait stats --- lang/de.json | 10 ++++++++++ lang/en.json | 10 ++++++++++ modules/argon/panels/playerPortraitPanel.mjs | 18 +++++++++++++++--- templates/StatBlocks.hbs | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lang/de.json b/lang/de.json index 3f0157c..7be80b0 100644 --- a/lang/de.json +++ b/lang/de.json @@ -1,5 +1,15 @@ { "ECHPF1": { + "ACNormal": "Rüstungsklasse", + "ACFlatFooted": "Auf dem falschen Fuß-Rüstungsklasse", + "ACTouch": "Berührungs-Rüstungsklasse", + "CMDTotal": "Kampfmanöververteidigung", + "CMDFlatFootedTotal": "Auf dem falschen Fuß-Kampfmanöververteidigung", + "TemporaryHP": "Temporäre Trefferpunkte", + "HP": "Trefferpunkte", + "HPShort": "TP", + "Nonlethal": "Nichttödlicher Schaden", + "TemporaryVigor": "Temporäre Vitalität", "CombatManeuver": "Kampfmanöver", "Settings": { "ShowActionPanelStandard": { diff --git a/lang/en.json b/lang/en.json index 81e4da1..798a351 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,6 +1,16 @@ { "ECHPF1": { + "ACNormal": "Armor Class", + "ACFlatFooted": "Flat-Footed Armor Class", + "ACTouch": "Touch Armor Class", + "CMDTotal": "Combat Maneuver Defense", + "CMDFlatFootedTotal": "Flat-Footed Combat Maneuver Defense", "CombatManeuver": "Combat Maneuver", + "TemporaryHP": "Temporary Hit Points", + "HP": "Hit Points", + "HPShort": "HP", + "Nonlethal": "Nonlethal Damage", + "TemporaryVigor": "Temporary Vigor", "Settings": { "ShowActionPanelStandard": { "name": "Show Standard Action Panel", diff --git a/modules/argon/panels/playerPortraitPanel.mjs b/modules/argon/panels/playerPortraitPanel.mjs index f545f89..cb42c62 100644 --- a/modules/argon/panels/playerPortraitPanel.mjs +++ b/modules/argon/panels/playerPortraitPanel.mjs @@ -80,6 +80,7 @@ export function playerPortraitPanel(ARGON) { for (const key of ["normal", "touch", "flatFooted"]) { blocks["right"].push({ label: game.i18n.localize(`ECHPF1.Abbr.AC${ucFirst(key)}`), + tooltip: game.i18n.localize(`ECHPF1.AC${ucFirst(key)}`), id: key, hidden: key !== "normal", value: this.actor.system.attributes.ac[key]?.total @@ -89,6 +90,7 @@ export function playerPortraitPanel(ARGON) { for (const key of ["total", "flatFootedTotal"]) { blocks["right"].push({ label: game.i18n.localize(`ECHPF1.Abbr.CMD${ucFirst(key)}`), + tooltip: game.i18n.localize(`ECHPF1.CMD${ucFirst(key)}`), id: key, hidden: key !== "total", value: this.actor.system.attributes.cmd[key] @@ -101,6 +103,7 @@ export function playerPortraitPanel(ARGON) { blocks["left"].push({ label: game.i18n.localize("PF1.Temporary"), id: "vigor-temp", + tooltip: game.i18n.localize("ECHPF1.TemporaryVigor"), value: this.actor.system.attributes.vigor.temp }); } @@ -122,20 +125,29 @@ export function playerPortraitPanel(ARGON) { blocks["left"].push({ label: game.i18n.localize("PF1.Temporary"), id: "hp-temp", + tooltip: game.i18n.localize("ECHPF1.TemporaryHP"), value: this.actor.system.attributes.hp.temp }); } blocks["left"].push({ - label: game.i18n.localize("PF1.HP"), + label: game.i18n.localize("ECHPF1.HPShort"), id: "hp", + tooltip: game.i18n.localize("ECHPF1.HP"), color: this._getColor(this.actor.system.attributes.hp.value, this.actor.system.attributes.hp.max), value: `${this.actor.system.attributes.hp.value}` }); + if(this.actor.system.attributes.hp.nonlethal) { + blocks["left"].push({ + label: game.i18n.localize("PF1.Nonlethal"), + id: "nonlethal", + color: "#ff6464", + tooltip: game.i18n.localize("ECHPF1.Nonlethal"), + value: this.actor.system.attributes.hp.nonlethal + }); + } } break; - - } return blocks; diff --git a/templates/StatBlocks.hbs b/templates/StatBlocks.hbs index 2494f72..7ea435d 100644 --- a/templates/StatBlocks.hbs +++ b/templates/StatBlocks.hbs @@ -2,7 +2,7 @@ {{#if stats.length}}
{{#each stats as |stat|}} -
+
{{stat.label}} {{stat.value}}