Redesign pokemon sidebar

Now Pokemon are only faded out if they haven't necessarily been brought
into the battle.
This commit is contained in:
Guangcong Luo 2017-08-02 20:44:47 -04:00
parent 8eb42e83b3
commit 5737b81996
3 changed files with 9 additions and 6 deletions

View File

@ -1392,18 +1392,21 @@ var Side = (function () {
};
Side.prototype.updateSidebar = function () {
var pokemonhtml = '';
var noShow = this.battle.hardcoreMode && this.battle.gen < 7;
for (var i = 0; i < 6; i++) {
var poke = this.pokemon[i];
if (i >= this.totalPokemon) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon('pokeball-none') + '"></span>';
} else if (this.battle.hardcoreMode && poke && poke.fainted) {
} else if (noShow && poke && poke.fainted) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon('pokeball-fainted') + '" title="Fainted"></span>';
} else if (this.battle.hardcoreMode && poke && poke.status) {
} else if (noShow && poke && poke.status) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon('pokeball-statused') + '" title="Status"></span>';
} else if (this.battle.hardcoreMode) {
} else if (noShow) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon('pokeball') + '" title="Non-statused"></span>';
} else if (!poke) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon('pokeball') + '" title="Not revealed"></span>';
} else if (!poke.ident && this.battle.teamPreviewCount && this.battle.teamPreviewCount < this.pokemon.length) {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon(poke, !this.n) + ';opacity:0.6" title="' + poke.getFullName(true) + '"></span>';
} else {
pokemonhtml += '<span class="picon" style="' + Tools.getPokemonIcon(poke, !this.n) + '" title="' + poke.getFullName(true) + '"></span>';
}

View File

@ -1312,7 +1312,7 @@ var Tools = {
} else if (pokemon === 'pokeball-statused') {
return 'background:transparent url(' + Tools.resourcePrefix + 'sprites/smicons-pokeball-sheet.png) no-repeat scroll -40px 4px';
} else if (pokemon === 'pokeball-fainted') {
return 'background:transparent url(' + Tools.resourcePrefix + 'sprites/smicons-pokeball-sheet.png) no-repeat scroll -80px 4px';
return 'background:transparent url(' + Tools.resourcePrefix + 'sprites/smicons-pokeball-sheet.png) no-repeat scroll -80px 4px;opacity:.4;filter:contrast(0)';
} else if (pokemon === 'pokeball-none') {
return 'background:transparent url(' + Tools.resourcePrefix + 'sprites/smicons-pokeball-sheet.png) no-repeat scroll -80px 4px';
}
@ -1640,7 +1640,7 @@ var Tools = {
var top = Math.floor(num / 12) * 30;
var left = (num % 12) * 40;
var fainted = (pokemon && pokemon.fainted ? ';opacity:.4' : '');
var fainted = (pokemon && pokemon.fainted ? ';opacity:.7;filter:contrast(0)' : '');
return 'background:transparent url(' + Tools.resourcePrefix + 'sprites/smicons-sheet.png?a1) no-repeat scroll -' + left + 'px -' + top + 'px' + fainted;
},

View File

@ -314,7 +314,7 @@ License: GPLv2
.trainer div {
width: 86px;
height: 90px;
opacity: .7;
opacity: .8;
margin: 0 auto;
background: transparent none no-repeat scroll center top;
}