Skip to content

Commit 049ac87

Browse files
authored
Update ChatBubble.ts
1 parent 037cf52 commit 049ac87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/src/components/world/PhaserObjects/ChatBubble.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { ChatMessage } from "../../../classes/TextConversation"
33
const CHAT_BUBBLE_DURATION = 5000;
44
const TEXT_SCROLL_DELAY = 50;
55
const MAX_MESSAGE_LENGTH = 20;
6+
const BUBBLE_BACKGROUND_COLORS = {
7+
Universal: '#89CFF0',
8+
Proximity: '#F8C8DC',
9+
Direct: '#85e085',
10+
};
611

712
/**
813
* Object for creating chat bubbles on a phaser scene
@@ -24,6 +29,7 @@ export default class ChatBubble {
2429
* @param value the new chat message that the chat bubble should render
2530
*/
2631
public setMessage(value: ChatMessage) {
32+
this.bubbleText.setBackgroundColor(BUBBLE_BACKGROUND_COLORS[value.chatType]);
2733
if (this.timer) {
2834
clearTimeout(this.timer)
2935
}

0 commit comments

Comments
 (0)