summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclient/minimap-render.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/client/minimap-render.py b/client/minimap-render.py
index 33917ee..c9cb4a1 100755
--- a/client/minimap-render.py
+++ b/client/minimap-render.py
@@ -129,12 +129,14 @@ def usage():
Example:
$ ./minimap-render.py 007-1
will render the map at maps/007-1.tmx in the graphics/minimaps directory.
+ $ ./minimap-render.py all
+ will render all existing maps found in the maps directory.
+ $ ./minimap-render.py update
+ will update all existing minimaps found in the graphics/minimaps directory.
For convenience,
$ ./minimap-render.py 007-1.tmx
- is also acceptable, for e.g running things like,
- $ ./minimap-render.py $(ls ../maps/)
- that would render all existing maps.
+ is also accepted.
\n''' % sys.argv[0])
def main():
@@ -148,7 +150,14 @@ def main():
return 126
status = 0
- for map_name in sys.argv[1:]:
+ if sys.argv[1].lower() == 'all':
+ map_names = sorted([os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'maps'))])
+ elif sys.argv[1].lower() == 'update':
+ map_names = sorted([os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'graphics', u'minimaps'))])
+ else:
+ map_names = sys.argv[1:]
+
+ for map_name in map_names:
# Render tiles at 1 pixel size
map_renderer = MinimapRenderer(map_name, 1, True)
status += map_renderer.render()