mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 15:22:35 -05:00
Show error message for having no teams
This commit is contained in:
@@ -342,9 +342,14 @@
|
||||
var $pmWindow = $(target).closest('.pm-window');
|
||||
var userid = $pmWindow.data('userid');
|
||||
|
||||
var format = $pmWindow.find('button[name=format]').val();
|
||||
var teamIndex = $pmWindow.find('button[name=team]').val();
|
||||
var team = null;
|
||||
if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
|
||||
if (!window.BattleFormats[format].team && !team) {
|
||||
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
|
||||
return;
|
||||
}
|
||||
|
||||
$(target).closest('.challenge').remove();
|
||||
app.send('/utm '+(team?$.toJSON(team):'null'));
|
||||
@@ -360,11 +365,15 @@
|
||||
var $pmWindow = $(target).closest('.pm-window');
|
||||
var userid = $pmWindow.data('userid');
|
||||
var name = $pmWindow.data('name');
|
||||
var format = $pmWindow.find('button[name=format]').val();
|
||||
|
||||
var format = $pmWindow.find('button[name=format]').val();
|
||||
var teamIndex = $pmWindow.find('button[name=team]').val();
|
||||
var team = null;
|
||||
if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
|
||||
if (!window.BattleFormats[format].team && !team) {
|
||||
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
|
||||
return;
|
||||
}
|
||||
|
||||
var buf = '<form class="battleform pending"><p>Challenging '+Tools.escapeHTML(name)+'...</p>';
|
||||
buf += '<p><label class="label">Format:</label>'+this.renderFormats(format, true)+'</p>';
|
||||
@@ -470,6 +479,10 @@
|
||||
var teamIndex = $teamButton.val();
|
||||
var team = null;
|
||||
if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
|
||||
if (!window.BattleFormats[format].team && !team) {
|
||||
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
|
||||
return;
|
||||
}
|
||||
|
||||
$formatButton.addClass('preselected')[0].disabled = true;
|
||||
$teamButton.addClass('preselected')[0].disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user