test_class.declarator: client
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private Client client;
test_class.type: Client
test_class.var_name: client
test_class.declarator: chatColorConfig
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private ChatColorConfig chatColorConfig;
test_class.type: ChatColorConfig
test_class.var_name: chatColorConfig
test_class.declarator: chatMessageManager
test_class.modifier: @Inject
  	private
test_class.original_string: @Inject
  	private ChatMessageManager chatMessageManager;
test_class.type: ChatMessageManager
test_class.var_name: chatMessageManager
test_class.file: runelite-client/src/test/java/net/runelite/client/chat/ChatMessageManagerTest.java
test_class.identifier: ChatMessageManagerTest
test_case.body: @Test
  	public void onChatMessage()
  	{
  		when(chatColorConfig.opaquePublicChat()).thenReturn(Color.decode("#b20000"));
  
  		chatMessageManager.loadColors();
  
  		ChatMessage chatMessage = new ChatMessage();
  		chatMessage.setType(ChatMessageType.PUBLICCHAT);
  
  		MessageNode messageNode = mock(MessageNode.class);
  		chatMessage.setMessageNode(messageNode);
  
  		when(messageNode.getValue()).thenReturn("Your dodgy necklace protects you. It has <col=ff0000>1</col> charge left.");
  		chatMessageManager.onChatMessage(chatMessage);
  
  		verify(messageNode).setValue(eq("<col=b20000>Your dodgy necklace protects you. It has <col=ff0000>1<col=b20000> charge left.</col>"));
  	}
test_case.class_method_signature: ChatMessageManagerTest.onChatMessage()
test_case.full_signature: @Test public void onChatMessage()
test_case.identifier: onChatMessage
test_case.invocations: thenReturn when opaquePublicChat decode loadColors setType mock setMessageNode thenReturn when getValue onChatMessage setValue verify eq
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onChatMessage()
focal_class.declarator: TUTORIAL_ISLAND_REGIONS = ImmutableSet.of(12336, 12335, 12592, 12080, 12079, 12436)
focal_class.modifier: private static final
focal_class.original_string: private static final Set<Integer> TUTORIAL_ISLAND_REGIONS = ImmutableSet.of(12336, 12335, 12592, 12080, 12079, 12436);
focal_class.type: Set<Integer>
focal_class.var_name: TUTORIAL_ISLAND_REGIONS
focal_class.declarator: colorCache = HashMultimap.create()
focal_class.modifier: private final
focal_class.original_string: private final Multimap<ChatMessageType, ChatColor> colorCache = HashMultimap.create();
focal_class.type: Multimap<ChatMessageType, ChatColor>
focal_class.var_name: colorCache
focal_class.declarator: client
focal_class.modifier: private final
focal_class.original_string: private final Client client;
focal_class.type: Client
focal_class.var_name: client
focal_class.declarator: chatColorConfig
focal_class.modifier: private final
focal_class.original_string: private final ChatColorConfig chatColorConfig;
focal_class.type: ChatColorConfig
focal_class.var_name: chatColorConfig
focal_class.declarator: clientThread
focal_class.modifier: private final
focal_class.original_string: private final ClientThread clientThread;
focal_class.type: ClientThread
focal_class.var_name: clientThread
focal_class.declarator: transparencyVarbit = -1
focal_class.modifier: private
focal_class.original_string: private int transparencyVarbit = -1;
focal_class.type: int
focal_class.var_name: transparencyVarbit
focal_class.declarator: queuedMessages = new ConcurrentLinkedQueue<>()
focal_class.modifier: private final
focal_class.original_string: private final Queue<QueuedMessage> queuedMessages = new ConcurrentLinkedQueue<>();
focal_class.type: Queue<QueuedMessage>
focal_class.var_name: queuedMessages
focal_class.file: runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java
focal_class.identifier: ChatMessageManager
focal_class.class_method_signature: ChatMessageManager.ChatMessageManager(
  		Client client,
  		ChatColorConfig chatColorConfig,
  		ClientThread clientThread)
focal_class.full_signature: @Inject private  ChatMessageManager(
  		Client client,
  		ChatColorConfig chatColorConfig,
  		ClientThread clientThread)
focal_class.identifier: ChatMessageManager
focal_class.modifiers: @Inject private
focal_class.parameters: (
  		Client client,
  		ChatColorConfig chatColorConfig,
  		ClientThread clientThread)
focal_class.signature:  ChatMessageManager(
  		Client client,
  		ChatColorConfig chatColorConfig,
  		ClientThread clientThread)
focal_class.class_method_signature: ChatMessageManager.onVarbitChanged(VarbitChanged event)
focal_class.full_signature: @Subscribe public void onVarbitChanged(VarbitChanged event)
focal_class.identifier: onVarbitChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (VarbitChanged event)
focal_class.return: void
focal_class.signature: void onVarbitChanged(VarbitChanged event)
focal_class.class_method_signature: ChatMessageManager.onResizeableChanged(ResizeableChanged event)
focal_class.full_signature: @Subscribe public void onResizeableChanged(ResizeableChanged event)
focal_class.identifier: onResizeableChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ResizeableChanged event)
focal_class.return: void
focal_class.signature: void onResizeableChanged(ResizeableChanged event)
focal_class.class_method_signature: ChatMessageManager.onConfigChanged(ConfigChanged event)
focal_class.full_signature: @Subscribe public void onConfigChanged(ConfigChanged event)
focal_class.identifier: onConfigChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ConfigChanged event)
focal_class.return: void
focal_class.signature: void onConfigChanged(ConfigChanged event)
focal_class.class_method_signature: ChatMessageManager.onChatMessage(ChatMessage chatMessage)
focal_class.full_signature: @Subscribe(priority = -1) // run after all plugins public void onChatMessage(ChatMessage chatMessage)
focal_class.identifier: onChatMessage
focal_class.modifiers: @Subscribe(priority = -1) // run after all plugins public
focal_class.parameters: (ChatMessage chatMessage)
focal_class.return: void
focal_class.signature: void onChatMessage(ChatMessage chatMessage)
focal_class.class_method_signature: ChatMessageManager.onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
focal_class.full_signature: @Subscribe public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
focal_class.identifier: onScriptCallbackEvent
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ScriptCallbackEvent scriptCallbackEvent)
focal_class.return: void
focal_class.signature: void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
focal_class.class_method_signature: ChatMessageManager.getDefaultColor(ChatMessageType type, boolean transparent)
focal_class.full_signature: private static Color getDefaultColor(ChatMessageType type, boolean transparent)
focal_class.identifier: getDefaultColor
focal_class.modifiers: private static
focal_class.parameters: (ChatMessageType type, boolean transparent)
focal_class.return: Color
focal_class.signature: Color getDefaultColor(ChatMessageType type, boolean transparent)
focal_class.class_method_signature: ChatMessageManager.loadColors()
focal_class.full_signature: public void loadColors()
focal_class.identifier: loadColors
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadColors()
focal_class.class_method_signature: ChatMessageManager.cacheColor(final ChatColor chatColor, final ChatMessageType... types)
focal_class.full_signature: private void cacheColor(final ChatColor chatColor, final ChatMessageType... types)
focal_class.identifier: cacheColor
focal_class.modifiers: private
focal_class.parameters: (final ChatColor chatColor, final ChatMessageType... types)
focal_class.return: void
focal_class.signature: void cacheColor(final ChatColor chatColor, final ChatMessageType... types)
focal_class.class_method_signature: ChatMessageManager.queue(QueuedMessage message)
focal_class.full_signature: public void queue(QueuedMessage message)
focal_class.identifier: queue
focal_class.modifiers: public
focal_class.parameters: (QueuedMessage message)
focal_class.return: void
focal_class.signature: void queue(QueuedMessage message)
focal_class.class_method_signature: ChatMessageManager.process()
focal_class.full_signature: public void process()
focal_class.identifier: process
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void process()
focal_class.class_method_signature: ChatMessageManager.add(QueuedMessage message)
focal_class.full_signature: private void add(QueuedMessage message)
focal_class.identifier: add
focal_class.modifiers: private
focal_class.parameters: (QueuedMessage message)
focal_class.return: void
focal_class.signature: void add(QueuedMessage message)
focal_class.class_method_signature: ChatMessageManager.update(final MessageNode target)
focal_class.full_signature: public void update(final MessageNode target)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (final MessageNode target)
focal_class.return: void
focal_class.signature: void update(final MessageNode target)
focal_class.class_method_signature: ChatMessageManager.recolorMessage(boolean transparent, String message, ChatMessageType messageType)
focal_class.full_signature: private String recolorMessage(boolean transparent, String message, ChatMessageType messageType)
focal_class.identifier: recolorMessage
focal_class.modifiers: private
focal_class.parameters: (boolean transparent, String message, ChatMessageType messageType)
focal_class.return: String
focal_class.signature: String recolorMessage(boolean transparent, String message, ChatMessageType messageType)
focal_class.class_method_signature: ChatMessageManager.refreshAll()
focal_class.full_signature: private void refreshAll()
focal_class.identifier: refreshAll
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void refreshAll()
focal_method.body: @Subscribe(priority = -1) // run after all plugins
  	public void onChatMessage(ChatMessage chatMessage)
  	{
  		MessageNode messageNode = chatMessage.getMessageNode();
  		ChatMessageType chatMessageType = chatMessage.getType();
  
  		boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
  		Color usernameColor = null;
  		Color senderColor = null;
  
  		switch (chatMessageType)
  		{
  			// username recoloring for MODPRIVATECHAT, PRIVATECHAT and PRIVATECHATOUT
  			// ChatMessageTypes is handled in the script callback event
  			case TRADEREQ:
  			case AUTOTYPER:
  			case PUBLICCHAT:
  			case MODCHAT:
  			{
  				boolean isFriend = client.isFriended(chatMessage.getName(), true) && !client.getLocalPlayer().getName().equals(chatMessage.getName());
  
  				if (isFriend)
  				{
  					usernameColor = isChatboxTransparent ? chatColorConfig.transparentPublicFriendUsernames() : chatColorConfig.opaquePublicFriendUsernames();
  				}
  				if (usernameColor == null)
  				{
  					usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
  				}
  				break;
  			}
  			case FRIENDSCHAT:
  				usernameColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatUsernames() : chatColorConfig.opaqueFriendsChatUsernames();
  				break;
  		}
  
  		senderColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatChannelName() : chatColorConfig.opaqueFriendsChatChannelName();
  
  		if (usernameColor != null)
  		{
  			messageNode.setName(ColorUtil.wrapWithColorTag(messageNode.getName(), usernameColor));
  		}
  
  		String sender = messageNode.getSender();
  		if (senderColor != null && !Strings.isNullOrEmpty(sender))
  		{
  			messageNode.setSender(ColorUtil.wrapWithColorTag(sender, senderColor));
  		}
  
  		final Collection<ChatColor> chatColors = colorCache.get(chatMessageType);
  		for (ChatColor chatColor : chatColors)
  		{
  			if (chatColor.isTransparent() != isChatboxTransparent || chatColor.getType() != ChatColorType.NORMAL || chatColor.isDefault())
  			{
  				continue;
  			}
  
  			// Replace </col> tags in the message with the new color so embedded </col> won't reset the color
  			final Color color = chatColor.getColor();
  			messageNode.setValue(ColorUtil.wrapWithColorTag(
  				messageNode.getValue().replace(ColorUtil.CLOSING_COLOR_TAG, ColorUtil.colorTag(color)),
  				color));
  			break;
  		}
  	}
focal_method.class_method_signature: ChatMessageManager.onChatMessage(ChatMessage chatMessage)
focal_method.full_signature: @Subscribe(priority = -1) // run after all plugins public void onChatMessage(ChatMessage chatMessage)
focal_method.identifier: onChatMessage
focal_method.invocations: getMessageNode getType isResized getVar isFriended getName equals getName getLocalPlayer getName transparentPublicFriendUsernames opaquePublicFriendUsernames transparentUsername opaqueUsername transparentFriendsChatUsernames opaqueFriendsChatUsernames transparentFriendsChatChannelName opaqueFriendsChatChannelName setName wrapWithColorTag getName getSender isNullOrEmpty setSender wrapWithColorTag get isTransparent getType isDefault getColor setValue wrapWithColorTag replace getValue colorTag
focal_method.modifiers: @Subscribe(priority = -1) // run after all plugins public
focal_method.parameters: (ChatMessage chatMessage)
focal_method.return: void
focal_method.signature: void onChatMessage(ChatMessage chatMessage)