Merge pull request #3677 from bmiddle/dev

[Chat Color] Add ability to change public chat friend name color in config
This commit is contained in:
Adam
2018-06-10 19:14:36 -04:00
committed by GitHub
2 changed files with 28 additions and 2 deletions

View File

@@ -123,9 +123,19 @@ public class ChatMessageManager
case AUTOCHAT:
case PUBLIC:
case PUBLIC_MOD:
usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
break;
{
boolean isFriend = client.isFriended(setMessage.getName(), true) && !client.getLocalPlayer().getName().equals(setMessage.getName());
if (isFriend)
{
usernameColor = isChatboxTransparent ? chatColorConfig.transparentPublicFriendUsernames() : chatColorConfig.opaquePublicFriendUsernames();
}
if (usernameColor == null)
{
usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
}
break;
}
case CLANCHAT:
usernameColor = isChatboxTransparent ? chatColorConfig.transparentClanUsernames() : chatColorConfig.opaqueClanUsernames();
break;

View File

@@ -262,6 +262,14 @@ public interface ChatColorConfig extends Config
)
Color opaqueClanUsernames();
@ConfigItem(
position = 57,
keyName = "opaquePublicFriendUsernames",
name = "Public friend usernames",
description = "Color of Friend Usernames in Public Chat"
)
Color opaquePublicFriendUsernames();
@ConfigItem(
position = 61,
keyName = "transparentPublicChat",
@@ -490,4 +498,12 @@ public interface ChatColorConfig extends Config
description = "Color of Usernames in Clan Chat (transparent)"
)
Color transparentClanUsernames();
@ConfigItem(
position = 87,
keyName = "transparentPublicFriendUsernames",
name = "Public friend usernames (transparent)",
description = "Color of Friend Usernames in Public Chat (transparent)"
)
Color transparentPublicFriendUsernames();
}