Merge pull request #3008 from Kimax89/master

better map icon logic
This commit is contained in:
mikeprimm 2020-08-16 12:41:27 -05:00 committed by GitHub
commit 1bbe0bea30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 8 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -278,12 +278,17 @@ DynMap.prototype = {
worldsadded[wname] = true; worldsadded[wname] = true;
} }
var worldName = wname;
if(wname.startsWith('world_')) {
worldName = wname.substring(6);
}
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_' + mapindex + '.png')) + ')' }) .css({ backgroundImage: 'url(' + (map.options.icon || ('images/block_' + worldName + '_' + mapindex + '.png')) + ')' })
.text(map.options.title) .text(map.options.title)
) )
.click(function() { .click(function() {

View File

@ -115,9 +115,9 @@ worlds:
# background: "#300806" # background: "#300806"
# mapzoomin: 1 # mapzoomin: 1
# - class: org.dynmap.hdmap.HDMap # - class: org.dynmap.hdmap.HDMap
# name: nether # name: surface
# title: "Surface" # title: "Surface"
# prefix: nt # prefix: surface
# perspective: iso_SE_30_hires # perspective: iso_SE_30_hires
# shader: stdtexture # shader: stdtexture
# lighting: nethershadows # lighting: nethershadows