From 5ad9d7bf9059fc4eb0eb16c77e34265d5774ae42 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 22 Jul 2011 02:34:35 -0500 Subject: [PATCH] Add smallplayerfaces option for playermarkers component --- configuration.default | 2 ++ web/css/dynmap_style.css | 15 +++++++++++++++ web/js/playermarkers.js | 22 ++++++++++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/configuration.default b/configuration.default index b55c6b1f..2ba21c11 100644 --- a/configuration.default +++ b/configuration.default @@ -49,6 +49,8 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true + # Option to make player faces small - don't use with showplayerhealth + smallplayerfaces: false #- class: org.dynmap.ClientComponent # type: digitalclock - class: org.dynmap.ClientComponent diff --git a/web/css/dynmap_style.css b/web/css/dynmap_style.css index d45e852a..fe5be88f 100644 --- a/web/css/dynmap_style.css +++ b/web/css/dynmap_style.css @@ -519,6 +519,21 @@ border-radius: 3px; } +.dynmap .playerNameSm { + position: absolute; + top: -1px; + left: 18px; + + white-space: nowrap; + + color: #fff; + background: rgba(0,0,0,0.6); + padding: 2px; + + -moz-border-radius: 3px; + border-radius: 3px; +} + .dynmap .healthContainer { display: block; position: absolute; diff --git a/web/js/playermarkers.js b/web/js/playermarkers.js index b5a96755..d4432fc7 100644 --- a/web/js/playermarkers.js +++ b/web/js/playermarkers.js @@ -14,16 +14,26 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) { .append(playerImage = $('') .attr({ src: 'images/player.png' })) .append($('') - .addClass('playerName') + .addClass(configuration.smallplayerfaces?'playerNameSm':'playerName') .text(player.name)); if (configuration.showplayerfaces) { - getMinecraftHead(player.account, 32, function(head) { - $(head) - .addClass('playericon') + if(configuration.smallplayerfaces) { + getMinecraftHead(player.account, 16, function(head) { + $(head) + .addClass('playericon') .prependTo(div); - playerImage.remove(); - }); + playerImage.remove(); + }); + } + else { + getMinecraftHead(player.account, 32, function(head) { + $(head) + .addClass('playericon') + .prependTo(div); + playerImage.remove(); + }); + } } if (configuration.showplayerhealth) { if(!configuration.showplayerfaces) /* Need 32 high */