0

added --no-signs option

This commit is contained in:
Aaron Griffith
2011-06-08 14:41:43 -04:00
parent 65086b8509
commit c2bf7ff34e
2 changed files with 10 additions and 3 deletions

View File

@@ -66,7 +66,8 @@ class MapGen(object):
image format, and world. image format, and world.
Note:tiledir for each quadtree should be unique. By default the tiledir is determined by the rendermode""" Note:tiledir for each quadtree should be unique. By default the tiledir is determined by the rendermode"""
self.skipjs = configInfo.get('skipjs', None) self.skipjs = configInfo.get('skipjs', False)
self.nosigns = configInfo.get('nosigns', False)
self.web_assets_hook = configInfo.get('web_assets_hook', None) self.web_assets_hook = configInfo.get('web_assets_hook', None)
self.web_assets_path = configInfo.get('web_assets_path', None) self.web_assets_path = configInfo.get('web_assets_path', None)
self.bg_color = configInfo.get('bg_color') self.bg_color = configInfo.get('bg_color')
@@ -153,13 +154,18 @@ class MapGen(object):
# we need to merge self.world.POI with the persistant data in world.PersistentData # we need to merge self.world.POI with the persistant data in world.PersistentData
self.world.POI += filter(lambda x: x['type'] != 'spawn', self.world.persistentData['POI']) self.world.POI += filter(lambda x: x['type'] != 'spawn', self.world.persistentData['POI'])
if self.nosigns:
markers = filter(lambda x: x['type'] != 'sign', self.world.POI)
else:
markers = self.world.POI
# write out the default marker table # write out the default marker table
with open(os.path.join(self.destdir, "markers.js"), 'w') as output: with open(os.path.join(self.destdir, "markers.js"), 'w') as output:
output.write("overviewer.collections.markerDatas.push([\n") output.write("overviewer.collections.markerDatas.push([\n")
for marker in self.world.POI: for marker in markers:
output.write(json.dumps(marker)) output.write(json.dumps(marker))
if marker != self.world.POI[-1]: if marker != markers[-1]:
output.write(",") output.write(",")
output.write("\n") output.write("\n")
output.write("]);\n") output.write("]);\n")

View File

@@ -107,6 +107,7 @@ def main():
parser.add_option("-q", "--quiet", dest="quiet", action="count", default=0, help="Print less output. You can specify this option multiple times.") parser.add_option("-q", "--quiet", dest="quiet", action="count", default=0, help="Print less output. You can specify this option multiple times.")
parser.add_option("-v", "--verbose", dest="verbose", action="count", default=0, help="Print more output. You can specify this option multiple times.") parser.add_option("-v", "--verbose", dest="verbose", action="count", default=0, help="Print more output. You can specify this option multiple times.")
parser.add_option("--skip-js", dest="skipjs", action="store_true", help="Don't output marker.js or regions.js") parser.add_option("--skip-js", dest="skipjs", action="store_true", help="Don't output marker.js or regions.js")
parser.add_option("--no-signs", dest="nosigns", action="store_true", help="Don't output signs to markers.js")
parser.add_option("--display-config", dest="display_config", action="store_true", help="Display the configuration parameters, but don't render the map. Requires all required options to be specified", commandLineOnly=True) parser.add_option("--display-config", dest="display_config", action="store_true", help="Display the configuration parameters, but don't render the map. Requires all required options to be specified", commandLineOnly=True)
#parser.add_option("--write-config", dest="write_config", action="store_true", help="Writes out a sample config file", commandLineOnly=True) #parser.add_option("--write-config", dest="write_config", action="store_true", help="Writes out a sample config file", commandLineOnly=True)