Skip to content

Commit 14d8c8f

Browse files
authored
chore: update flash data column to show how many people falshed with … (#442)
1 parent 97b78a6 commit 14d8c8f

4 files changed

Lines changed: 98 additions & 25 deletions

File tree

components/match/LineupOpeningDuelRow.vue

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,37 @@
1010
<lineup-member :member="member" :lineup_id="lineup.id"></lineup-member>
1111
</TableCell>
1212
<TableCell>
13-
<span class="tabular-nums"><AnimatedStat :value="attempts" /></span>
14-
<span class="text-muted-foreground"> · </span>
15-
<span class="tabular-nums"><AnimatedStat :value="attemptsPct + '%'" /></span>
16-
<StatChevron :level="attemptsLevel" class="ml-0.5" />
13+
<span class="inline-flex items-baseline gap-1">
14+
<span class="tabular-nums"><AnimatedStat :value="attempts" /></span>
15+
<span class="tabular-nums text-xs text-muted-foreground leading-none"
16+
>(<StatLabel stat="opening_attempts_pct"
17+
><AnimatedStat :value="attemptsPct + '%'" /></StatLabel
18+
>)</span
19+
>
20+
<StatChevron :level="attemptsLevel" class="self-center ml-0.5" />
21+
</span>
1722
</TableCell>
1823
<TableCell>
19-
<span class="tabular-nums"><AnimatedStat :value="success" /></span>
20-
<span class="text-muted-foreground"> · </span>
21-
<span class="tabular-nums"><AnimatedStat :value="successPct + '%'" /></span>
22-
<StatChevron :level="successLevel" class="ml-0.5" />
24+
<span class="inline-flex items-baseline gap-1">
25+
<span class="tabular-nums"><AnimatedStat :value="success" /></span>
26+
<span class="tabular-nums text-xs text-muted-foreground leading-none"
27+
>(<StatLabel stat="opening_success_pct"
28+
><AnimatedStat :value="successPct + '%'" /></StatLabel
29+
>)</span
30+
>
31+
<StatChevron :level="successLevel" class="self-center ml-0.5" />
32+
</span>
2333
</TableCell>
2434
<TableCell v-if="duelsVis.traded !== false">
25-
<span class="tabular-nums"><AnimatedStat :value="traded" /></span>
26-
<span class="text-muted-foreground"> · </span>
27-
<span class="tabular-nums"><AnimatedStat :value="tradedPct + '%'" /></span>
28-
<StatChevron :level="tradedLevel" class="ml-0.5" />
35+
<span class="inline-flex items-baseline gap-1">
36+
<span class="tabular-nums"><AnimatedStat :value="traded" /></span>
37+
<span class="tabular-nums text-xs text-muted-foreground leading-none"
38+
>(<StatLabel stat="opening_traded_pct"
39+
><AnimatedStat :value="tradedPct + '%'" /></StatLabel
40+
>)</span
41+
>
42+
<StatChevron :level="tradedLevel" class="self-center ml-0.5" />
43+
</span>
2944
</TableCell>
3045
<TableCell
3146
v-if="duelsVis.most_killed !== false"
@@ -101,14 +116,21 @@ import LineupMember from "~/components/match/LineupMember.vue";
101116
import PlayerDisplay from "~/components/PlayerDisplay.vue";
102117
import AnimatedStat from "~/components/AnimatedStat.vue";
103118
import StatChevron from "~/components/StatChevron.vue";
119+
import StatLabel from "~/components/common/StatLabel.vue";
104120
import { statLevelFor, type StatLevel } from "~/utils/statTiers";
105121
import { resolveWeapon } from "~/utilities/weaponIcon";
106122
import { useMatchSide } from "~/composables/useMatchSide";
107123
import { useOpeningDuelsColumns } from "~/composables/useMatchTableColumns";
108124
import { useCurrentUserRow } from "~/composables/useCurrentUserRow";
109125
110126
export default {
111-
components: { LineupMember, PlayerDisplay, AnimatedStat, StatChevron },
127+
components: {
128+
LineupMember,
129+
PlayerDisplay,
130+
AnimatedStat,
131+
StatChevron,
132+
StatLabel,
133+
},
112134
setup() {
113135
const { visibility: duelsVis } = useOpeningDuelsColumns();
114136
const { rowClass, stickyCellClass } = useCurrentUserRow();

components/match/LineupOverviewRow.vue

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import formatStatValue from "~/utilities/formatStatValue";
33
import AnimatedStat from "~/components/AnimatedStat.vue";
44
import StatChevron from "~/components/StatChevron.vue";
5+
import StatLabel from "~/components/common/StatLabel.vue";
56
import { KAST_TIER, ADR_TIER, kdColor, hltvColor } from "~/utils/statTiers";
67
import EloChangeBadge from "~/components/EloChangeBadge.vue";
78
import PlayerMatchClipsButton from "~/components/match/PlayerMatchClipsButton.vue";
@@ -202,7 +203,19 @@ const DASH = "—";
202203
<AnimatedStat :value="hs" />
203204
</TableCell>
204205
<TableCell v-if="overviewVis.survived !== false" class="tabular-nums">
205-
<AnimatedStat :value="survived" />
206+
<span class="inline-flex items-baseline gap-1">
207+
<template v-if="survivedPct !== null">
208+
<span class="tabular-nums"
209+
><AnimatedStat :value="survivedCount"
210+
/></span>
211+
<span class="tabular-nums text-xs text-muted-foreground leading-none"
212+
>(<StatLabel stat="survived_pct"
213+
><AnimatedStat :value="survivedPct + '%'" /></StatLabel
214+
>)</span
215+
>
216+
</template>
217+
<template v-else>{{ DASH }}</template>
218+
</span>
206219
</TableCell>
207220
<TableCell v-if="overviewVis.multikills !== false" class="tabular-nums">
208221
<HoverCard
@@ -682,18 +695,28 @@ export default {
682695
kast() {
683696
return this.kastPct === null ? "" : Math.round(this.kastPct) + "%";
684697
},
685-
survived() {
698+
survivedCount() {
686699
if (!this.hasStats) return "";
687700
const rounds = this.sideFiltered
688701
? this.sideRounds
689702
: (this.stats.rounds_played ?? 0);
690703
if (!rounds) return "";
704+
const deaths = this.sideFiltered
705+
? this.sideDeaths
706+
: (this.stats.deaths ?? 0);
707+
return rounds - deaths;
708+
},
709+
survivedPct() {
710+
if (!this.hasStats) return null;
711+
const rounds = this.sideFiltered
712+
? this.sideRounds
713+
: (this.stats.rounds_played ?? 0);
714+
if (!rounds) return null;
691715
const deaths = this.sideFiltered
692716
? this.sideDeaths
693717
: (this.stats.deaths ?? 0);
694718
const surv = rounds - deaths;
695-
const pct = Math.round((surv / rounds) * 100);
696-
return `${surv} (${pct}%)`;
719+
return Math.round((surv / rounds) * 100);
697720
},
698721
hltvRating() {
699722
if (!this.hasStats) return null;

components/match/LineupUtility.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import LineupMember from "~/components/match/LineupMember.vue";
33
import AnimatedStat from "~/components/AnimatedStat.vue";
44
import StatChevron from "~/components/StatChevron.vue";
5+
import StatLabel from "~/components/common/StatLabel.vue";
56
import SortableTableHead from "~/components/common/SortableTableHead.vue";
67
import TeamUtilitySummary from "~/components/match/TeamUtilitySummary.vue";
78
import { useTableSort } from "~/composables/useTableSort";
@@ -169,15 +170,22 @@ const TIER_CONFIG: Record<string, StatTierConfig> = {
169170
</span>
170171
</TableCell>
171172
<TableCell v-if="utilityVis.enemies_flashed !== false">
172-
<span class="inline-flex items-center gap-0.5">
173-
<AnimatedStat
174-
:value="
175-
enemiesFlashedPer(member) !== null
176-
? formatStatValue(String(enemiesFlashedPer(member)))
177-
: ''
178-
"
179-
/>
173+
<span class="inline-flex items-baseline gap-1">
174+
<template v-if="enemiesFlashedPer(member) !== null">
175+
<span class="tabular-nums"
176+
><AnimatedStat :value="statsFor(member)?.enemies_flashed ?? 0"
177+
/></span>
178+
<span
179+
class="tabular-nums text-xs text-muted-foreground leading-none"
180+
>(<StatLabel stat="enemies_flashed_per"
181+
><AnimatedStat
182+
:value="formatStatValue(String(enemiesFlashedPer(member)))" /></StatLabel
183+
>)</span
184+
>
185+
</template>
186+
<template v-else>—</template>
180187
<StatChevron
188+
class="self-center"
181189
:cfg="TIER_CONFIG.enemies_flashed_per"
182190
:value="enemiesFlashedPer(member)"
183191
/>

i18n/locales/en.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{
22
"stat_glossary": {
3+
"enemies_flashed_per": {
4+
"label": "Enemies / Flash",
5+
"description": "Average number of enemies blinded per flash thrown — higher means more effective flashes."
6+
},
7+
"opening_attempts_pct": {
8+
"label": "Attempt Rate",
9+
"description": "Share of rounds where this player took the opening duel (first engagement of the round)."
10+
},
11+
"opening_success_pct": {
12+
"label": "Win Rate",
13+
"description": "Share of opening duels this player won."
14+
},
15+
"opening_traded_pct": {
16+
"label": "Traded Rate",
17+
"description": "Share of opening deaths that were traded back by a teammate."
18+
},
19+
"survived_pct": {
20+
"label": "Survival Rate",
21+
"description": "Share of rounds this player survived (lived to the end of the round)."
22+
},
323
"hltv": {
424
"label": "HLTV Rating",
525
"description": "HLTV 2.0 overall performance rating combining kills, deaths, KAST, damage and impact. ~1.0 is average."

0 commit comments

Comments
 (0)