Override sprite generation with preferences

This commit is contained in:
Quite Quiet
2015-05-08 11:07:03 +02:00
parent 52e9b5bb6c
commit 74bbe2b825

View File

@@ -847,8 +847,13 @@ var Tools = {
facing = 'back';
}
// Decide what gen sprites to use.
var gen = {1:'rby', 2:'gsc', 3:'rse', 4:'dpp', 5:'bw', 6:'xy'}[options.gen];
if (Tools.prefs('nopastgens')) gen = 'xy';
if (Tools.prefs('bwgfx') && gen === 'xy') gen = 'bw';
var animationData = {};
if (options.gen === 5 && window.BattlePokemonSpritesBW) {
if (gen === 'bw' && window.BattlePokemonSpritesBW) {
animationData = BattlePokemonSpritesBW && window.BattlePokemonSpritesBW[pokemon.speciesid];
} else {
animationData = BattlePokemonSprites && window.BattlePokemonSprites[pokemon.speciesid];
@@ -869,11 +874,6 @@ var Tools = {
return spriteData;
}
// Decide what gen sprites to use.
var gen = {1:'rby', 2:'gsc', 3:'rse', 4:'dpp', 5:'bw', 6:'xy'}[options.gen];
if (Tools.prefs('nopastgens')) gen = 'xy';
if (Tools.prefs('bwgfx') && gen === 'xy') gen = 'bw';
if (animationData && animationData[facing]) {
var spriteType = '';
if (animationData[facing]['anif'] && pokemon.gender === 'F') {