From 22085e2166fc85d59e417d32ded78e6dadeb3c73 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 29 Jul 2020 22:16:07 -0400 Subject: [PATCH] Add notification sound + delay to get name upon joining. --- scripts/communityScripts/chat/FloofChat.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 45ee61eaaf..7ae8fd73dc 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -626,19 +626,23 @@ function setVisible(_visible) { } function avatarJoinsDomain(sessionID) { - var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has joined." - var messageColor = {red: 122, green: 122, blue: 122}; - addToLog(messageText, "Notice", messageColor, "Domain"); - Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ - sender: "(D)", - text: messageText, - colour: {text: messageColor} - })); + Script.setTimeout(function () { + var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has joined." + var messageColor = {red: 122, green: 122, blue: 122}; + playNotificationSound(); + addToLog(messageText, "Notice", messageColor, "Domain"); + Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ + sender: "(D)", + text: messageText, + colour: {text: messageColor} + })); + }, 500); // Wait 500ms for the avatar to load to properly get info about them. } function avatarLeavesDomain(sessionID) { var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has left." var messageColor = {red: 122, green: 122, blue: 122}; + playNotificationSound(); addToLog(messageText, "Notice", messageColor, "Domain"); Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ sender: "(D)",