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);
}
Aggregations