From 87e21127ab88a0f81a4105fd7d4d5a20367db895 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Sun, 1 Oct 2023 21:50:46 +0200 Subject: [PATCH] address #409, fix value calc text, fix stat overflow --- data/fh/monster/tormentor.json | 16 ++-- package-lock.json | 4 +- package.json | 2 +- src/app/ui/figures/monster/stats/stats.html | 78 ++++++++++++------ src/app/ui/figures/monster/stats/stats.scss | 18 ++++- src/app/ui/helper/valueCalc.ts | 4 +- src/assets/images/action/damage.svg | 90 +++++++++++++++++++++ 7 files changed, 170 insertions(+), 42 deletions(-) create mode 100644 src/assets/images/action/damage.svg diff --git a/data/fh/monster/tormentor.json b/data/fh/monster/tormentor.json index 5783b7d6d..226ebd48c 100644 --- a/data/fh/monster/tormentor.json +++ b/data/fh/monster/tormentor.json @@ -152,7 +152,7 @@ "stats": [ { "level": 0, - "health": "10xCx3/2", + "health": "[10xCx3/2{$math.floor}]", "movement": 4, "attack": 3, "immunities": [ @@ -162,7 +162,7 @@ }, { "level": 1, - "health": "12xCx3/2", + "health": "[12xCx3/2{$math.floor}]", "movement": 4, "attack": 4, "immunities": [ @@ -172,7 +172,7 @@ }, { "level": 2, - "health": "14xCx3/2", + "health": "[14xCx3/2{$math.floor}]", "movement": 4, "attack": 5, "immunities": [ @@ -182,7 +182,7 @@ }, { "level": 3, - "health": "18xCx3/2", + "health": "[18xCx3/2{$math.floor}]", "movement": 5, "attack": 5, "immunities": [ @@ -192,7 +192,7 @@ }, { "level": 4, - "health": "21xCx3/2", + "health": "[21xCx3/2{$math.floor}]", "movement": 5, "attack": 6, "immunities": [ @@ -202,7 +202,7 @@ }, { "level": 5, - "health": "26xCx3/2", + "health": "[26xCx3/2{$math.floor}]", "movement": 5, "attack": 6, "immunities": [ @@ -212,7 +212,7 @@ }, { "level": 6, - "health": "33xCx3/2", + "health": "[33xCx3/2{$math.floor}]", "movement": 5, "attack": 8, "immunities": [ @@ -223,7 +223,7 @@ }, { "level": 7, - "health": "39xCx3/2", + "health": "[39xCx3/2{$math.floor}]", "movement": 6, "attack": 9, "immunities": [ diff --git a/package-lock.json b/package-lock.json index b3798b565..dc44e7e87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gloomhavensecretariat", - "version": "0.77.11", + "version": "0.77.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gloomhavensecretariat", - "version": "0.77.11", + "version": "0.77.12", "license": "AGPL3", "dependencies": { "@angular/animations": "^16.2.7", diff --git a/package.json b/package.json index c346a6163..6cacc31b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gloomhavensecretariat", - "version": "0.77.11", + "version": "0.77.12", "license": "AGPL3", "description": "Gloomhaven Secretariat is a Gloomhaven Companion app.", "homepage": "https://gloomhaven-secretariat.de", diff --git a/src/app/ui/figures/monster/stats/stats.html b/src/app/ui/figures/monster/stats/stats.html index f75252072..309551b4e 100644 --- a/src/app/ui/figures/monster/stats/stats.html +++ b/src/app/ui/figures/monster/stats/stats.html @@ -1,7 +1,8 @@
-
{{monster.level}} +
{{monster.level}}
@@ -26,25 +27,33 @@
- + + + - + + + + [ngClass]="{'hidden' : hideStats(MonsterType.boss), 'bordered' : hideStats(MonsterType.boss) || statsForType(MonsterType.boss).range }"> + + - + + + @@ -56,37 +65,54 @@
- + + + - + + + - + + + - + + + + [ngClass]="{'hidden' : hideStats(MonsterType.normal), 'bordered' : hideStats(MonsterType.normal) && hideStats(MonsterType.normal) || statsForType(MonsterType.normal).range || statsForType(MonsterType.elite).range}"> + + + [ngClass]="{'hidden' : hideStats(MonsterType.elite), 'bordered' : hideStats(MonsterType.normal) && hideStats(MonsterType.normal) || statsForType(MonsterType.normal).range || statsForType(MonsterType.elite).range}"> + + - + + + - + [src]="'./assets/images' + (settingsManager.settings.fhStyle ? '/fh' : '') + '/stats/range.svg'" /> + + + +
diff --git a/src/app/ui/figures/monster/stats/stats.scss b/src/app/ui/figures/monster/stats/stats.scss index 2629f64d9..881e74bf5 100644 --- a/src/app/ui/figures/monster/stats/stats.scss +++ b/src/app/ui/figures/monster/stats/stats.scss @@ -186,19 +186,32 @@ } .stat { + position: relative; font-size: 2.4em; line-height: 1.7em; padding-top: 0; width: 100%; + display: flex; + + .value { + display: block; + width: 100%; + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + } &.normal, &.boss { - position: relative; justify-self: end; - text-align: right; + justify-content: flex-end; filter: drop-shadow(0.01em 0.01em 0.01em var(--ghs-color-white)); padding-right: 0.8em; + .value { + text-align: right; + } + &.bordered::before { content: ' '; position: absolute; @@ -212,7 +225,6 @@ &.elite { justify-self: start; - text-align: left; color: var(--ghs-color-white); filter: drop-shadow(0.01em 0.01em 0.01em var(--ghs-color-black)); padding-left: 0.8em; diff --git a/src/app/ui/helper/valueCalc.ts b/src/app/ui/helper/valueCalc.ts index b46902d9e..a2c3fba21 100644 --- a/src/app/ui/helper/valueCalc.ts +++ b/src/app/ui/helper/valueCalc.ts @@ -40,9 +40,9 @@ export function valueCalc(value: string | number, level: number | undefined = un const match = value.match(EntityValueRegex); if (match) { let func = match[3]; - const funcLabel = func && func.startsWith('%'); + const funcLabel = func && func.startsWith('$'); if (funcLabel) { - func = func.replace('%', ''); + func = func.replace('$', ''); } return funcLabel ? match[1] + ' ' + settingsManager.getLabel('game.custom.' + func) : match[1]; } diff --git a/src/assets/images/action/damage.svg b/src/assets/images/action/damage.svg new file mode 100644 index 000000000..c5987213a --- /dev/null +++ b/src/assets/images/action/damage.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + +