Skip to content

Commit ec71935

Browse files
committed
Style button on ladder page, also add custom badges for ou/rands
1 parent d105e20 commit ec71935

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

play.pokemonshowdown.com/js/client-ladder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
}, function (data) {
162162
if (self.curFormat !== format) return;
163163
var buf = '<div class="ladder pad"><p><button name="selectFormat"><i class="fa fa-chevron-left"></i> Format List</button></p><p><button class="button" name="refresh"><i class="fa fa-refresh"></i> Refresh</button>';
164-
buf += '<button class="button" name="send" value="/join view-seasonladder-' + format + '">Season rankings</button>';
164+
buf += '&nbsp;<button class="button" name="send" value="/join view-seasonladder-' + format + '"><i class="fa fa-trophy"></i> Season rankings</button>';
165165
buf += '<form class="search"><input type="text" name="searchval" class="textbox searchinput" value="' + BattleLog.escapeHTML(self.curSearchVal || '') + '" placeholder="username prefix" /><button type="submit"> Search</button></form></p>';
166166
buf += '<h3>' + BattleLog.escapeFormat(format) + ' Top ' + BattleLog.escapeHTML(self.curSearchVal ? "- '" + self.curSearchVal + "'" : '500') + '</h3>';
167167
buf += data + '</div>';

play.pokemonshowdown.com/src/battle-animations.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,13 @@ export class BattleScene implements BattleSceneStub {
703703
// but idk that we're planning that for now so
704704
const [threshold, season] = details.split('-');
705705
const hover = `Top ${threshold} in ${format} during ladder season ${season}`;
706-
badgehtml += `<img src="${Dex.resourcePrefix}/sprites/misc/${type}.png" width="20px" height="20px" title="${hover}" />`;
706+
// ou and randbats get diff badges from everyone else, find it
707+
// (regex futureproofs for double digit gens)
708+
let formatType = format.split(/gen\d+/)[1] || 'none';
709+
if (!['ou', 'randombattle'].includes(formatType)) {
710+
formatType = 'base';
711+
}
712+
badgehtml += `<img src="${Dex.resourcePrefix}/sprites/misc/${formatType}-${type}.png" width="20px" height="20px" title="${hover}" />`;
707713
}
708714
badgehtml += '</span>';
709715
}

0 commit comments

Comments
 (0)