This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add 'showspawn' render option

Allow users to hide the spawn marker that is normally generated for
overworld levels
  • Loading branch information...
tswsl1989 committed Apr 8, 2012
1 parent b2ce4fa commit 36aa6ed011ce0de896c15e5106d700de00d75e94
Showing with 10 additions and 2 deletions.
  1. +4 −0 docs/config.rst
  2. +1 −1 overviewer.py
  3. +1 −0 overviewer_core/settingsDefinition.py
  4. +4 −1 overviewer_core/tileset.py
View
@@ -480,6 +480,10 @@ values. The valid configuration keys are listed below.
**Default:** ``[]`` (an empty list)
+``showspawn``
+ This is a boolean, and defaults to ``True``. If set to ``False``, then the spawn
+ icon will not be displayed on the rendered map.
+
.. _customrendermodes:
Custom Rendermodes and Rendermode Primitives
View
@@ -401,7 +401,7 @@ def main():
# only pass to the TileSet the options it really cares about
render['name'] = render_name # perhaps a hack. This is stored here for the asset manager
- tileSetOpts = util.dict_subset(render, ["name", "imgformat", "renderchecks", "rerenderprob", "bgcolor", "imgquality", "optimizeimg", "rendermode", "worldname_orig", "title", "dimension", "changelist"])
+ tileSetOpts = util.dict_subset(render, ["name", "imgformat", "renderchecks", "rerenderprob", "bgcolor", "imgquality", "optimizeimg", "rendermode", "worldname_orig", "title", "dimension", "changelist","showspawn"])
tileSetOpts.update({"spawn": w.find_true_spawn()}) # TODO find a better way to do this
tset = tileset.TileSet(rset, assetMrg, tex, tileSetOpts, tileset_dir)
tilesets.append(tset)
@@ -79,6 +79,7 @@
"crop": Setting(required=False, validator=validateCrop, default=None),
"changelist": Setting(required=False, validator=validateStr, default=None),
"markers": Setting(required=False, validator=validateMarkers, default=[]),
+ "showspawn": Setting(required=False, validator=validateBool, default=True),
# Remove this eventually (once people update their configs)
"worldname": Setting(required=False, default=None,
@@ -520,8 +520,11 @@ def bgcolorformat(color):
last_rendertime = self.max_chunk_mtime,
imgextension = self.imgextension,
)
- if (self.regionset.get_type() == "overworld"):
+ if (self.regionset.get_type() == "overworld" and self.options.get("showspawn", True)):
d.update({"spawn": self.options.get("spawn")})
+ else:
+ d.update({"spawn": "false"});
+
try:
d['north_direction'] = self.regionset.north_dir
except AttributeError:

0 comments on commit 36aa6ed

Please sign in to comment.