Changeset 206

Show
Ignore:
Timestamp:
06/02/07 22:02:29 (3 years ago)
Author:
eevee
Message:

Comparer now shows weights as relative square roots.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/templates/dex/utils/compare-results.tt

    r155 r206  
    11[% PROCESS 'dex/common.tt' %] 
     2[% USE Math %] 
    23 
    34[%# XXX: same goes for trainer %] 
     
    1415[% max_height = 0; FOREACH p IN pokemon; NEXT UNLESS p; SET max_height = p.height IF max_height < p.height; END %] 
    1516[% max_weight = 0; FOREACH p IN pokemon; NEXT UNLESS p; SET max_weight = p.weight IF max_weight < p.weight; END %] 
     17[% max_weight_sqrt = Math.sqrt(max_weight) %] 
    1618 
    1719[% extra_count = MAX_POKEMON - pokemon.size %] 
     
    105107    <th rowspan="2">Weight</th> 
    106108[% MACRO block_row BLOCK %] 
    107     <td> <img src="/dex-images/crop/[% tmp = p.id; tmp.pad(3) %].png" alt="[% p.name %]" style="height: [% tmp = p.weight / max_weight * 100; round(tmp, 1) %]%"/> </td> 
     109    <td> <img src="/dex-images/crop/[% tmp = p.id; tmp.pad(3) %].png" alt="[% p.name %]" style="height: [% tmp = Math.sqrt(p.weight) / max_weight_sqrt * 100; round(tmp, 1) %]%"/> </td> 
    108110[% END %] 
    109111[% print_row %]