diff --git a/docs/signs.rst b/docs/signs.rst index 415e581..d0487e2 100644 --- a/docs/signs.rst +++ b/docs/signs.rst @@ -93,7 +93,7 @@ of dictionaries. For example:: 'world': 'myworld', 'title': "Example", 'markers': [dict(name="All signs", filterFunction=signFilter), - dict(name="Chests", filterFunction=chestFilter, icon="chest.png")] + dict(name="Chests", filterFunction=chestFilter, icon="chest.png", createInfoWindow=False)] } @@ -112,6 +112,9 @@ The following keys are accepted in the marker dictionary: on the POI itself (this can be done by modifying the POI in the filter function. See the example above) +``createInfoWindow`` + Optional. Specifies wether or not the icon displays a spezial info window on click. Defaults to true + Generating the POI Markers ========================== diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 9b80a60..f67e556 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -153,15 +153,15 @@ def main(): return 1 for f in render['markers']: - d = dict(icon="signpost_icon.png") + d = dict(icon="signpost_icon.png", createInfoWindow=True) d.update(f) markersets.add(((d['name'], d['filterFunction']), rset)) name = f['name'].replace(" ","_") + hex(hash(f['filterFunction']))[-4:] + "_" + hex(hash(rset))[-4:] try: l = markers[rname] - l.append(dict(groupName=name, displayName = f['name'], icon=d['icon'])) + l.append(dict(groupName=name, displayName = f['name'], icon=d['icon'], createInfoWindow=d['createInfoWindow'])) except KeyError: - markers[rname] = [dict(groupName=name, displayName=f['name'], icon=d['icon']),] + markers[rname] = [dict(groupName=name, displayName=f['name'], icon=d['icon'], createInfoWindow=d['createInfoWindow']),] handleSigns(rset, os.path.join(destdir, rname), render, rname) handlePlayers(rset, render, worldpath) @@ -179,16 +179,20 @@ def main(): for poi in rset._pois['TileEntities']: result = filter_function(poi) if result: - d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True) + d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result) if "icon" in poi: d.update({"icon": poi['icon']}) + if "createInfoWindow" in poi: + d.update({"createInfoWindow": poi['createInfoWindow']}) markerSetDict[name]['raw'].append(d) for poi in rset._pois['Players']: result = filter_function(poi) if result: - d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True) + d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result) if "icon" in poi: d.update({"icon": poi['icon']}) + if "createInfoWindow" in poi: + d.update({"createInfoWindow": poi['createInfoWindow']}) markerSetDict[name]['raw'].append(d) #print markerSetDict diff --git a/overviewer_core/data/js_src/views.js b/overviewer_core/data/js_src/views.js index 0d185ed..ae1a39e 100644 --- a/overviewer_core/data/js_src/views.js +++ b/overviewer_core/data/js_src/views.js @@ -458,8 +458,14 @@ overviewer.views.SignControlView = Backbone.View.extend({ 'icon': iconURL, 'visible': false }); - if (entity.createInfoWindow) { - overviewer.util.createMarkerInfoWindow(marker); + if(entity['createInfoWindow']) { + if (entity.createInfoWindow) { + overviewer.util.createMarkerInfoWindow(marker); + } + } else { + if(dataRoot[i].createInfoWindow) { + overviewer.util.createMarkerInfoWindow(marker); + } } jQuery.extend(entity, {markerObj: marker}); }