Search in sources :

Example 1 with ChatLineBuffer

use of net.runelite.api.ChatLineBuffer in project runelite by runelite.

the class ChatMessageManager method add.

private void add(QueuedMessage message) {
    final Client client = clientProvider.get();
    // this updates chat cycle
    client.addChatMessage(message.getType(), MoreObjects.firstNonNull(message.getName(), ""), MoreObjects.firstNonNull(message.getValue(), message.getRuneLiteFormattedMessage()), message.getSender());
    // Get last message from line buffer (the one we just added)
    final ChatLineBuffer chatLineBuffer = client.getChatLineMap().get(message.getType().getType());
    final MessageNode[] lines = chatLineBuffer.getLines();
    final MessageNode line = lines[0];
    // Update the message with RuneLite additions
    line.setRuneLiteFormatMessage(message.getRuneLiteFormattedMessage());
    update(line);
}
Also used : ChatLineBuffer(net.runelite.api.ChatLineBuffer) MessageNode(net.runelite.api.MessageNode) Client(net.runelite.api.Client)

Aggregations

ChatLineBuffer (net.runelite.api.ChatLineBuffer)1 Client (net.runelite.api.Client)1 MessageNode (net.runelite.api.MessageNode)1