minor changes and bugfixes

This commit is contained in:
2021-11-20 05:48:43 +01:00
parent bd8cf4a3c3
commit 189d3e21d3
8 changed files with 102 additions and 72 deletions

View File

@@ -6,14 +6,14 @@
<th class="text-center map" scope="col">Map</th>
<th class="text-center rank" scope="col">Rank</th>
<th class="text-center length" scope="col" title="Match Length">
<img alt="Match length" class="match-len" src="../assets/images/icons/timer_both.svg">
<img alt="Match length" class="match-len helpicon" src="../assets/images/icons/timer_both.svg">
</th>
<th class="text-center score" scope="col">Score</th>
<th class="text-center kills" scope="col" v-if="!props.explore">K</th>
<th class="text-center assists" scope="col" v-if="!props.explore">A</th>
<th class="text-center deaths" scope="col" v-if="!props.explore">D</th>
<th class="text-center kdiff" scope="col" style="cursor: help" title="Kill-to-death ratio" v-if="!props.explore">+/-</th>
<th class="text-center hltv" scope="col" style="cursor: help" title="HLTV 1.0 Rating" v-if="!props.explore">Rating</th>
<th v-if="!props.explore" class="text-center kills" scope="col">K</th>
<th v-if="!props.explore" class="text-center assists" scope="col">A</th>
<th v-if="!props.explore" class="text-center deaths" scope="col">D</th>
<th v-if="!props.explore" class="text-center kdiff helptext" scope="col" title="Kill-to-death ratio">+/-</th>
<th v-if="!props.explore" class="text-center hltv helptext" scope="col" title="HLTV 1.0 Rating">Rating</th>
<th class="text-center duration" scope="col">Duration</th>
<th class="date" scope="col">Date</th>
</tr>
@@ -27,30 +27,27 @@
@click="GoToMatch(match.match_id)"
>
<td class="td-map text-center">
<i v-if="match.parsed" class="fa fa-bar-chart parsed" style="cursor: help"
<i v-if="match.parsed" class="fa fa-bar-chart parsed helpicon"
title="Demo has been parsed for additional data"></i>
<i v-if="!match.parsed && MatchNotParsedTime(match.date)" class="fa fa-hourglass-half not-yet-parsed"
style="cursor: help"
<i v-if="!match.parsed && MatchNotParsedTime(match.date)" class="fa fa-hourglass-half not-yet-parsed helpicon"
title="Match has not been parsed yet"></i>
<img v-if="match.map"
:alt="match.map ? match.map : 'Map not found'"
:src="match.map !== '' ? require('../assets/images/map_icons/map_icon_' + match.map + '.svg') : require('../assets/images/map_icons/map_icon_lobby_mapveto.svg')"
:title="match.map"
<img v-if="match.map !== ''"
:alt="match.map"
:src="require('../assets/images/map_icons/map_icon_' + match.map + '.svg')"
:title="FixMapName(match.map)"
class="map-icon">
<i v-else class="fa fa-question-circle-o map-not-found" title="Match not parsed"></i>
</td>
<td class="td-rank text-center">
<img
<img v-if="props.explore"
:alt="DisplayRank(Math.floor(match.avg_rank || 0))[1]"
:src="DisplayRank(Math.floor(match.avg_rank || 0))[0]"
:title="DisplayRank(Math.floor(match.avg_rank || 0))[1]" class="rank-icon">
<img v-else
:alt="DisplayRank(match.stats.rank?.new)[1]"
:class="match.stats.rank?.new > match.stats.rank?.old ? 'uprank' : match.stats.rank?.new < match.stats.rank?.old ? 'downrank' : ''"
:src="DisplayRank(match.stats.rank?.new)[0]"
:title="DisplayRank(match.stats.rank?.new)[1]"
class="rank-icon" v-if="!props.explore">
<img
:alt="DisplayRank(Math.floor(match.avg_rank || 0))[1]"
:src="DisplayRank(Math.floor(match.avg_rank || 0))[0]"
:title="DisplayRank(Math.floor(match.avg_rank || 0))[1]"
class="rank-icon" v-if="props.explore">
:title="DisplayRank(match.stats.rank?.new)[1]" class="rank-icon">
</td>
<td class="td-length text-center">
<img v-if="match.max_rounds === 30 || !match.max_rounds" alt="Match long"
@@ -62,30 +59,30 @@
class="td-score text-center fw-bold">
{{ match.score[0] }} - {{ match.score[1] }}
</td>
<td class="td-kills text-center" v-if="match.stats">
<td v-if="match.stats" class="td-kills text-center">
{{ match.stats.kills ? match.stats.kills : "0" }}
</td>
<td class="td-assists text-center" v-if="match.stats">
<td v-if="match.stats" class="td-assists text-center">
{{ match.stats.assists ? match.stats.assists : "0" }}
</td>
<td class="td-deaths text-center" v-if="match.stats">
<td v-if="match.stats" class="td-deaths text-center">
{{ match.stats.deaths ? match.stats.deaths : "0" }}
</td>
<td :class="(match.stats.kills ? match.stats.kills : 0) - (match.stats.deaths ? match.stats.deaths : 0) >= 0 ? 'text-success' : 'text-danger'"
class="td-plus text-center" v-if="match.stats">
<td v-if="match.stats"
:class="(match.stats.kills ? match.stats.kills : 0) - (match.stats.deaths ? match.stats.deaths : 0) >= 0 ? 'text-success' : 'text-danger'" class="td-plus text-center">
{{
(match.stats.kills ? match.stats.kills : 0) - (match.stats.deaths ? match.stats.deaths : 0)
}}
</td>
<td :class="GetHLTV_1(
<td v-if="match.stats"
:class="GetHLTV_1(
match.stats.kills,
match.score[0] + match.score[1],
match.stats.deaths,
match.stats.multi_kills?.duo,
match.stats.multi_kills?.triple,
match.stats.multi_kills?.quad,
match.stats.multi_kills?.pent) >= 1 ? 'text-success' : 'text-warning'"
class="td-hltv text-center fw-bold" v-if="match.stats">
match.stats.multi_kills?.pent) >= 1 ? 'text-success' : 'text-warning'" class="td-hltv text-center fw-bold">
{{
GetHLTV_1(
match.stats.kills,
@@ -111,7 +108,18 @@
</template>
<script>
import {FormatDate, FormatDuration, FormatFullDate, FormatFullDuration, GetHLTV_1, GetWinLoss, GoToMatch, MatchNotParsedTime, DisplayRank} from "@/utils";
import {
DisplayRank,
FixMapName,
FormatDate,
FormatDuration,
FormatFullDate,
FormatFullDuration,
GetHLTV_1,
GetWinLoss,
GoToMatch,
MatchNotParsedTime
} from "@/utils";
import {onMounted, reactive, watch} from "vue";
export default {
@@ -140,7 +148,20 @@ export default {
data.matches = props.matches
})
return {props, data, FormatDate, FormatFullDate, FormatDuration, FormatFullDuration, GetHLTV_1, GetWinLoss, GoToMatch, MatchNotParsedTime, DisplayRank}
return {
props,
data,
FormatDate,
FormatFullDate,
FormatDuration,
FormatFullDuration,
GetHLTV_1,
GetWinLoss,
GoToMatch,
MatchNotParsedTime,
DisplayRank,
FixMapName
}
}
}
</script>
@@ -165,10 +186,6 @@ table {
width: 150px;
}
th[title] {
text-decoration: underline dotted grey;
}
td {
vertical-align: middle;
}
@@ -219,18 +236,6 @@ table {
}
.td-rank {
.uprank {
box-shadow: 0 0 20px greenyellow;
border: 1px solid greenyellow;
border-radius: 5px;
}
.downrank {
box-shadow: 0 0 20px #ff2f2f;
border: 1px solid #ff2f2f;
border-radius: 5px;
}
img {
width: 70px;
height: auto;

View File

@@ -35,14 +35,14 @@
<th class="player__kills">K</th>
<th class="player__assist">A</th>
<th class="player__deaths">D</th>
<th class="player__diff cursor__help" title="Kill death difference">+/-</th>
<th class="player__diff helptext" title="Kill death difference">+/-</th>
<th class="player__kd">K/D</th>
<th v-if="store.state.matchDetails.parsed" class="player__adr cursor__help" title="Average damage per round">
<th v-if="store.state.matchDetails.parsed" class="player__adr helptext" title="Average damage per round">
ADR
</th>
<th class="player__hs cursor__help" title="Percentage of kills with a headshot">HS%</th>
<th class="player__rating cursor__help" title="Estimated HLTV Rating 1.0">Rating</th>
<th class="player__mvp cursor__help" title="Most valuable player">MVP</th>
<th class="player__hs helptext" title="Percentage of kills with a headshot">HS%</th>
<th class="player__rating helptext" title="Estimated HLTV Rating 1.0">Rating</th>
<th class="player__mvp helptext" title="Most valuable player">MVP</th>
<th class="player__score">Score</th>
</tr>
</thead>
@@ -69,7 +69,8 @@
:name="player.player.name"
:parsed="store.state.matchDetails.parsed"
:player_score="player.score"
:rank="player.rank?.old"
:rank_old="player.rank?.old"
:rank_new="player.rank?.new"
:rounds_played="store.state.matchDetails.score.reduce((a, b) => a + b)"
:steamid64="player.player.steamid64"
:tracked="player.player.tracked"
@@ -174,10 +175,6 @@ table {
padding: 5px 10px;
}
.cursor__help {
cursor: help;
}
.hr {
height: 20px;;
border-bottom: 1px solid white;

View File

@@ -20,9 +20,10 @@
<i class="fa fa-external-link"></i>
</td>
<td v-if="props.parsed" class="player__rank">
<img :alt="DisplayRank(props.rank)[1]"
:src="DisplayRank(props.rank)[0]"
:title="DisplayRank(props.rank)[1]">
<img :alt="DisplayRank(props.rank_old)[1]"
:class="props.rank_new > props.rank_old ? 'uprank' : props.rank_new < props.rank_old ? 'downrank' : ''"
:src="DisplayRank(props.rank_old)[0]"
:title="props.rank_new > props.rank_old ? 'Uprank to ' + DisplayRank(props.rank_new)[1] : props.rank_new < props.rank_old ? 'Downrank to ' + DisplayRank(props.rank_new)[1] : DisplayRank(props.rank_old)[1]">
</td>
<td v-if="!props.parsed" class="rank-placeholder"></td>
<td class="player__kills">
@@ -83,7 +84,12 @@ export default {
required: true,
default: 'Name'
},
rank: {
rank_old: {
type: Number,
required: true,
default: 0
},
rank_new: {
type: Number,
required: true,
default: 0