Skip to content

Commit

Permalink
assetmanager: rename icons dir to markers, symlink
Browse files Browse the repository at this point in the history
This fixes a name collision with Apache's default config.

Closes #1773. Install nginx already.
  • Loading branch information
CounterPillow committed Jun 24, 2020
1 parent 07e6be4 commit cadb24a
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/signs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Here is a more complex example where not every marker of a certain id has a cert
'y':85,
'z':-234,
'name':'Bar'}],
'markers': [dict(name="Towns", filterFunction=townFilter, icon="icons/marker_town.png")],
'markers': [dict(name="Towns", filterFunction=townFilter, icon="markers/marker_town.png")],
### Note: The 'icon' parameter allows you to specify a custom icon, as per
### standard markers. This icon must exist in the same folder as your
### custom webassets or in the same folder as the generated index.html
Expand Down Expand Up @@ -271,7 +271,7 @@ Marker Icons Overviewer ships by default
========================================

Overviewer comes with multiple small icons that you can use for your markers.
You can find them in the ``overviewer_core/data/web_assets/icons`` directory.
You can find them in the ``overviewer_core/data/web_assets/markers`` directory.

If you want to make your own in the same style, you can use the provided
``marker_base_plain.svg`` and ``marker_base_plain_red.svg`` as template, with
Expand Down
16 changes: 12 additions & 4 deletions overviewer_core/assetmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def get_data(tileset):
'defaultMarker': 'signpost.png',
'signMarker': 'signpost_icon.png',
'bedMarker': 'bed.png',
'spawnMarker': 'icons/marker_home.png',
'spawnMarker2x': 'icons/marker_home_2x.png',
'queryMarker': 'icons/marker_location.png',
'queryMarker2x': 'icons/marker_location_2x.png'
'spawnMarker': 'markers/marker_home.png',
'spawnMarker2x': 'markers/marker_home_2x.png',
'queryMarker': 'markers/marker_location.png',
'queryMarker2x': 'markers/marker_location_2x.png'
}
dump['CONST']['mapDivId'] = 'mcmap'
dump['CONST']['UPPERLEFT'] = world.UPPER_LEFT
Expand Down Expand Up @@ -174,6 +174,14 @@ def output_noconfig(self):
mirror_dir(self.custom_assets_dir, self.outputdir, capabilities=self.fs_caps,
force_writable=True)

# symlink old icons dir because apache sux
if (os.name == "posix" and os.symlink in os.supports_dir_fd and
not os.path.islink(os.path.join(self.outputdir, "icons"))):
od_fd = os.open(self.outputdir, os.O_DIRECTORY)
try:
os.symlink("markers", "icons", target_is_directory=True, dir_fd=od_fd)
finally:
os.close(od_fd)
# write a dummy baseMarkers.js if none exists
basemarkers_path = os.path.join(self.outputdir, "baseMarkers.js")
if not os.path.exists(basemarkers_path):
Expand Down

0 comments on commit cadb24a

Please sign in to comment.