From 6cee0b93e60a731a2c081e34b530983a501d99a0 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sat, 28 Sep 2024 03:10:02 +0200 Subject: [PATCH] Set char. limit of 90 to chat bubble --- src/components/gui/Chat.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/gui/Chat.vue b/src/components/gui/Chat.vue index 5747a35..dd95407 100644 --- a/src/components/gui/Chat.vue +++ b/src/components/gui/Chat.vue @@ -90,8 +90,10 @@ gameStore.connection?.on('chat:message', (data: ChatMessage) => { return metrics.width } - chatBubble.width = calculateTextWidth(data.message, 'Arial', 13) + 15 - chatText.setText(data.message) + chatBubble.width = calculateTextWidth(data.message.substring(0, 90), 'Arial', 13) + 15 + + // setText but with max. char limit of 90 + chatText.setText(data.message.substring(0, 90)) charChatContainer.setVisible(true)