Skip to content

Commit

Permalink
Add tooltips and non-lethal damage to portrait stats
Browse files Browse the repository at this point in the history
  • Loading branch information
KitCat420 committed Mar 19, 2024
1 parent be53467 commit 26ff989
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
10 changes: 10 additions & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 15 additions & 3 deletions modules/argon/panels/playerPortraitPanel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
});
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion templates/StatBlocks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#if stats.length}}
<div class="portrait-stat-block stacked-stats {{side}}">
{{#each stats as |stat|}}
<div class="portrait-stat {{#if stat.hidden}}hidden{{/if}}" data-key="{{stat.id}}">
<div class="portrait-stat {{#if stat.hidden}}hidden{{/if}}" data-key="{{stat.id}}" data-tooltip="{{stat.tooltip}}">
<span class="label">{{stat.label}}</span>
<span class="value" style="color: {{stat.color}}">{{stat.value}}</span>
</div>
Expand Down

0 comments on commit 26ff989

Please sign in to comment.