Add smallplayerfaces option for playermarkers component

This commit is contained in:
Mike Primm 2011-07-22 02:34:35 -05:00
parent a878ce7cd1
commit 5ad9d7bf90
3 changed files with 33 additions and 6 deletions

View File

@ -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

View File

@ -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;

View File

@ -14,10 +14,19 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
.append(playerImage = $('<img/>')
.attr({ src: 'images/player.png' }))
.append($('<span/>')
.addClass('playerName')
.addClass(configuration.smallplayerfaces?'playerNameSm':'playerName')
.text(player.name));
if (configuration.showplayerfaces) {
if(configuration.smallplayerfaces) {
getMinecraftHead(player.account, 16, function(head) {
$(head)
.addClass('playericon')
.prependTo(div);
playerImage.remove();
});
}
else {
getMinecraftHead(player.account, 32, function(head) {
$(head)
.addClass('playericon')
@ -25,6 +34,7 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
playerImage.remove();
});
}
}
if (configuration.showplayerhealth) {
if(!configuration.showplayerfaces) /* Need 32 high */
playerImage.css('margin-bottom','16px');