Merge branch 'master' into py-package
Conflicts: overviewer_core/googlemap.py
This commit is contained in:
@@ -598,6 +598,11 @@ var overviewer = {
|
||||
var items = [];
|
||||
for (i in overviewerConfig.objectGroups.signs) {
|
||||
var signGroup = overviewerConfig.objectGroups.signs[i];
|
||||
// don't create an option for this group if empty
|
||||
if (overviewer.collections.markers[signGroup.label].length == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var iconURL = signGroup.icon;
|
||||
if(!iconURL) {
|
||||
iconURL = overviewerConfig.CONST.image.defaultMarker;
|
||||
@@ -616,7 +621,11 @@ var overviewer = {
|
||||
}
|
||||
});
|
||||
}
|
||||
overviewer.util.createDropDown('Signposts', items);
|
||||
|
||||
// only create drop down if there's used options
|
||||
if (items.length > 0) {
|
||||
overviewer.util.createDropDown('Signposts', items);
|
||||
}
|
||||
}
|
||||
|
||||
// if there are any regions data, lets show the option to hide/show them.
|
||||
|
||||
@@ -19,7 +19,7 @@ import stat
|
||||
import cPickle
|
||||
import Image
|
||||
import shutil
|
||||
from time import strftime, gmtime
|
||||
from time import strftime, localtime
|
||||
import json
|
||||
|
||||
import util
|
||||
@@ -67,7 +67,8 @@ class MapGen(object):
|
||||
image format, and world.
|
||||
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_path = configInfo.get('web_assets_path', None)
|
||||
self.bg_color = configInfo.get('bg_color')
|
||||
@@ -135,8 +136,7 @@ class MapGen(object):
|
||||
indexpath = os.path.join(self.destdir, "index.html")
|
||||
|
||||
index = open(indexpath, 'r').read()
|
||||
index = index.replace(
|
||||
"{time}", str(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())))
|
||||
index = index.replace("{time}", str(strftime("%a, %d %b %Y %H:%M:%S %Z", localtime())))
|
||||
versionstr = "%s (%s)" % (overviewer_version.VERSION, overviewer_version.HASH[:7])
|
||||
index = index.replace("{version}", versionstr)
|
||||
|
||||
@@ -159,13 +159,18 @@ class MapGen(object):
|
||||
# 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'])
|
||||
|
||||
if self.nosigns:
|
||||
markers = filter(lambda x: x['type'] != 'sign', self.world.POI)
|
||||
else:
|
||||
markers = self.world.POI
|
||||
|
||||
# write out the default marker table
|
||||
with open(os.path.join(self.destdir, "markers.js"), 'w') as output:
|
||||
output.write("overviewer.collections.markerDatas.push([\n")
|
||||
for marker in self.world.POI:
|
||||
for marker in markers:
|
||||
output.write(json.dumps(marker))
|
||||
if marker != self.world.POI[-1]:
|
||||
if marker != markers[-1]:
|
||||
output.write(",")
|
||||
output.write("\n")
|
||||
output.write("]);\n")
|
||||
|
||||
@@ -28,7 +28,7 @@ def check_programs(level):
|
||||
result = filter(lambda x: os.path.exists(os.path.join(x, prog)), path)
|
||||
return len(result) != 0
|
||||
|
||||
for prog,l in [(pngcrush,1), (optipng,2), (advdef,2)]:
|
||||
for prog,l in [(pngcrush,1), (advdef,2)]:
|
||||
if l <= level:
|
||||
if (not exists_in_path(prog)) and (not exists_in_path(prog + ".exe")):
|
||||
raise Exception("Optimization prog %s for level %d not found!" % (prog, l))
|
||||
@@ -46,8 +46,7 @@ def optimize_image(imgpath, imgformat, optimizeimg):
|
||||
|
||||
if optimizeimg >= 2:
|
||||
# the "-nc" it's needed to no broke the transparency of tiles
|
||||
subprocess.Popen([optipng, "-nc", imgpath], stderr=subprocess.STDOUT,
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
subprocess.Popen([advdef, "-z4",imgpath], stderr=subprocess.STDOUT,
|
||||
recompress_option = "-z2" if optimizeimg == 2 else "-z4"
|
||||
subprocess.Popen([advdef, recompress_option,imgpath], stderr=subprocess.STDOUT,
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user