Changeset 210

Show
Ignore:
Timestamp:
06/03/07 23:47:11 (3 years ago)
Author:
eevee
Message:

Migrated flavor text and images out to its own page.
As a bonus, I now have all alternate frames for D/P and an actual way to see alternate sprites (Castform, Arceus, etc).

Location:
veekun/trunk
Files:
1238 added
3 removed
5 modified
106 moved

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Controller/Dex.pm

    r205 r210  
    703703sub pokemon_chain : Chained('/') : PathPart('dex/pokemon') : CaptureArgs(1) {;} 
    704704 
     705=head2 flavor 
     706 
     707=cut 
     708 
     709sub flavor : Chained('pokemon_chain') : Args(0) { 
     710    my ($self, $c) = @_; 
     711    my $s = $c->stash; 
     712     
     713    my $poke = $c->req->captures->[0]; 
     714 
     715    my $row = get_row($c, 'Pokemon', $poke); 
     716    $c->vee_abort('There is no such Pokémon ', $poke, '.  If you are messing with my URLs, please stop.  If you came here via a link, please inform its owner that it is invalid.') unless $row; 
     717 
     718    $s->{this} = $row; 
     719    $s->{flavors} = { 
     720        map { $_->generation => $_->text } $row->flavors 
     721    }; 
     722    $s->{generation} = ( grep { $Generations[$_]{maxid} >= $row->real_id } 0 .. $#Generations )[0]; 
     723 
     724    $s->{page_title} = $row->name . ' - Flavor Text and Images'; 
     725    $s->{crumbs}     = [ 
     726        '<a href="' . $c->uri('Dex') . '">Pok&eacute;dex</a>', 
     727        '<a href="' . $c->uri('Dex', 'pokemon_list') . '">Pok&eacute;mon</a>', 
     728        '<a href="' . $c->uri('Dex', 'pokemon', lc $row->name) . '">' . $row->name . '</a>', 
     729        'Flavor Text and Images', 
     730    ]; 
     731 
     732    $s->{template} = 'dex/page/pokemon/flavor.tt'; 
     733} 
     734 
    705735=head2 map 
    706736 
  • veekun/trunk/script/pokedex.sql

    r207 r210  
    30803080(386,'ru','The DNA of a space virus underwent a sudden mutation upon exposure to a laser beam and resulted in Deoxys. The crystalline organ on this Pokemon\'s chest appears to be its brain.'), 
    30813081(386,'sa','Deoxys emerged from a virus that came from space. It is highly intelligent and wields psychokinetic powers. This Pokemon shoots lasers from the crystalline organ on its chest.'), 
    3082 (498,'e','A Pokemon that mutates from an alien virus exposed to a laser beam. Its body is configured for superior agility and speed. It is said to have many varying shapes.'), 
    3083 (496,'fr','This Deoxys has transformed into its aggressive guise. It can fool enemies by altering its appearance.'), 
    3084 (497,'lg','When it changes form, an aurora appears. It absorbs attacks by altering its cellular structure.'), 
     3082(386,'e','A Pokemon that mutates from an alien virus exposed to a laser beam. Its body is configured for superior agility and speed. It is said to have many varying shapes.'), 
     3083(386,'fr','This Deoxys has transformed into its aggressive guise. It can fool enemies by altering its appearance.'), 
     3084(386,'lg','When it changes form, an aurora appears. It absorbs attacks by altering its cellular structure.'), 
    30853085(1,'d','For some time after its birth, it grows by gaining nourishment from the seed on its back.'), 
    30863086(2,'d','When the bud on its back starts swelling, a sweet aroma wafts to indicate the flower\'s coming bloom.'), 
  • veekun/trunk/templates/dex/page/pokemon.tt

    r209 r210  
    88    <a href="[% dex_uri('pokemon', PokemonNames.$nextid) %]" class="next blocklink"> <img src="/dex-images/icons/[% nextid.pad(3) %].png" alt=""/> Next: #[% nextid %]<br/>[% PokemonNames.$nextid %] </a> 
    99    <a href="[% dex_uri('pokemon', PokemonNames.$previd) %]" class="prev blocklink"> <img src="/dex-images/icons/[% previd.pad(3) %].png" alt=""/> Previous: #[% previd %]<br/>[% PokemonNames.$previd %] </a> 
    10     <img src="/dex-images/icons/ani/[% image_name %].gif" alt=""/><br/>[% this.real_id %]<br/>[% this.name %] 
     10    <img src="/dex-images/icons/ani/[% image_name %].gif" alt=""/><br/>[% this.real_id %]<br/>[% this.name %]<br/><a href="[% dex_uri('pokemon', this.name) %]/flavor"><img src="/images/see-also.png" alt=""/> Flavor text and images</a> 
    1111</p> 
    1212 
     
    1717    <strong>[% form %]</strong> 
    1818[%         ELSE %] 
    19 <a href="[% dex_uri('pokemon', this.name, { alt_form => form }) %]">[% form %]</a> 
     19    <a href="[% dex_uri('pokemon', this.name, { alt_form => form }) %]">[% form %]</a> 
    2020[%         END %] 
    2121[%         ' | ' UNLESS loop.last %] 
     
    2626<h1>General</h1> 
    2727<div class="dex-summary"> 
    28     <div class="sprite"><img src="/dex-images/dp/[% image_name %].png" [% IF this.id == 352 %]class="mel" [% END %]alt=""/></div> 
     28    <div class="sprite"><a href="[% dex_uri('pokemon', this.name) %]/flavor"><img src="/dex-images/dp/[% image_name %].png" [% IF this.id == 352 %]class="mel" [% END %]alt=""/></a></div> 
    2929    <div class="name">[% this.name %]</div> 
    3030[% IF this.id == 133 %] 
     
    254254<!-- ####################################################################### --> 
    255255 
    256 <h1>Flavor Text and Images</h1> 
    257  
    258 [% flavors = {} %] 
    259 [% FOREACH f IN this.flavors; flavors.${f.generation} = f.text; END %] 
    260  
    261 [% IF generation == 0 %] 
    262 <div class="dex-flavor"> 
    263     <div class="image"> [% Icons.rby %] <img src="/dex-images/oldback/[% image_name %].png" alt=""/> </div> 
    264     <div class="image"> [% Icons.frlg %] <img src="/dex-images/frlg/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/frlg/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    265     <div class="image"> [% Icons.y %] <img src="/dex-images/yellow/[% image_name %].png" alt=""/> </div> 
    266     <div class="image"> [% Icons.rb %] <img src="/dex-images/redblue/[% image_name %].png" alt=""/> </div> 
    267     <div class="image"> [% Icons.gr %] <img src="/dex-images/green/[% image_name %].png" alt=""/> </div> 
    268     <p class="text"> [% Icons.rb %] [%+ Icons.lg %] [% polish_desc(c, flavors.rb, this.name) %] </p> 
    269     <p class="text"> [% Icons.y %] [% polish_desc(c, flavors.y, this.name) %] </p> 
    270     <p class="text"> [% Icons.fr %] [% polish_desc(c, flavors.fr, this.name) %] </p> 
    271 </div> 
    272 [% END %] 
    273  
    274 [% IF generation <= 1 %] 
    275 <div class="dex-flavor"> 
    276     <div class="image"> [% Icons.gsc %] <img src="/dex-images/newback/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/newback/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    277     <div class="image"> [% Icons.c %] <img src="/dex-images/crystal/[% image_name %].gif" alt="" title="normal"/><img src="/dex-images/crystal/shiny/[% image_name %].gif" alt="" title="shiny"/> </div> 
    278     <div class="image"> [% Icons.s %] <img src="/dex-images/silver/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/silver/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    279     <div class="image"> [% Icons.g %] <img src="/dex-images/gold/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/gold/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    280     <p class="text"> [% Icons.g %] [% Icons.lg IF generation == 1 %] [% polish_desc(c, flavors.g, this.name) %] </p> 
    281     <p class="text"> [% Icons.s %] [% Icons.fr IF generation == 1 %] [% polish_desc(c, flavors.s, this.name) %] </p> 
    282     <p class="text"> [% Icons.c %] [% polish_desc(c, flavors.c, this.name) %] </p> 
    283 </div> 
    284 [% END %] 
    285  
    286 [% IF generation <= 2 %] 
    287 [%# WARNING: TERRIBLE DEOXYS HACKERY FOLLOWS %] 
    288 <div class="dex-flavor"> 
    289     <div class="image"> [% Icons.rsfl %] <img src="/dex-images/rusaback/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/rusaback/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    290 [%     IF this.id == 216 OR this.id == 496 OR this.id == 497  # teddiursa and two deoxyses %] 
    291     <div class="image"> [% Icons.frlg %] <img src="/dex-images/frlg/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/frlg/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    292 [%     END %] 
    293 [%     UNLESS this.real_id == 386 AND this.id != 498  # deoxys but not emerald %] 
    294     <div class="image"> [% Icons.e %] <img src="/dex-images/emerald/[% image_name %].png" alt="" title="normal"/><!-- <img src="/dex-images/crystal/shiny/[% image_name %].gif" alt=""/> --> </div> 
    295 [%     END %] 
    296 [%     UNLESS this.real_id == 386 AND this.id != 386  # deoxys but not basic %] 
    297     <div class="image"> [% Icons.rusa %] <img src="/dex-images/rusa/[% image_name %].png" alt="" title="normal"/><img src="/dex-images/rusa/shiny/[% image_name %].png" alt="" title="shiny"/> </div> 
    298 [%     END %] 
    299 [%     IF this.id == 386  # normal/rusa form %] 
    300     <p class="text"> [% Icons.ru %] [% polish_desc(c, flavors.ru, this.name) %] </p> 
    301     <p class="text"> [% Icons.sa %] [% polish_desc(c, flavors.sa, this.name) %] </p> 
    302 [%     ELSIF this.id == 496  # attack/fr form %] 
    303     <p class="text"> [% Icons.fr %] [% polish_desc(c, flavors.fr, this.name) %] </p> 
    304 [%     ELSIF this.id == 497  # defense/lg form %] 
    305     <p class="text"> [% Icons.lg %]When it changes form, an aurora appears. It absorbs attacks by altering its cellular structure. </p> 
    306 [%     ELSIF this.id == 498  # speed/emerald form %] 
    307     <p class="text"> [% Icons.e %] [% polish_desc(c, flavors.e, this.name) %] </p> 
    308 [%     ELSE %] 
    309 [%         IF this.id_hoenn %] 
    310     <p class="text"> [% Icons.ru %] [% polish_desc(c, flavors.ru, this.name) %] </p> 
    311     <p class="text"> [% Icons.sa %] [% polish_desc(c, flavors.sa, this.name) %] </p> 
    312 [%         ELSE %] 
    313     <p class="text"> [% Icons.rusa %] [% polish_desc(c, flavors.sa, this.name) %] </p> 
    314 [%         END %] 
    315     <p class="text"> [% Icons.e %] [% polish_desc(c, flavors.e, this.name) %] </p> 
    316 [%         IF generation == 2 %] 
    317     <p class="text"> [% Icons.frlg %] [% polish_desc(c, flavors.fr, this.name) %] </p> 
    318 [%         END %] 
    319 [%     END %] 
    320 </div> 
    321 [% END %] 
    322  
    323 [% IF generation <= 3 %] 
    324 <div class="dex-flavor"> 
    325 [%     UNLESS this.gender == 254 %] 
    326     <div class="image"> [% Icons.dp %] <img src="/dex-images/dp/back/[% image_name %].png" alt="" title="normal[% UNLESS this.gender == 255 %] male[% END %]"/><img src="/dex-images/dp/back/shiny/[% image_name %].png" alt="" title="shiny[% UNLESS this.gender == 255 %] male[% END %]"/> </div> 
    327     <div class="image"> [% Icons.dp %] <img src="/dex-images/dp/[% image_name %].png" alt="" title="normal[% UNLESS this.gender == 255 %] male[% END %]"/><img src="/dex-images/dp/shiny/[% image_name %].png" alt="" title="shiny[% UNLESS this.gender == 255 %] male[% END %]"/> </div> 
    328 [%     END %] 
    329 [%     IF this.gender == 254 OR !this.flags.match('nodpfem') %] 
    330 [%         f = 'f' IF this.gender < 254 %] 
    331     <div class="image"> [% Icons.dp %] <span class="female">&#x2640;</span> <img src="/dex-images/dp/back/[% image_name; f %].png" alt="" title="normal female"/><img src="/dex-images/dp/back/shiny/[% image_name; f %].png" alt="" title="shiny female"/> </div> 
    332     <div class="image"> [% Icons.dp %] <span class="female">&#x2640;</span> <img src="/dex-images/dp/[% image_name; f %].png" alt="" title="normal female"/><img src="/dex-images/dp/shiny/[% image_name; f%].png" alt="" title="shiny female"/> </div> 
    333 [%     END %] 
    334 [%# it's possible to check for sinnoh id here, but Fearow and the three %] 
    335 [%# super-legendaries also have different data, so..  this is cleaner imo %] 
    336 [%     IF flavors.d == flavors.p %] 
    337     <p class="text"> [% Icons.dp %] [% polish_desc(c, flavors.d, this.name) %] </p> 
    338 [%     ELSE %] 
    339     <p class="text"> [% Icons.d %] [% polish_desc(c, flavors.d, this.name) %] </p> 
    340     <p class="text"> [% Icons.p %] [% polish_desc(c, flavors.p, this.name) %] </p> 
    341 [%     END %] 
    342 </div> 
    343 [% END %] 
    344  
    345 <div class="image"> <img src="/dex-images/sugimori/[% image_name %].png" alt=""/> </div> 
    346  
    347 <!-- ####################################################################### --> 
    348  
    349256[% MACRO rarity_bar(rarity) BLOCK -%] 
    350257[% IF rarity %]<div class="minibar" title="[% rarity %]%"><div class="fill" style="width: [% rarity %]%;"></div></div>[% END %] 
  • veekun/trunk/templates/style/dex.tt

    r193 r210  
    8484  .dex-flavor .text .pokeball { padding-right: 0.5em; } 
    8585 
     86table.dex-sprites { width: auto; } 
     87  table.dex-sprites td { vertical-align: middle; text-align: center; } 
     88 
    8689/* standard Pokedex table; used in several places */ 
    8790.dex-table { width: 100%; } 
  • veekun/trunk/templates/style/global.tt

    r208 r210  
    2222.color2.dimmed { background-color: [% tablerow_dim2 %]; } 
    2323table tr.heading th { background: [% header_fill %]; color: [% header_text %]; border: 1px solid [% header_border %]; border-left: none; border-right: none; } 
     24  table tr.heading th.corner { background: [% header_fill %]; color: [% header_text %]; border: 1px solid [% header_border %]; border-bottom: none; border-right: none; } 
    2425table tr th.heading-vert { background: [% header_fill %]; color: [% header_text %]; border: 1px solid [% header_border %]; border-top: none; border-bottom: none; } 
    2526