Skip to content

Commit

Permalink
Rewrite h.pokedex.* to dexlib.* in gts templates
Browse files Browse the repository at this point in the history
Mechanically rewrite calls to the icon and url helpers from
h.pokedex to dexlib. Same sed script as previous commit.

Updates #117
  • Loading branch information
magical committed Jul 19, 2019
1 parent 60fb81a commit e54b5a2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions splinext/gts/templates/gts/list.mako
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
% for savefile in c.savefiles:
<div class="gts-pokemon">
% if savefile.structure.ivs.is_egg:
${h.pokedex.pokedex_img("main-sprites/heartgold-soulsilver/egg.png", class_='icon')}
${dexlib.pokedex_img("main-sprites/heartgold-soulsilver/egg.png", class_='icon')}
% else:
${h.pokedex.pokemon_form_image(savefile.species_form,
${dexlib.pokemon_form_image(savefile.species_form,
prefix='main-sprites/heartgold-soulsilver' + ('/shiny' if savefile.is_shiny else ''),
class_='icon')}
% endif
Expand Down Expand Up @@ -47,7 +47,7 @@
<span class="secret-id">/ ${"%05d" % savefile.structure.original_trainer_secret_id}</span>
</p>
<p>
${h.pokedex.pokedex_img("items/%s.png" % h.pokedex.item_filename(savefile.pokeball),
${dexlib.pokedex_img("items/%s.png" % h.pokedex.item_filename(savefile.pokeball),
alt=savefile.pokeball.name, title=savefile.pokeball.name)}
% if savefile.structure.date_egg_received:
Egg received on ${savefile.structure.date_egg_received} around ${savefile.egg_location.name}.
Expand All @@ -56,7 +56,7 @@
Encountered via ${savefile.structure.encounter_type}
and caught on ${savefile.structure.date_met}
around
${h.pokedex.version_icons(savefile.structure.original_version)}
${dexlib.version_icons(savefile.structure.original_version)}
${savefile.met_location.name}
at level ${savefile.structure.met_at_level}.
% endif
Expand All @@ -69,21 +69,21 @@
('sinnoh', savefile.structure.sinnoh_contest_ribbons):
% for ribbon in reversed(ribbon_container.keys()):
% if ribbon_container[ribbon]:
<li>${h.pokedex.pokedex_img("ribbons/{0}/{1}.png".format(region, ribbon.replace(u'_', u'-')), alt=ribbon.replace(u'_', u' ').title(), title=ribbon.replace(u'_', u' ').title())}</li>
<li>${dexlib.pokedex_img("ribbons/{0}/{1}.png".format(region, ribbon.replace(u'_', u'-')), alt=ribbon.replace(u'_', u' ').title(), title=ribbon.replace(u'_', u' ').title())}</li>
% endif
% endfor
% endfor
</ul>

## Shiny leaves
% if savefile.structure.shining_leaves.crown:
<p>${h.pokedex.pokedex_img('chrome/leaf-crown.png', alt='Leaf Crown', title='Leaf Crown')}</p>
<p>${dexlib.pokedex_img('chrome/leaf-crown.png', alt='Leaf Crown', title='Leaf Crown')}</p>
% elif any(savefile.shiny_leaves):
<ul class="gts-pokemon-leaves">
% for leaf in savefile.shiny_leaves:
<li>
% if leaf:
${h.pokedex.pokedex_img('chrome/shiny-leaf.png', alt='Shiny Leaf', title='Shiny Leaf')}
${dexlib.pokedex_img('chrome/shiny-leaf.png', alt='Shiny Leaf', title='Shiny Leaf')}
% endif
</li>
% endfor
Expand All @@ -105,7 +105,7 @@
<li>Has <a href="${url(controller='dex', action='abilities', name=savefile.ability.name.lower())}">${savefile.ability.name}</a></li>
<li>
% if savefile.held_item:
Holding ${h.pokedex.item_link(savefile.held_item)}
Holding ${dexlib.item_link(savefile.held_item)}
% else:
Holding nothing
% endif
Expand Down Expand Up @@ -201,7 +201,7 @@
<tbody>
% for contest_stat in ('beauty', 'cool', 'cute', 'smart', 'tough'):
<tr>
<th>${h.pokedex.pokedex_img("contest-types/en/{0}.png".format(contest_stat))}</th>
<th>${dexlib.pokedex_img("contest-types/en/{0}.png".format(contest_stat))}</th>
<td>
<div class="gts-bar-container">
<div class="gts-bar" style="width: ${savefile.structure['contest_' + contest_stat] / 255.0 * 100}%;">&nbsp;${savefile.structure['contest_' + contest_stat]}</div>
Expand Down

0 comments on commit e54b5a2

Please sign in to comment.