Skip to content

Commit

Permalink
Display suspect test eligibility in /rank
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Nov 1, 2024
1 parent cd9f950 commit 1221756
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions play.pokemonshowdown.com/js/client-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,13 @@
buffer += '</table></div>';
return self.add('|raw|' + buffer);
}
buffer += '<tr><th>Format</th><th><abbr title="Elo rating">Elo</abbr></th><th><abbr title="user\'s percentage chance of winning a random battle (aka GLIXARE)">GXE</abbr></th><th><abbr title="Glicko-1 rating: rating±deviation">Glicko-1</abbr></th><th>COIL</th><th>W</th><th>L</th><th>Total</th></tr>';

buffer += '<tr><th>Format</th><th><abbr title="Elo rating">Elo</abbr></th><th><abbr title="user\'s percentage chance of winning a random battle (aka GLIXARE)">GXE</abbr></th><th><abbr title="Glicko-1 rating: rating±deviation">Glicko-1</abbr></th><th>COIL</th><th>W</th><th>L</th><th>Total</th>';
var suspect = false;
for (var i = 0; i < data.length; i++) {
if ('suspect' in data[i]) suspect = true;
}
if (suspect) buffer += '<th>Suspect test eligible?</th>';
buffer += '</tr>';
var hiddenFormats = [];
for (var i = 0; i < data.length; i++) {
var row = data[i];
Expand Down Expand Up @@ -1015,7 +1020,17 @@
} else {
buffer += '<td>--</td>';
}
buffer += '<td>' + row.w + '</td><td>' + row.l + '</td><td>' + N + '</td></tr>';
buffer += '<td>' + row.w + '</td><td>' + row.l + '</td><td>' + N + '</td>';
if (suspect) {
if (typeof row.suspect === 'undefined') {
buffer += '<td>--</td>';
} else {
buffer += '<td>';
buffer += (row.suspect ? "Yes" : "No");
buffer += '</td>';
}
}
buffer += '</tr>';
}
if (hiddenFormats.length) {
if (hiddenFormats.length === data.length) {
Expand Down

0 comments on commit 1221756

Please sign in to comment.