Changeset 394

Show
Ignore:
Timestamp:
12/30/07 01:49:43 (11 months ago)
Author:
eevee
Message:

Location map is reborn. (#228)
Threw in some minor addenda regarding D/P file layout.

Location:
veekun/trunk
Files:
1 removed
5 modified

Legend:

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

    r393 r394  
    723723} 
    724724 
    725 =head2 map 
    726  
    727 =cut 
    728  
    729 sub map : Chained('pokemon_chain') : Args(0) { 
    730     my ($self, $c) = @_; 
    731     my $s = $c->stash; 
    732      
    733     my $poke = $c->req->captures->[0]; 
    734     my $gen = 'dp';  # TODO: CHEAP HACK PLZ MAKE THIS WORK RITE -- do by generation but split if versions disagree? 
    735  
    736     my $row = get_row($c, 'Pokemon', $poke); 
    737     $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; 
    738  
    739     $s->{encounters} = get_locations($row); 
    740     $s->{location_coords} = { 
    741         map { $_->name => $_->coordinates } 
    742             $c->model('DBIC::Locations')->search(undef) 
    743     }; 
    744  
    745     $s->{this} = $row; 
    746  
    747     $s->{page_title} = $row->name . ' - Location Map'; 
    748     $s->{crumbs}     = [ 
    749         '<a href="' . $c->uri('Dex') . '">Pok&eacute;dex</a>', 
    750         '<a href="' . $c->uri('Dex', 'pokemon_list') . '">Pok&eacute;mon</a>', 
    751         '<a href="' . $c->uri('Dex', 'pokemon', lc $row->name) . '">' . $row->name . '</a>', 
    752         'Location Map', 
    753     ]; 
    754  
    755     $s->{template} = 'dex/page/pokemon/map.tt'; 
    756 } 
    757  
    758725################################################################################ 
    759726 
     
    14201387        if ($node->{param}) { 
    14211388            $node->{blurb} .= ", or use $node->{param}"; 
    1422             $node->{item} = $1 eq 'day' ? 'gameui/day' : 'gameui/night'; 
     1389            $node->{item} = $1 eq 'day' ? 'gameui/daytime' : 'gameui/night'; 
    14231390        } 
    14241391 
  • veekun/trunk/static/dex/dp/hacking/files.tt

    r315 r394  
    281281  <dd>PLACEHOLDER: GBA 4bpp.  Graphics used in the animations for the transitions from the overworld to battles.</dd> 
    282282<dt>graphic/fld_comact.narc</dt> 
     283  <dd>PLACEHOLDER: GBA 4bpp.  Appears to only contain an up arrow and a down arrow?</dd> 
    283284<dt>graphic/font.narc</dt> 
    284285<dt>graphic/fontoam.narc</dt> 
     
    286287<dt>graphic/imageclip.narc</dt> 
    287288<dt>graphic/mail_gra.narc</dt> 
     289  <dd>PLACEHOLDER: GBA 4bpp.  Background graphics for mail.</dd> 
    288290<dt>graphic/menu_gra.narc</dt> 
    289291<dt>graphic/mysign.narc</dt> 
     
    309311<dt>graphic/waza_oshie_gra.narc</dt> 
    310312<dt>graphic/winframe.narc</dt> 
     313  <dd>PLACEHOLDER: GBA 4bpp.  Borders, down arrow, and rotating clock animation used for dialog.</dd> 
    311314<dt>graphic/worldtrade.narc</dt> 
    312315<dt>graphic/zukan.narc</dt> 
  • veekun/trunk/templates/dex/page/location.tt

    r393 r394  
    99[% FOREACH section IN encounters.keys %] 
    1010 
     11[% IF section %] 
    1112<h2>[% section %]</h2> 
     13[% END %] 
    1214<table cellspacing="0" cellpadding="3" class="dex-table dex-locations"> 
    1315<tr class="heading"> 
  • veekun/trunk/templates/dex/page/pokemon.tt

    r393 r394  
    276276 
    277277<h1>Locations</h1> 
    278 [%# TODO fix ghastly links %] 
    279 <p><a href="[% dex_uri('pokemon', this.name) %]/map"><img src="/images/see-also.png" alt="See also:"/> Location map</a></p> 
     278[% MAP_SCALE = 1 # DO NOT SET THIS TO ANYTHING BUT 1 UNTIL BACKGROUND PROBLEM IS SOLVED %] 
     279<div class="dex-locations-map"> 
     280    <img src="/dex-images/maps/sinnoh-dim.png" style="width: [% 216 * MAP_SCALE %]px;" alt=""/> 
     281[% FOR enc IN new_encounters %] 
     282[%     location = enc.location %] 
     283[%     NEXT IF done.${location.id} OR NOT location.coordinates%] 
     284[%     map_done.${location.id} = 1 %] 
     285    <a href="[% dex_uri('locations', location.name) %]" title="[% location.name %]" class="location"> 
     286        <div class="name">[% location.name %]</div> 
     287[%         FOREACH loc IN location.coordinates.split(';'); 
     288               coords = loc.split(' '); 
     289               left   = coords.shift * MAP_SCALE; 
     290               top    = coords.shift * MAP_SCALE; 
     291               width  = coords.shift * MAP_SCALE; 
     292               height = coords.shift * MAP_SCALE; 
     293%] 
     294        <div class="partition" style="top: [% top %]px; left: [% left %]px; width: [% width %]px; height: [% height %]px; background: url(/dex-images/maps/sinnoh.png) -[% left %]px -[% top %]px;" title="[% location_row.name %]"></div> 
     295[%     END %] 
     296    </a> 
     297[% END %] 
     298</div> 
    280299 
    281300<p>Sorry, Pearl players!  Only Diamond for the moment.</p> 
  • veekun/trunk/templates/style/dex.tt

    r369 r394  
    120120  .dex-natures td { text-align: center; padding-left: 1em; padding-right: 1em; } 
    121121 
    122 .dex-locations-map { position: relative; } 
    123 .dex-locations-map img.map { float: left; margin-right: 16px; } 
    124 .dex-locations-map .location { position: absolute; top: 0; left: 0; } 
    125 .dex-locations-map .location .marker { visibility: hidden; } 
    126 .dex-locations-map .location:hover .marker { visibility: visible; } 
    127 .dex-locations-map .partition { position: absolute; z-index: 1; } 
    128 .dex-locations-map .location:hover .partition { outline: 2px solid white; } 
     122.dex-locations-map { position: relative; float: right; } 
     123.dex-locations-map img.map { margin-right: 16px; } 
     124.dex-locations-map .location { } 
     125.dex-locations-map .location .name { position: absolute; visibility: hidden; right: 0; bottom: 0; width: 75%; padding-right: 1em; text-align: right; color: white; font-weight: bold; font-family: monospace; } 
     126.dex-locations-map .location:hover .name { visibility: visible; } 
     127.dex-locations-map .location:hover .name:hover { visibility: hidden; } 
     128.dex-locations-map .partition { position: absolute; z-index: 10; } 
    129129 
    130130/* Pokemon comparifier */