mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-06-03 06:18:12 -05:00
Teambuilder: Store the generation of the current team
This commit is contained in:
parent
13d69757a3
commit
cd3cfed675
|
|
@ -18,6 +18,7 @@
|
|||
this.buildMovelists();
|
||||
if (this.curTeam) {
|
||||
this.curTeam.iconCache = '!';
|
||||
this.curTeam.gen = this.getGen(this.curTeam.format);
|
||||
Storage.activeSetList = this.curSetList;
|
||||
}
|
||||
},
|
||||
|
|
@ -721,8 +722,9 @@
|
|||
},
|
||||
formatChange: function (e) {
|
||||
this.curTeam.format = e.currentTarget.value;
|
||||
this.curTeam.gen = this.getGen(this.curTeam.format);
|
||||
this.save();
|
||||
if (this.curTeam.format.substr(0, 4) === 'gen5' && !Tools.loadedSpriteData['bw']) Tools.loadSpriteData('bw');
|
||||
if (this.curTeam.gen === 5 && !Tools.loadedSpriteData['bw']) Tools.loadSpriteData('bw');
|
||||
},
|
||||
nicknameChange: function (e) {
|
||||
var i = +$(e.currentTarget).closest('li').attr('value');
|
||||
|
|
@ -2325,6 +2327,11 @@
|
|||
this.movelist = Tools.movelists[speciesid];
|
||||
}
|
||||
},
|
||||
getGen: function (format) {
|
||||
format = '' + format;
|
||||
if (format.substr(0, 3) !== 'gen') return 6;
|
||||
return parseInt(format.substr(3, 1)) || 6;
|
||||
},
|
||||
destroy: function () {
|
||||
app.clearGlobalListeners();
|
||||
Room.prototype.destroy.call(this);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user