diff --git a/play.pokemonshowdown.com/js/client-battle.js b/play.pokemonshowdown.com/js/client-battle.js index 6e2d737fe..51380fbb6 100644 --- a/play.pokemonshowdown.com/js/client-battle.js +++ b/play.pokemonshowdown.com/js/client-battle.js @@ -618,7 +618,7 @@ } else if (!pokemon || pokemon.fainted) { targetMenus[0] += ' '; } else { - targetMenus[0] += ' '; + targetMenus[0] += ' '; } } for (var i = 0; i < nearActive.length; i++) { @@ -638,7 +638,7 @@ } else if (!pokemon || pokemon.fainted) { targetMenus[1] += ' '; } else { - targetMenus[1] += ' '; + targetMenus[1] += ' '; } } @@ -778,9 +778,9 @@ pokemon.name = pokemon.ident.substr(4); var tooltipArgs = 'switchpokemon|' + i; if (pokemon.fainted || i < this.battle.pokemonControlled || this.choice.switchFlags[i] || trapped) { - party += ' '; + party += ' '; } else { - party += ' '; + party += ' '; } } if (this.battle.mySide.ally) party += this.displayAllyParty(); @@ -794,7 +794,7 @@ var pokemon = allyParty[i]; pokemon.name = pokemon.ident.substr(4); var tooltipArgs = 'allypokemon|' + i; - party += ' '; + party += ' '; } return party; }, @@ -835,11 +835,11 @@ var pokemon = this.battle.myPokemon[i]; var tooltipArgs = 'switchpokemon|' + i; if (pokemon && !pokemon.fainted || this.choice.switchOutFlags[i]) { - controls += ' '; + controls += ' '; } else if (!pokemon) { controls += ' '; } else { - controls += ' '; + controls += ' '; } } controls += ''; @@ -875,7 +875,7 @@ switchMenu += ' '; + switchMenu += '' + BattleLog.escapeHTML(pokemon.name) + (!pokemon.fainted ? '' + (pokemon.status ? '' : '') : '') + ' '; } var controls = ( @@ -910,9 +910,9 @@ var pokemon = switchables[oIndex]; var tooltipArgs = 'switchpokemon|' + oIndex; if (i < this.choice.done) { - switchMenu += ' '; + switchMenu += ' '; } else { - switchMenu += ' '; + switchMenu += ' '; } } diff --git a/play.pokemonshowdown.com/js/search.js b/play.pokemonshowdown.com/js/search.js index 97a78878b..8b8293481 100644 --- a/play.pokemonshowdown.com/js/search.js +++ b/play.pokemonshowdown.com/js/search.js @@ -302,7 +302,7 @@ // icon buf += ''; - buf += ''; + buf += ''; buf += ' '; // name diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 1ffaef6af..8f70894b9 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1156,15 +1156,31 @@ Storage.packedTeamNames = function (buf) { return team; }; -Storage.packedTeamIcons = function (buf) { +Storage.packedTeamIcons = function (buf, mod) { if (!buf) return '(empty team)'; return this.packedTeamNames(buf).map(function (species) { - return '' + toID(species) + ''; + return '' + toID(species) + ''; }).join(''); }; Storage.getTeamIcons = function (team) { + let formatmod = ''; + const format = team.format; + //Bruteforcing through our list of mods to check if one has our team's format + //(For empty teams this isn't necessary) + if (team.team) { + for (const mod in window.ModConfig) { + const modformats = window.ModConfig[mod].formats; + for (const formatid in modformats) { + if (format === formatid) { + formatmod = mod; + break; + } + } + if (formatmod) break; + } + } if (team.iconCache === '!') { // an icon cache of '!' means that not only are the icons not cached, // but the packed team isn't guaranteed to be updated to the latest @@ -1176,12 +1192,12 @@ Storage.getTeamIcons = function (team) { // a packed team. team.team = Storage.packTeam(Storage.activeSetList); if ('teambuilder' in app.rooms) { - return Storage.packedTeamIcons(team.team); + return Storage.packedTeamIcons(team.team, formatmod); } Storage.activeSetList = null; - team.iconCache = Storage.packedTeamIcons(team.team); + team.iconCache = Storage.packedTeamIcons(team.team, formatmod); } else if (!team.iconCache) { - team.iconCache = Storage.packedTeamIcons(team.team); + team.iconCache = Storage.packedTeamIcons(team.team, formatmod); } return team.iconCache; }; diff --git a/play.pokemonshowdown.com/src/battle-animations.ts b/play.pokemonshowdown.com/src/battle-animations.ts index 21056266b..a0b53aed0 100644 --- a/play.pokemonshowdown.com/src/battle-animations.ts +++ b/play.pokemonshowdown.com/src/battle-animations.ts @@ -676,14 +676,15 @@ export class BattleScene implements BattleSceneStub { pokemonhtml += ``; } else if (!poke) { pokemonhtml += ``; - } else if (!poke.ident && this.battle.teamPreviewCount && this.battle.teamPreviewCount < side.pokemon.length) { - // in VGC (bring 6 pick 4) and other pick-less-than-you-bring formats, this is - // a pokemon that's been brought but not necessarily picked - const details = this.getDetailsText(poke); - pokemonhtml += ``; } else { + pokemonhtml += ``; + if (!poke.ident && this.battle.teamPreviewCount && this.battle.teamPreviewCount < side.pokemon.length) { + // in VGC (bring 6 pick 4) and other pick-less-than-you-bring formats, this is + // a pokemon that's been brought but not necessarily picked + pokemonhtml += `;opacity:0.6`; + } + pokemonhtml += `" aria-label="${details}">`; } if (i % 3 === 2) pokemonhtml += `
`; }