From 3c849b9d6602ac196fb2baa32425a918be5aa106 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 16 Dec 2011 01:10:31 +0800 Subject: [PATCH] Add 'grayplayerswhenhidden' option to allow disable of graying of players in player list when not visible on current map --- src/main/java/org/dynmap/ClientConfigurationComponent.java | 1 + src/main/resources/configuration.txt | 3 +++ web/js/map.js | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dynmap/ClientConfigurationComponent.java b/src/main/java/org/dynmap/ClientConfigurationComponent.java index ea5e379e..f45ac6ac 100644 --- a/src/main/java/org/dynmap/ClientConfigurationComponent.java +++ b/src/main/java/org/dynmap/ClientConfigurationComponent.java @@ -26,6 +26,7 @@ public class ClientConfigurationComponent extends Component { s(t, "dynmapversion", plugin.getDescription().getVersion()); s(t, "cyrillic", c.getBoolean("cyrillic-support", false)); s(t, "showlayercontrol", c.getBoolean("showlayercontrol", true)); + s(t, "grayplayerswhenhidden", c.getBoolean("grayplayerswhenhidden", true)); String sn = plugin.getServer().getServerName(); if(sn.equals("Unknown Server")) sn = "Minecraft Dynamic Map"; diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index 87397b2c..638e07a6 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -236,6 +236,9 @@ fullrenderplayerlimit: 0 showplayerfacesinmenu: true +# Control whether players that are hidden or not on current map are grayed out (true=yes) +grayplayerswhenhidden: true + # Set sidebaropened: 'true' to pin menu sidebar opened permanently, 'pinned' to default the sidebar to pinned, but allow it to unpin #sidebaropened: true diff --git a/web/js/map.js b/web/js/map.js index 11d5fc10..5a764866 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -695,7 +695,8 @@ DynMap.prototype = { $(me).trigger('playerupdated', [ player ]); // Update menuitem. - player.menuitem.toggleClass('otherworld', me.world !== location.world); + if(me.options.grayplayerswhenhidden) + player.menuitem.toggleClass('otherworld', me.world !== location.world); if (player === me.followingPlayer) { // Follow the updated player.