Add support for largeplayerfaces option for bigger player markers

This commit is contained in:
Mike Primm 2021-12-07 21:38:59 -06:00
parent 8c3c0e980e
commit 634eb5fd2f
16 changed files with 107 additions and 31 deletions

View file

@ -584,6 +584,13 @@
height: 16px;
}
.dynmap .playerIconLg {
margin-top: -32px;
margin-left: -32px;
width: 64px;
height: 64px;
}
.dynmap .playerName {
position: absolute;
top: -19px;
@ -615,6 +622,22 @@
border-radius: 3px;
}
.dynmap .playerNameLg {
position: absolute;
top: -19px;
left: 34px;
z-index:20;
white-space: nowrap;
color: #fff;
background: rgba(0,0,0,0.6);
padding: 2px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.dynmap .playerNameNoHealth {
top: -7px;
}
@ -651,6 +674,23 @@
border-radius: 3px;
}
.dynmap .healthContainerLg {
display: block;
position: absolute;
top: 1px;
left: 34px;
width: 50px;
background: rgba(0,0,0,0.6);
padding: 2px;
-moz-border-radius: 3px;
border-radius: 3px;
z-index: 21;
}
.dynmap .playerHealth {
height: 7px;

View file

@ -17,10 +17,10 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
$(div)
.addClass('Marker')
.addClass('playerMarker')
.append(playerImage = $('<img/>').addClass(configuration.smallplayerfaces?'playerIconSm':'playerIcon')
.append(playerImage = $('<img/>').addClass(configuration.smallplayerfaces?'playerIconSm':(configuration.largeplayerfaces?'playerIconLg':'playerIcon'))
.attr({ src: 'images/player.png' }))
.append(player.namefield = $('<span/>')
.addClass(configuration.smallplayerfaces?'playerNameSm':'playerName')
.addClass(configuration.smallplayerfaces?'playerNameSm':(configuration.largeplayerfaces?'playerNameLg':'playerName'))
.append(player.name));
if (configuration.showplayerfaces) {
@ -32,6 +32,14 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
playerImage.remove();
});
}
else if(configuration.largeplayerfaces) {
getMinecraftHead(player.account, 32, function(head) {
$(head)
.addClass('playerIconLg')
.prependTo(div);
playerImage.remove();
});
}
else if(configuration.showplayerbody) {
getMinecraftHead(player.account, 'body', function(head) {
$(head)
@ -51,7 +59,7 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
}
if (configuration.showplayerhealth) {
player.healthContainer = $('<div/>')
.addClass(configuration.smallplayerfaces?'healthContainerSm':'healthContainer')
.addClass(configuration.smallplayerfaces?'healthContainerSm':(configuration.largeplayerfaces?'healthContainerLg':'healthContainer'))
.appendTo(div);
if (player.health !== undefined && player.armor !== undefined) {
player.healthBar = $('<div/>')