diff --git a/js/battledata.js b/js/battledata.js index ca7bfe30a..b93d28a63 100644 --- a/js/battledata.js +++ b/js/battledata.js @@ -1336,24 +1336,39 @@ var Tools = { getTeambuilderSprite: function (pokemon) { if (!pokemon) return ''; - var id = toId(pokemon); - if (pokemon.spriteid) id = pokemon.spriteid; - if (pokemon.species && !id) { + var id = toId(pokemon.species); + var spriteid = pokemon.spriteid; + if (pokemon.species && !spriteid) { var template = Tools.getTemplate(pokemon.species); if (template.spriteid) { - id = template.spriteid; + spriteid = template.spriteid; } else { - id = toId(pokemon.species); + spriteid = toId(pokemon.species); } } if (Tools.getTemplate(pokemon.species).exists === false) { return 'background-image:url(' + Tools.resourcePrefix + 'sprites/bw/0.png)'; } var shiny = (pokemon.shiny ? '-shiny' : ''); - if (BattlePokemonSprites && BattlePokemonSprites[id] && BattlePokemonSprites[id].front && BattlePokemonSprites[id].front.anif && pokemon.gender === 'F') { - id += '-f'; + var sdata; + if (BattlePokemonSprites[id] && BattlePokemonSprites[id].front) { + if (BattlePokemonSprites[id].front.anif && pokemon.gender === 'F') { + spriteid += '-f'; + sdata = BattlePokemonSprites[id].front.anif; + } else { + sdata = BattlePokemonSprites[id].front.ani; + } + } else { + return 'background-image:url(' + Tools.resourcePrefix + 'sprites/bw' + shiny + '/' + spriteid + '.png)'; } - return 'background-image:url(' + Tools.resourcePrefix + 'sprites/bw' + shiny + '/' + id + '.png)'; + var w = Math.round(57 - sdata.w / 2), h = Math.round(57 - sdata.h / 2); + if (id === 'altariamega' || id === 'dianciemega') h += 15; + if (id === 'gliscor' || id === 'gardevoirmega' || id === 'garchomp' || id === 'lugia') h += 8; + if (id === 'manectricmega') h -= 8; + if (id === 'giratinaorigin' || id === 'steelixmega') h -= 15; + if (id === 'lugia') w += 8; + if (id === 'rayquazamega' || id === 'giratinaorigin' || id === 'wailord') w += 15; + return 'background-image:url(' + Tools.resourcePrefix + 'sprites/xy' + shiny + '/' + spriteid + '.png);background-position:' + w + 'px ' + h + 'px'; }, getItemIcon: function (item) { diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js index 5c8cbc11b..a7aa5b93f 100644 --- a/js/client-teambuilder.js +++ b/js/client-teambuilder.js @@ -1003,7 +1003,7 @@ buf += '
'; } buf += '
'; - buf += '
'; + buf += '
'; buf += ''; return buf; } @@ -1011,7 +1011,7 @@ buf += '
'; buf += ''; buf += '
'; - buf += '
'; + buf += '
'; // icon var itemicon = ''; @@ -1019,7 +1019,7 @@ var item = Tools.getItem(set.item); itemicon = ''; } - buf += '
' + itemicon + '
'; + buf += '
' + itemicon + '
'; // details buf += '
'; @@ -1442,13 +1442,8 @@ updatePokemonSprite: function () { var set = this.curSet; if (!set) return; - var shiny = (set.shiny ? '-shiny' : ''); - var sprite = Tools.getTemplate(set.species).spriteid; - if (BattlePokemonSprites && BattlePokemonSprites[sprite] && BattlePokemonSprites[sprite].front && BattlePokemonSprites[sprite].front.anif && set.gender === 'F') { - sprite += '-f'; - } - this.$('.setcol-icon').css('background-image', Tools.getTeambuilderSprite(set).substr(17)); + this.$('.setchart').attr('style', Tools.getTeambuilderSprite(set)); this.$('.pokemonicon-' + this.curSetLoc).css('background', Tools.getPokemonIcon(set).substr(11)); diff --git a/style/client.css b/style/client.css index 8edae769c..6472a279b 100644 --- a/style/client.css +++ b/style/client.css @@ -2353,19 +2353,13 @@ a.ilink.yours { } .setchart { border: 1px solid #999999; - background: #DAE5F0; + background: #DAE5F0 no-repeat scroll 10px 5px none; border-radius: 5px; padding: 2px 0 0 3px; height: 127px; width: 626px; margin-top: 8px; - background-image: linear-gradient(top, rgb(218,229,240) 10%, rgb(203,214,225) 55%); - background-image: -o-linear-gradient(top, rgb(218,229,240) 10%, rgb(203,214,225) 55%); - background-image: -moz-linear-gradient(top, rgb(218,229,240) 10%, rgb(203,214,225) 55%); - background-image: -webkit-linear-gradient(top, rgb(218,229,240) 10%, rgb(203,214,225) 55%); - background-image: -ms-linear-gradient(top, rgb(218,229,240) 10%, rgb(203,214,225) 55%); - box-shadow: inset 1px 1px 0 rgba(255,255,255,.6); } .setcol { @@ -2396,6 +2390,8 @@ a.ilink.yours { height: 24px; background-image: transparent none no-repeat scroll center center; opacity: 0.8; + position: relative; + left: 30px; } .setcell-pokemon { margin-top: 0; @@ -2413,8 +2409,9 @@ a.ilink.yours { font-weight: bold; color: #555555; padding-left: 2px; - - text-shadow: 1px 1px 0 rgba(255,255,255,.6); +} +.setcol-icon label { + text-shadow: #DAE5F0 1px 1px 0, #DAE5F0 1px -1px 0, #DAE5F0 -1px 1px 0, #DAE5F0 -1px -1px 0; } .setchart-nickname label { font-size: 7pt;