mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 23:01:05 -05:00
Choose default team using teambuilderFormat
Before, 'UU (suspect test)' was treated differently from 'UU' when choosing the default team in the dropdown. It no longer is.
This commit is contained in:
@@ -736,6 +736,10 @@
|
||||
if (window.BattleFormats[formatid].team) {
|
||||
return '<button class="select teamselect preselected" name="team" value="random" disabled>' + TeamPopup.renderTeam('random') + '</button>';
|
||||
}
|
||||
|
||||
var format = window.BattleFormats[formatid];
|
||||
var teamFormat = (format.teambuilderFormat || (format.isTeambuilderFormat ? formatid : false));
|
||||
|
||||
var teams = Storage.teams;
|
||||
if (!teams.length) {
|
||||
return '<button class="select teamselect" name="team" disabled>You have no teams</button>';
|
||||
@@ -744,9 +748,9 @@
|
||||
if (this.curTeamIndex >= 0) {
|
||||
teamIndex = this.curTeamIndex;
|
||||
}
|
||||
if (this.curTeamFormat !== formatid) {
|
||||
if (this.curTeamFormat !== teamFormat) {
|
||||
for (var i = 0; i < teams.length; i++) {
|
||||
if (teams[i].format === formatid) {
|
||||
if (teams[i].format === teamFormat) {
|
||||
teamIndex = i;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user