mirror of https://github.com/pret/pokecrystal.git
Assume pokemon pics are 7x7 if not in base stats.
This commit is contained in:
parent
dd77706524
commit
f6fc07d1c9
27
gfx.py
27
gfx.py
|
@ -32,17 +32,22 @@ def get_base_stats():
|
||||||
return base_stats
|
return base_stats
|
||||||
|
|
||||||
def get_pokemon_dimensions(name):
|
def get_pokemon_dimensions(name):
|
||||||
if name == 'egg':
|
try:
|
||||||
return 5, 5
|
if name == 'egg':
|
||||||
if name.startswith('unown_'):
|
return 5, 5
|
||||||
name = 'unown'
|
if name == 'questionmark':
|
||||||
base_stats = get_base_stats()
|
return 7, 7
|
||||||
start = base_stats.find('\tdb ' + name.upper())
|
if name.startswith('unown_'):
|
||||||
start = base_stats.find('\tdn ', start)
|
name = 'unown'
|
||||||
end = base_stats.find('\n', start)
|
base_stats = get_base_stats()
|
||||||
line = base_stats[start:end].replace(',', ' ')
|
start = base_stats.find('\tdb ' + name.upper())
|
||||||
w, h = map(int, line.split()[1:3])
|
start = base_stats.find('\tdn ', start)
|
||||||
return w, h
|
end = base_stats.find('\n', start)
|
||||||
|
line = base_stats[start:end].replace(',', ' ')
|
||||||
|
w, h = map(int, line.split()[1:3])
|
||||||
|
return w, h
|
||||||
|
except:
|
||||||
|
return 7, 7
|
||||||
|
|
||||||
def filepath_rules(filepath):
|
def filepath_rules(filepath):
|
||||||
"""Infer attributes of certain graphics by their location in the filesystem."""
|
"""Infer attributes of certain graphics by their location in the filesystem."""
|
||||||
|
|
Loading…
Reference in New Issue