changed markers.js to output one marker per line
this has been requested *many* times, because it makes it easier to (1) learn what format markers.js uses, and (2) write shell scripts that process markers.js. It shouldn't break existing processors that use json loaders, and does not drastically increase file size (just one extra byte per ~70).
This commit is contained in:
@@ -144,7 +144,13 @@ class MapGen(object):
|
||||
|
||||
# write out the default marker table
|
||||
with open(os.path.join(self.destdir, "markers.js"), 'w') as output:
|
||||
output.write("var markerData=%s" % json.dumps(self.world.POI))
|
||||
output.write("var markerData=[\n")
|
||||
for marker in self.world.POI:
|
||||
output.write(json.dumps(marker))
|
||||
if marker != self.world.POI[-1]:
|
||||
output.write(",")
|
||||
output.write("\n")
|
||||
output.write("]\n")
|
||||
|
||||
# save persistent data
|
||||
self.world.persistentData['POI'] = self.world.POI
|
||||
|
||||
Reference in New Issue
Block a user