Merge pull request #535 from bmoyer/overlay-non-clan-player-names

Add option to overlay non-clanmate players with Player Indicator Overlay
This commit is contained in:
Adam
2018-02-04 10:47:53 -05:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -65,6 +65,16 @@ public interface PlayerIndicatorsConfig extends Config
return true;
}
@ConfigItem(
keyName = "drawNonClanMemberNames",
name = "Draw non-clan member names",
description = "Configures whether or not names of non-clan members should be drawn"
)
default boolean drawNonClanMemberNames()
{
return false;
}
@ConfigItem(
keyName = "drawPlayerTiles",
name = "Draw tiles",

View File

@@ -43,6 +43,8 @@ public class PlayerIndicatorsOverlay extends Overlay
private static final Color CYAN = new Color(0, 184, 212);
private static final Color GREEN = new Color(0, 200, 83);
private static final Color PURPLE = new Color(170, 0, 255);
private static final Color RED = new Color(255, 0, 0);
private final Client client;
private final PlayerIndicatorsConfig config;
@@ -57,7 +59,8 @@ public class PlayerIndicatorsOverlay extends Overlay
@Override
public Dimension render(Graphics2D graphics, Point parent)
{
if (!config.drawOwnName() && !config.drawClanMemberNames() && !config.drawFriendNames())
if (!config.drawOwnName() && !config.drawClanMemberNames() &&
!config.drawFriendNames() && !config.drawNonClanMemberNames())
{
return null;
}
@@ -86,6 +89,10 @@ public class PlayerIndicatorsOverlay extends Overlay
{
renderPlayerOverlay(graphics, player, PURPLE);
}
else if (config.drawNonClanMemberNames() && !client.isClanMember(name))
{
renderPlayerOverlay(graphics, player, RED);
}
}
return null;