Write/read last_rendertime
This commit is contained in:
@@ -44,6 +44,23 @@ directory.
|
|||||||
# Each regionset's name is a key in this dictionary
|
# Each regionset's name is a key in this dictionary
|
||||||
self.POI = dict()
|
self.POI = dict()
|
||||||
|
|
||||||
|
# look for overviewerConfig in self.outputdir
|
||||||
|
if os.path.exists(os.path.join(self.outputdir, "overviewerConfig.js")):
|
||||||
|
with open(os.path.join(self.outputdir, "overviewerConfig.js")) as c:
|
||||||
|
overviewerConfig_str = "{" + "\n".join(c.readlines()[1:-1]) + "}"
|
||||||
|
self.overviewerConfig = json.loads(overviewerConfig_str)
|
||||||
|
else:
|
||||||
|
self.overviewerConfig = dict(tilesets=dict())
|
||||||
|
|
||||||
|
def get_tileset_config(self, name):
|
||||||
|
"Return the correct dictionary from the parsed overviewerConfig.js"
|
||||||
|
for conf in self.overviewerConfig['tilesets']:
|
||||||
|
if conf['path'] == name:
|
||||||
|
return conf
|
||||||
|
return dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def found_poi(self, regionset, poi_type, contents, chunkX, chunkY):
|
def found_poi(self, regionset, poi_type, contents, chunkX, chunkY):
|
||||||
if regionset.name not in self.POI.keys():
|
if regionset.name not in self.POI.keys():
|
||||||
POI[regionset.name] = []
|
POI[regionset.name] = []
|
||||||
@@ -59,7 +76,7 @@ directory.
|
|||||||
dump['CONST']['image'] = {
|
dump['CONST']['image'] = {
|
||||||
'defaultMarker': 'signpost.png',
|
'defaultMarker': 'signpost.png',
|
||||||
'signMarker': 'signpost_icon.png',
|
'signMarker': 'signpost_icon.png',
|
||||||
'compass': 'compass_lower-left.png',
|
'compass': 'compass_upper-left.png',
|
||||||
'spawnMarker': 'http://google-maps-icons.googlecode.com/files/home.png',
|
'spawnMarker': 'http://google-maps-icons.googlecode.com/files/home.png',
|
||||||
'queryMarker': 'http://google-maps-icons.googlecode.com/files/regroup.png'
|
'queryMarker': 'http://google-maps-icons.googlecode.com/files/regroup.png'
|
||||||
}
|
}
|
||||||
@@ -105,6 +122,8 @@ directory.
|
|||||||
js_tileset['base'] = ''
|
js_tileset['base'] = ''
|
||||||
js_tileset['bgcolor'] = bgcolorformat(tileset.options.get('bgcolor'))
|
js_tileset['bgcolor'] = bgcolorformat(tileset.options.get('bgcolor'))
|
||||||
js_tileset['world'] = tileset.options.get('worldname_orig')
|
js_tileset['world'] = tileset.options.get('worldname_orig')
|
||||||
|
js_tileset['last_rendertime'] = tileset.this_rendertime
|
||||||
|
js_tileset['north_direction'] = 'upper-left'
|
||||||
dump['tilesets'].append(js_tileset)
|
dump['tilesets'].append(js_tileset)
|
||||||
|
|
||||||
# write a blank image
|
# write a blank image
|
||||||
|
|||||||
@@ -250,8 +250,8 @@ class TileSet(object):
|
|||||||
self.am = assetmanagerobj
|
self.am = assetmanagerobj
|
||||||
self.textures = texturesobj
|
self.textures = texturesobj
|
||||||
|
|
||||||
# XXX TODO:
|
self.last_rendertime = self.am.get_tileset_config(self.options.get("name")).get('last_rendertime', 0)
|
||||||
self.last_rendertime = 0 # TODO
|
self.this_rendertime = time.time()
|
||||||
|
|
||||||
# Throughout the class, self.outputdir is an absolute path to the
|
# Throughout the class, self.outputdir is an absolute path to the
|
||||||
# directory where we output tiles. It is assumed to exist.
|
# directory where we output tiles. It is assumed to exist.
|
||||||
|
|||||||
Reference in New Issue
Block a user