diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js
index 6d7b6ecf9..28ba4839f 100644
--- a/js/client-teambuilder.js
+++ b/js/client-teambuilder.js
@@ -980,10 +980,12 @@
if (this.curSetList.length && !this.curSetList[this.curSetList.length - 1].species) {
this.curSetList.splice(this.curSetList.length - 1, 1);
}
+
if (exports.BattleFormats) {
buf += '
';
buf += '';
- buf += ' ';
+ var btnClass = 'button' + (!this.curSetList.length || !this.curTeam.format ? ' disabled' : '');
+ buf += ' ';
}
if (!this.curSetList.length) {
buf += 'you have no pokemon lol';
@@ -1144,10 +1146,20 @@
},
validate: function () {
var format = this.curTeam.format;
+ var prerequisiteErrors = [];
if (!format) {
- app.addPopupMessage('You need to pick a format to validate your team.');
+ prerequisiteErrors.push('- You need to pick a format to validate your team.');
+ }
+
+ if (!this.curSetList.length) {
+ prerequisiteErrors.push('- You must have at least one Pokémon on your team in order to validate.');
+ }
+
+ if (prerequisiteErrors.length) {
+ app.addPopupMessage(prerequisiteErrors.join('\n'));
return;
}
+
if (window.BattleFormats && BattleFormats[this.curTeam.format] && BattleFormats[this.curTeam.format].hasBattleFormat) {
format = BattleFormats[this.curTeam.format].battleFormat;
}
diff --git a/style/client.css b/style/client.css
index b68159ec3..470d3b02d 100644
--- a/style/client.css
+++ b/style/client.css
@@ -311,6 +311,23 @@ button:disabled {
.popupmenu button.button:active {
background: linear-gradient(to bottom, #cfcfcf, #f2f2f2);
}
+
+.button.disabled,
+.button.disabled:hover,
+.button.disabled:active,
+.mainmenuwrapper .menugroup .button.disabled,
+.mainmenuwrapper .menugroup .button.disabled:hover,
+.mainmenuwrapper .menugroup .button.disabled:active {
+ cursor: default;
+ background: #EEEEEE;
+ border-color: #CCCCCC;
+ border-style: solid;
+ border-size: 1px;
+ color: #999999;
+ text-shadow: none;
+ box-shadow: 0 1px 2px rgba(0,0,0,.1);
+}
+
.button.notifying {
border-color: #AA8866;
background: #e3c3a3;
@@ -1011,20 +1028,6 @@ p.or:after {
.button.mainmenu6:hover { background: linear-gradient(to bottom, hsl(270,40%,62%), hsl(270,40%,42%)); }
.button.mainmenu6:active { background: linear-gradient(to bottom, hsl(270,40%,42%), hsl(300,40%,58%)); }
-.mainmenuwrapper .menugroup .button.disabled,
-.mainmenuwrapper .menugroup .button.disabled:hover,
-.mainmenuwrapper .menugroup .button.disabled:active,
-.mainmenuwrapper .menugroup .button.disabled,
-.mainmenuwrapper .menugroup .button.disabled:hover,
-.mainmenuwrapper .menugroup .button.disabled:active {
- cursor: default;
- background: #EEEEEE;
- border: 1px solid #CCCCCC;
- color: #999999;
- text-shadow: none;
- box-shadow: 0 1px 2px rgba(0,0,0,.1);
-}
-
.rightmenu {
width: 294px;
}