From 634eb5fd2f868c6f1cfd7e710bd85475f4887c94 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 7 Dec 2021 21:38:59 -0600 Subject: [PATCH] Add support for largeplayerfaces option for bigger player markers --- .../extracted/web/css/dynmap_style.css | 40 +++++++++++++++++++ .../extracted/web/js/playermarkers.js | 14 +++++-- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- .../src/main/resources/configuration.txt | 6 ++- spigot/src/main/resources/configuration.txt | 6 ++- 16 files changed, 107 insertions(+), 31 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css b/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css index 3bdc79b3..3e8099f8 100644 --- a/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css +++ b/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css @@ -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; diff --git a/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js b/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js index c2a7e028..9e5055ce 100644 --- a/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js +++ b/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js @@ -17,10 +17,10 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) { $(div) .addClass('Marker') .addClass('playerMarker') - .append(playerImage = $('').addClass(configuration.smallplayerfaces?'playerIconSm':'playerIcon') + .append(playerImage = $('').addClass(configuration.smallplayerfaces?'playerIconSm':(configuration.largeplayerfaces?'playerIconLg':'playerIcon')) .attr({ src: 'images/player.png' })) .append(player.namefield = $('') - .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 = $('
') - .addClass(configuration.smallplayerfaces?'healthContainerSm':'healthContainer') + .addClass(configuration.smallplayerfaces?'healthContainerSm':(configuration.largeplayerfaces?'healthContainerLg':'healthContainer')) .appendTo(div); if (player.health !== undefined && player.armor !== undefined) { player.healthBar = $('
') diff --git a/fabric-1.14.4/src/main/resources/configuration.txt b/fabric-1.14.4/src/main/resources/configuration.txt index 4b8d65ba..8b8072ac 100644 --- a/fabric-1.14.4/src/main/resources/configuration.txt +++ b/fabric-1.14.4/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/fabric-1.15.2/src/main/resources/configuration.txt b/fabric-1.15.2/src/main/resources/configuration.txt index 4b8d65ba..8b8072ac 100644 --- a/fabric-1.15.2/src/main/resources/configuration.txt +++ b/fabric-1.15.2/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/fabric-1.16.4/src/main/resources/configuration.txt b/fabric-1.16.4/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/fabric-1.16.4/src/main/resources/configuration.txt +++ b/fabric-1.16.4/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/fabric-1.17.1/src/main/resources/configuration.txt b/fabric-1.17.1/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/fabric-1.17.1/src/main/resources/configuration.txt +++ b/fabric-1.17.1/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/fabric-1.18/src/main/resources/configuration.txt b/fabric-1.18/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/fabric-1.18/src/main/resources/configuration.txt +++ b/fabric-1.18/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.11.2/src/main/resources/configuration.txt b/forge-1.11.2/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/forge-1.11.2/src/main/resources/configuration.txt +++ b/forge-1.11.2/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.12.2/src/main/resources/configuration.txt b/forge-1.12.2/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/forge-1.12.2/src/main/resources/configuration.txt +++ b/forge-1.12.2/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.13.2/src/main/resources/configuration.txt b/forge-1.13.2/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/forge-1.13.2/src/main/resources/configuration.txt +++ b/forge-1.13.2/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.14.4/src/main/resources/configuration.txt b/forge-1.14.4/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/forge-1.14.4/src/main/resources/configuration.txt +++ b/forge-1.14.4/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.15.2/src/main/resources/configuration.txt b/forge-1.15.2/src/main/resources/configuration.txt index 13dc64a3..ea7f54a4 100644 --- a/forge-1.15.2/src/main/resources/configuration.txt +++ b/forge-1.15.2/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.16.5/src/main/resources/configuration.txt b/forge-1.16.5/src/main/resources/configuration.txt index ab940145..8969bcb8 100644 --- a/forge-1.16.5/src/main/resources/configuration.txt +++ b/forge-1.16.5/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.17.1/src/main/resources/configuration.txt b/forge-1.17.1/src/main/resources/configuration.txt index ab940145..8969bcb8 100644 --- a/forge-1.17.1/src/main/resources/configuration.txt +++ b/forge-1.17.1/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/forge-1.18/src/main/resources/configuration.txt b/forge-1.18/src/main/resources/configuration.txt index ab940145..8969bcb8 100644 --- a/forge-1.18/src/main/resources/configuration.txt +++ b/forge-1.18/src/main/resources/configuration.txt @@ -151,10 +151,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0) diff --git a/spigot/src/main/resources/configuration.txt b/spigot/src/main/resources/configuration.txt index dac6477d..98af954b 100644 --- a/spigot/src/main/resources/configuration.txt +++ b/spigot/src/main/resources/configuration.txt @@ -152,10 +152,12 @@ components: type: playermarkers showplayerfaces: true showplayerhealth: true - # If true, show player body too (only valid if showplayerfaces=true + # If true, show player body too (only valid if showplayerfaces=true) showplayerbody: false - # Option to make player faces small - don't use with showplayerhealth + # Option to make player faces small - don't use with showplayerhealth or largeplayerfaces smallplayerfaces: false + # Option to make player faces larger - don't use with showplayerhealth or smallplayerfaces + largeplayerfaces: false # Optional - make player faces layer hidden by default hidebydefault: false # Optional - ordering priority in layer menu (low goes before high - default is 0)