player indicators: add config for recoloring menu and showing clan rank

This commit is contained in:
Adam
2018-04-05 17:54:53 -04:00
parent 4e0d3cbae7
commit 92103f66f6
2 changed files with 24 additions and 2 deletions

View File

@@ -167,4 +167,26 @@ public interface PlayerIndicatorsConfig extends Config
{
return false;
}
@ConfigItem(
position = 12,
keyName = "colorPlayerMenu",
name = "Color player menu",
description = "Color right click menu for players"
)
default boolean colorPlayerMenu()
{
return true;
}
@ConfigItem(
position = 13,
keyName = "clanMenuIcons",
name = "Show clan rank in menu",
description = "Add clan rank to right click menu for players"
)
default boolean clanMenuIcons()
{
return true;
}
}

View File

@@ -147,7 +147,7 @@ public class PlayerIndicatorsPlugin extends Plugin
MenuEntry[] menuEntries = client.getMenuEntries();
MenuEntry lastEntry = menuEntries[menuEntries.length - 1];
if (color != null)
if (color != null && config.colorPlayerMenu())
{
// strip out existing <col...
String target = lastEntry.getTarget();
@@ -160,7 +160,7 @@ public class PlayerIndicatorsPlugin extends Plugin
lastEntry.setTarget("<col=" + Integer.toHexString(color.getRGB() & 0xFFFFFF) + ">" + target);
}
if (image != -1)
if (image != -1 && config.clanMenuIcons())
{
lastEntry.setTarget("<img=" + image + ">" + lastEntry.getTarget());
}