summaryrefslogtreecommitdiff
path: root/gfx.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2015-08-29 10:54:28 -0700
committeryenatch <yenatch@gmail.com>2015-08-29 10:54:47 -0700
commit69198a5b3d75c1282b3f789fb378b9e50d8addd2 (patch)
tree0166c7acc7361735d83cc763295cdaad98d1bb5b /gfx.py
parenta129ba7b43b743efacf2926f4443b5f1d6305ef8 (diff)
Fix graphics handling for unown and egg.
Diffstat (limited to 'gfx.py')
-rw-r--r--gfx.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/gfx.py b/gfx.py
index 730c73451..9aed17939 100644
--- a/gfx.py
+++ b/gfx.py
@@ -20,6 +20,10 @@ def filepath_rules(filepath):
name, ext = os.path.splitext(filename)
if 'gfx/pics/' in filedir:
+ if 'unown' in filedir:
+ index = filedir.find('unown_')
+ if index != -1:
+ filedir = filedir[:index + len('unown')] + filedir[index + len('unown_a'):]
if name == 'front':
args['pal_file'] = os.path.join(filedir, 'normal.pal')
args['pic'] = True
@@ -35,7 +39,10 @@ def filepath_rules(filepath):
args['pic'] = True
if args.get('pal_file'):
- args['palout'] = args['pal_file']
+ if os.path.exists(args['pal_file']):
+ args['palout'] = args['pal_file']
+ else:
+ del args['pal_file']
if args.get('pic'):
if ext == '.png':