Fix 'improved' menu icon PR
This commit is contained in:
parent
dabd4faaaf
commit
763522cf71
1 changed files with 13 additions and 4 deletions
|
|
@ -279,16 +279,25 @@ DynMap.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var worldName = wname;
|
var worldName = wname;
|
||||||
if(wname.startsWith('world_')) {
|
var mapName = mapindex;
|
||||||
worldName = wname.substring(6);
|
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 = $('<li/>')
|
map.element = $('<li/>')
|
||||||
.addClass('map item')
|
.addClass('map item')
|
||||||
.append($('<a/>')
|
.append($('<a/>')
|
||||||
.attr({ title: map.options.title, href: '#' })
|
.attr({ title: map.options.title, href: '#' })
|
||||||
.addClass('maptype')
|
.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)
|
.text(map.options.title)
|
||||||
)
|
)
|
||||||
.click(function() {
|
.click(function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue