From 6e35b7e87239f799fdfbe76b98b90704ec356527 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 17 Aug 2020 19:41:33 -0500 Subject: [PATCH] Fix 'improved' menu icon PR --- .../src/main/resources/extracted/web/js/map.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/js/map.js b/DynmapCore/src/main/resources/extracted/web/js/map.js index d8b97938..331146b9 100644 --- a/DynmapCore/src/main/resources/extracted/web/js/map.js +++ b/DynmapCore/src/main/resources/extracted/web/js/map.js @@ -279,16 +279,25 @@ DynMap.prototype = { } var worldName = wname; - if(wname.startsWith('world_')) { - worldName = wname.substring(6); + var mapName = mapindex; + if (worldName.endsWith('_nether') || (worldName == 'DIM-1')) { + worldName = 'nether'; + mapName = (mapindex == 'nether') ? 'surface' : 'flat'; + } + else if (worldName.endsWith('the_end') || (worldName == 'DIM1')) { + worldName = 'the_end'; + mapName = (mapindex == 'the_end') ? 'surface' : 'flat'; + } + else { + worldName = 'world'; + mapName = [ 'surface', 'flat', 'biome', 'cave' ].includes(mapindex) ? mapindex : 'flat'; } - map.element = $('
  • ') .addClass('map item') .append($('') .attr({ title: map.options.title, href: '#' }) .addClass('maptype') - .css({ backgroundImage: 'url(' + (map.options.icon || ('images/block_' + worldName + '_' + mapindex + '.png')) + ')' }) + .css({ backgroundImage: 'url(' + (map.options.icon || ('images/block_' + worldName + '_' + mapName + '.png')) + ')' }) .text(map.options.title) ) .click(function() {