Sanitize player indicators options
- Name the player indicators options properly - Extend the clan ranks icon setting to support also overhead names Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -39,10 +39,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
keyName = "drawOwnName",
|
keyName = "drawOwnName",
|
||||||
name = "Draw own name",
|
name = "Highlight own player",
|
||||||
description = "Configures whether or not own name should be drawn"
|
description = "Configures whether or not your own player should be highlighted"
|
||||||
)
|
)
|
||||||
default boolean drawOwnName()
|
default boolean highlightOwnPlayer()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -50,10 +50,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
keyName = "ownNameColor",
|
keyName = "ownNameColor",
|
||||||
name = "Own name color",
|
name = "Own player color",
|
||||||
description = "Color of your own name"
|
description = "Color of your own player"
|
||||||
)
|
)
|
||||||
default Color getOwnNameColor()
|
default Color getOwnPlayerColor()
|
||||||
{
|
{
|
||||||
return new Color(0, 184, 212);
|
return new Color(0, 184, 212);
|
||||||
}
|
}
|
||||||
@@ -61,10 +61,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 2,
|
position = 2,
|
||||||
keyName = "drawFriendNames",
|
keyName = "drawFriendNames",
|
||||||
name = "Draw friend names",
|
name = "Highlight friends",
|
||||||
description = "Configures whether or not names of player friends should be drawn"
|
description = "Configures whether or not friends should be highlighted"
|
||||||
)
|
)
|
||||||
default boolean drawFriendNames()
|
default boolean highlightFriends()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -72,10 +72,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 3,
|
position = 3,
|
||||||
keyName = "friendNameColor",
|
keyName = "friendNameColor",
|
||||||
name = "Friend name color",
|
name = "Friend color",
|
||||||
description = "Color of friend names"
|
description = "Color of friend names"
|
||||||
)
|
)
|
||||||
default Color getFriendNameColor()
|
default Color getFriendColor()
|
||||||
{
|
{
|
||||||
return new Color(0, 200, 83);
|
return new Color(0, 200, 83);
|
||||||
}
|
}
|
||||||
@@ -83,8 +83,8 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 4,
|
||||||
keyName = "drawClanMemberNames",
|
keyName = "drawClanMemberNames",
|
||||||
name = "Draw clan member names",
|
name = "Highlight clan members",
|
||||||
description = "Configures whether or not names of player's clan members should be drawn"
|
description = "Configures whether or clan members should be highlighted"
|
||||||
)
|
)
|
||||||
default boolean drawClanMemberNames()
|
default boolean drawClanMemberNames()
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
position = 5,
|
position = 5,
|
||||||
keyName = "clanMemberColor",
|
keyName = "clanMemberColor",
|
||||||
name = "Clan member color",
|
name = "Clan member color",
|
||||||
description = "Color of clan member names"
|
description = "Color of clan members"
|
||||||
)
|
)
|
||||||
default Color getClanMemberColor()
|
default Color getClanMemberColor()
|
||||||
{
|
{
|
||||||
@@ -105,10 +105,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 6,
|
position = 6,
|
||||||
keyName = "drawTeamMemberNames",
|
keyName = "drawTeamMemberNames",
|
||||||
name = "Draw team member names",
|
name = "Highlight team members",
|
||||||
description = "Configures whether or not names of player's team members should be drawn"
|
description = "Configures whether or not team members should be highlighted"
|
||||||
)
|
)
|
||||||
default boolean drawTeamMemberNames()
|
default boolean highlightTeamMembers()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
position = 7,
|
position = 7,
|
||||||
keyName = "teamMemberColor",
|
keyName = "teamMemberColor",
|
||||||
name = "Team member color",
|
name = "Team member color",
|
||||||
description = "Color of team member names"
|
description = "Color of team members"
|
||||||
)
|
)
|
||||||
default Color getTeamMemberColor()
|
default Color getTeamMemberColor()
|
||||||
{
|
{
|
||||||
@@ -127,10 +127,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 8,
|
position = 8,
|
||||||
keyName = "drawNonClanMemberNames",
|
keyName = "drawNonClanMemberNames",
|
||||||
name = "Draw non-clan member names",
|
name = "Highlight non-clan members",
|
||||||
description = "Configures whether or not names of non-clan members should be drawn"
|
description = "Configures whether or not non-clan members should be highlighted"
|
||||||
)
|
)
|
||||||
default boolean drawNonClanMemberNames()
|
default boolean highlightNonClanMembers()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -149,8 +149,8 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 10,
|
position = 10,
|
||||||
keyName = "drawPlayerTiles",
|
keyName = "drawPlayerTiles",
|
||||||
name = "Draw tiles",
|
name = "Draw tiles under players",
|
||||||
description = "Configures whether or not tiles under players with rendered names should be drawn"
|
description = "Configures whether or not tiles under highlighted players should be drawn"
|
||||||
)
|
)
|
||||||
default boolean drawTiles()
|
default boolean drawTiles()
|
||||||
{
|
{
|
||||||
@@ -182,7 +182,7 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 13,
|
position = 13,
|
||||||
keyName = "colorPlayerMenu",
|
keyName = "colorPlayerMenu",
|
||||||
name = "Color player menu",
|
name = "Colorize player menu",
|
||||||
description = "Color right click menu for players"
|
description = "Color right click menu for players"
|
||||||
)
|
)
|
||||||
default boolean colorPlayerMenu()
|
default boolean colorPlayerMenu()
|
||||||
@@ -193,10 +193,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 14,
|
position = 14,
|
||||||
keyName = "clanMenuIcons",
|
keyName = "clanMenuIcons",
|
||||||
name = "Show clan rank in menu",
|
name = "Show clan ranks",
|
||||||
description = "Add clan rank to right click menu for players"
|
description = "Add clan rank to right click menu and next to player names"
|
||||||
)
|
)
|
||||||
default boolean clanMenuIcons()
|
default boolean showClanRanks()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,12 +87,14 @@ public class PlayerIndicatorsOverlay extends Overlay
|
|||||||
|
|
||||||
if (textLocation != null)
|
if (textLocation != null)
|
||||||
{
|
{
|
||||||
if (actor.isClanMember())
|
if (config.showClanRanks() && actor.isClanMember())
|
||||||
{
|
{
|
||||||
ClanMemberRank rank = clanManager.getRank(name);
|
ClanMemberRank rank = clanManager.getRank(name);
|
||||||
|
|
||||||
if (rank != ClanMemberRank.UNRANKED)
|
if (rank != ClanMemberRank.UNRANKED)
|
||||||
{
|
{
|
||||||
BufferedImage clanchatImage = clanManager.getClanImage(rank);
|
BufferedImage clanchatImage = clanManager.getClanImage(rank);
|
||||||
|
|
||||||
if (clanchatImage != null)
|
if (clanchatImage != null)
|
||||||
{
|
{
|
||||||
int width = clanchatImage.getWidth();
|
int width = clanchatImage.getWidth();
|
||||||
@@ -105,6 +107,7 @@ public class PlayerIndicatorsOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocation, name, color);
|
OverlayUtil.renderTextLocation(graphics, textLocation, name, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,9 +125,9 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
int image = -1;
|
int image = -1;
|
||||||
Color color = null;
|
Color color = null;
|
||||||
|
|
||||||
if (config.drawFriendNames() && player.isFriend())
|
if (config.highlightFriends() && player.isFriend())
|
||||||
{
|
{
|
||||||
color = config.getFriendNameColor();
|
color = config.getFriendColor();
|
||||||
}
|
}
|
||||||
else if (config.drawClanMemberNames() && player.isClanMember())
|
else if (config.drawClanMemberNames() && player.isClanMember())
|
||||||
{
|
{
|
||||||
@@ -139,11 +139,11 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
image = clanManager.getIconNumber(rank);
|
image = clanManager.getIconNumber(rank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (config.drawTeamMemberNames() && player.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
else if (config.highlightTeamMembers() && player.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
||||||
{
|
{
|
||||||
color = config.getTeamMemberColor();
|
color = config.getTeamMemberColor();
|
||||||
}
|
}
|
||||||
else if (config.drawNonClanMemberNames() && !player.isClanMember())
|
else if (config.highlightNonClanMembers() && !player.isClanMember())
|
||||||
{
|
{
|
||||||
color = config.getNonClanMemberColor();
|
color = config.getNonClanMemberColor();
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
lastEntry.setTarget("<col=" + Integer.toHexString(color.getRGB() & 0xFFFFFF) + ">" + target);
|
lastEntry.setTarget("<col=" + Integer.toHexString(color.getRGB() & 0xFFFFFF) + ">" + target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image != -1 && config.clanMenuIcons())
|
if (image != -1 && config.showClanRanks())
|
||||||
{
|
{
|
||||||
lastEntry.setTarget("<img=" + image + ">" + lastEntry.getTarget());
|
lastEntry.setTarget("<img=" + image + ">" + lastEntry.getTarget());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ public class PlayerIndicatorsService
|
|||||||
|
|
||||||
public void forEachPlayer(final BiConsumer<Player, Color> consumer)
|
public void forEachPlayer(final BiConsumer<Player, Color> consumer)
|
||||||
{
|
{
|
||||||
if (!config.drawOwnName() && !config.drawClanMemberNames()
|
if (!config.highlightOwnPlayer() && !config.drawClanMemberNames()
|
||||||
&& !config.drawFriendNames() && !config.drawNonClanMemberNames())
|
&& !config.highlightFriends() && !config.highlightNonClanMembers())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -65,24 +65,24 @@ public class PlayerIndicatorsService
|
|||||||
|
|
||||||
if (player == localPlayer)
|
if (player == localPlayer)
|
||||||
{
|
{
|
||||||
if (config.drawOwnName())
|
if (config.highlightOwnPlayer())
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getOwnNameColor());
|
consumer.accept(player, config.getOwnPlayerColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (config.drawFriendNames() && player.isFriend())
|
else if (config.highlightFriends() && player.isFriend())
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getFriendNameColor());
|
consumer.accept(player, config.getFriendColor());
|
||||||
}
|
}
|
||||||
else if (config.drawClanMemberNames() && isClanMember)
|
else if (config.drawClanMemberNames() && isClanMember)
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getClanMemberColor());
|
consumer.accept(player, config.getClanMemberColor());
|
||||||
}
|
}
|
||||||
else if (config.drawTeamMemberNames() && localPlayer.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
else if (config.highlightTeamMembers() && localPlayer.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getTeamMemberColor());
|
consumer.accept(player, config.getTeamMemberColor());
|
||||||
}
|
}
|
||||||
else if (config.drawNonClanMemberNames() && !isClanMember)
|
else if (config.highlightNonClanMembers() && !isClanMember)
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getNonClanMemberColor());
|
consumer.accept(player, config.getNonClanMemberColor());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user