Show recorded match score totals with legacy fallback (Refs #147)
CI / checks (push) Successful in 5m22s
CI / checks (push) Successful in 5m22s
This commit is contained in:
@@ -24,15 +24,19 @@
|
||||
: match.game.toUpperCase()
|
||||
);
|
||||
const number = new Intl.NumberFormat('en-US');
|
||||
const stats = [
|
||||
const hasScoreTotals = $derived(match.players.some((player) => player.scoreTotal != null));
|
||||
const stats = $derived([
|
||||
{ key: 'highestRound', label: 'Highest round' },
|
||||
{ key: 'kills', label: 'Kills' },
|
||||
{ key: 'headshots', label: 'Headshots' },
|
||||
{ key: 'revives', label: 'Revives' },
|
||||
{ key: 'downs', label: 'Downs' },
|
||||
{ key: 'roundsSurvived', label: 'Rounds survived' },
|
||||
{ key: 'bestScore', label: 'Highest reported score' }
|
||||
] as const;
|
||||
{
|
||||
key: hasScoreTotals ? 'scoreTotal' : 'bestScore',
|
||||
label: hasScoreTotals ? 'Total score' : 'Highest reported score'
|
||||
}
|
||||
] as const);
|
||||
</script>
|
||||
|
||||
<svelte:head><title>{match.map} · Match #{match.id} · Electric Cherry</title></svelte:head>
|
||||
@@ -122,6 +126,11 @@
|
||||
<p>
|
||||
Every recorded player, including those absent from the final report. Stats are the
|
||||
highest reported counters for this match.
|
||||
{#if hasScoreTotals}
|
||||
Total score is the highest recorded cumulative points earned in this match.
|
||||
{:else}
|
||||
Highest reported score is the highest recorded points balance.
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
{#if match.players.length === 0}
|
||||
@@ -161,7 +170,7 @@
|
||||
>{#if !player.hasStats}<small>No stats recorded</small>{/if}</td
|
||||
>
|
||||
{#each stats as stat}<td class:round={stat.key === 'highestRound'}
|
||||
>{player[stat.key] === null
|
||||
>{player[stat.key] == null
|
||||
? '—'
|
||||
: number.format(player[stat.key]!)}</td
|
||||
>{/each}
|
||||
@@ -178,11 +187,20 @@
|
||||
|
||||
<details class="note">
|
||||
<summary>About these results</summary>
|
||||
<p>
|
||||
Kills, headshots, revives, downs, and score retain each player's highest reported value.
|
||||
Highest reported score is a points balance, not total points earned or necessarily the
|
||||
final score.
|
||||
</p>
|
||||
<p>Kills, headshots, revives, and downs retain each player's highest reported value.</p>
|
||||
{#if hasScoreTotals}
|
||||
<p>
|
||||
Total score is the highest recorded cumulative points earned in this match. Players
|
||||
absent from the final report retain their latest recorded total. A dash in Total
|
||||
score means no total was recorded for that player.
|
||||
</p>
|
||||
{:else}
|
||||
<p>
|
||||
Highest reported score is a points balance, not total points earned or necessarily
|
||||
the final score. This match has no recorded totals, so each player's highest
|
||||
reported balance is shown.
|
||||
</p>
|
||||
{/if}
|
||||
<p>
|
||||
Highest round includes late joins. Rounds survived counts only observed round
|
||||
progression while the player was present. “At match end” means the player appeared in
|
||||
|
||||
Reference in New Issue
Block a user