Skip to content

Commit 6ca7a49

Browse files
authored
feature: multip map stats / round history bar (#298)
1 parent 94a1940 commit 6ca7a49

14 files changed

Lines changed: 1673 additions & 417 deletions

components/match/LineupClutches.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PlayerDisplay from "../PlayerDisplay.vue";
55

66
<template>
77
<div
8-
v-for="match_map in match.match_maps"
8+
v-for="match_map in filteredMatchMaps"
99
:key="match_map.id"
1010
class="bg-muted/30 p-6 rounded-lg mb-8"
1111
>
@@ -98,6 +98,10 @@ export default {
9898
required: true,
9999
type: Object,
100100
},
101+
selectedMapId: {
102+
type: String as () => string | null,
103+
default: null,
104+
},
101105
},
102106
methods: {
103107
getClutches(member: { steam_id: string }) {
@@ -133,6 +137,14 @@ export default {
133137
},
134138
},
135139
computed: {
140+
filteredMatchMaps() {
141+
if (!this.selectedMapId) {
142+
return this.match.match_maps;
143+
}
144+
return this.match.match_maps.filter(
145+
(match_map: any) => match_map.id === this.selectedMapId,
146+
);
147+
},
136148
clutches() {
137149
const lineup1 = this.lineup1.lineup_players;
138150
const lineup2 = this.lineup2.lineup_players;

components/match/LineupOpeningDuelRow.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,24 @@ export default {
2626
required: true,
2727
type: Object,
2828
},
29+
selectedMapId: {
30+
type: String as () => string | null,
31+
default: null,
32+
},
2933
},
3034
computed: {
35+
filteredMatchMaps() {
36+
if (!this.selectedMapId) {
37+
return this.match.match_maps;
38+
}
39+
return this.match.match_maps.filter(
40+
(match_map: any) => match_map.id === this.selectedMapId,
41+
);
42+
},
3143
attempts() {
3244
let attempts = 0;
3345
34-
for (const match_map of this.match.match_maps) {
46+
for (const match_map of this.filteredMatchMaps) {
3547
for (const round of match_map.rounds) {
3648
const firstKill = round.kills.find((kill: any) => {
3749
return (
@@ -57,7 +69,7 @@ export default {
5769
success() {
5870
let success = 0;
5971
60-
for (const match_map of this.match.match_maps) {
72+
for (const match_map of this.filteredMatchMaps) {
6173
for (const round of match_map.rounds) {
6274
const firstKill = round.kills.find((kill: any) => {
6375
return (

components/match/LineupOpeningDuels.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import LineupOpeningDuelRow from "~/components/match/LineupOpeningDuelRow.vue";
2121
:member="member"
2222
:lineup="lineup"
2323
:match="match"
24+
:selected-map-id="selectedMapId"
2425
v-for="member of lineup.lineup_players"
2526
></lineup-opening-duel-row>
2627
</TableBody>
@@ -38,6 +39,10 @@ export default {
3839
required: true,
3940
type: Object,
4041
},
42+
selectedMapId: {
43+
type: String as () => string | null,
44+
default: null,
45+
},
4146
},
4247
};
4348
</script>

0 commit comments

Comments
 (0)