From 6a6bf6a5e0dee65f33906686c54e229dc41eb720 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 16 Jul 2020 08:50:10 +1200 Subject: [PATCH 01/11] Delay taking snapshot further at low render rates --- scripts/system/snapshot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index a37fb13bd9..3c361b1644 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -474,9 +474,10 @@ function takeSnapshot() { volume: 1.0 }); HMD.closeTablet(); + var DOUBLE_RENDER_TIME_TO_MS = 2000; // If rendering is bogged down, allow double the render time to close the tablet. Script.setTimeout(function () { Window.takeSnapshot(false, includeAnimated, 1.91); - }, SNAPSHOT_DELAY); + }, Math.max(SNAPSHOT_DELAY, DOUBLE_RENDER_TIME_TO_MS / Rates.render )); }, FINISH_SOUND_DELAY); UserActivityLogger.logAction("snaphshot_taken", { location: location.href }); } From cbce911e8382c122a9fc079d417e279adc3e315f Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Fri, 17 Jul 2020 14:40:40 -0700 Subject: [PATCH 02/11] fix lag on restart with scaled avatar --- interface/src/avatar/MyCharacterController.cpp | 8 ++++---- interface/src/avatar/OtherAvatar.cpp | 4 ++-- libraries/physics/src/CharacterController.cpp | 8 ++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/interface/src/avatar/MyCharacterController.cpp b/interface/src/avatar/MyCharacterController.cpp index 3a25721528..997dcfe685 100755 --- a/interface/src/avatar/MyCharacterController.cpp +++ b/interface/src/avatar/MyCharacterController.cpp @@ -407,13 +407,13 @@ void MyCharacterController::clearDetailedMotionStates() { } void MyCharacterController::buildPhysicsTransaction(PhysicsEngine::Transaction& transaction) { - for (size_t i = 0; i < _detailedMotionStates.size(); i++) { - _detailedMotionStates[i]->forceActive(); + for (auto& detailedMotionState : _detailedMotionStates) { + detailedMotionState->forceActive(); } if (_pendingFlags & PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION) { _pendingFlags &= ~PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION; - for (size_t i = 0; i < _detailedMotionStates.size(); i++) { - transaction.objectsToRemove.push_back(_detailedMotionStates[i]); + for (auto& detailedMotionState : _detailedMotionStates) { + transaction.objectsToRemove.push_back(detailedMotionState); } // NOTE: the DetailedMotionStates are deleted after being added to PhysicsEngine::Transaction::_objectsToRemove // See AvatarManager::handleProcessedPhysicsTransaction() diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index aa6c074d08..ae453d5b00 100755 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -116,10 +116,10 @@ void OtherAvatar::updateSpaceProxy(workload::Transaction& transaction) const { int OtherAvatar::parseDataFromBuffer(const QByteArray& buffer) { int32_t bytesRead = Avatar::parseDataFromBuffer(buffer); - for (size_t i = 0; i < _detailedMotionStates.size(); i++) { + for (auto& detailedMotionState : _detailedMotionStates) { // NOTE: we activate _detailedMotionStates is because they are KINEMATIC // and Bullet will automagically call DetailedMotionState::getWorldTransform() when active. - _detailedMotionStates[i]->forceActive(); + detailedMotionState->forceActive(); } if (_moving && _motionState) { _motionState->addDirtyFlags(Simulation::DIRTY_POSITION); diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index a796ea28a0..e222692aea 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -543,12 +543,8 @@ void CharacterController::setLocalBoundingBox(const glm::vec3& minCorner, const _minStepHeight = DEFAULT_MIN_STEP_HEIGHT_FACTOR * (_halfHeight + _radius); _maxStepHeight = DEFAULT_MAX_STEP_HEIGHT_FACTOR * (_halfHeight + _radius); - if (_physicsEngine) { - // must REMOVE from world prior to shape update - _pendingFlags |= PENDING_FLAG_REMOVE_FROM_SIMULATION | PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION; - } - _pendingFlags |= PENDING_FLAG_UPDATE_SHAPE; - _pendingFlags |= PENDING_FLAG_ADD_TO_SIMULATION | PENDING_FLAG_ADD_DETAILED_TO_SIMULATION; + _pendingFlags |= PENDING_FLAG_UPDATE_SHAPE | PENDING_FLAG_REMOVE_FROM_SIMULATION | PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION | + PENDING_FLAG_ADD_TO_SIMULATION | PENDING_FLAG_ADD_DETAILED_TO_SIMULATION; } // it's ok to change offset immediately -- there are no thread safety issues here From 1c8f783be6b783f3b720aed279ade109a121346d Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Wed, 22 Jul 2020 14:38:33 -0700 Subject: [PATCH 03/11] try to fix renderWithZones from JSON --- libraries/entities/src/EntityTree.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 049a4b6229..e6f5e36202 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -2793,6 +2793,17 @@ bool EntityTree::sendEntitiesOperation(const OctreeElementPointer& element, void } } + QVector oldRenderWithZones = properties.getRenderWithZones(); + if (!oldRenderWithZones.isEmpty()) { + QVector newRenderWithZones; + for (QUuid oldRenderWithZoneID : oldRenderWithZones) { + if (args->ourTree->findEntityByEntityItemID(oldRenderWithZoneID)) { + newRenderWithZones.append(getMapped(oldRenderWithZoneID)); + } + } + properties.setRenderWithZones(newRenderWithZones); + } + properties.setXNNeighborID(getMapped(properties.getXNNeighborID())); properties.setXPNeighborID(getMapped(properties.getXPNeighborID())); properties.setYNNeighborID(getMapped(properties.getYNNeighborID())); From c6af3d23c9787d09757e2e92daacd52fb9765075 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 26 Jul 2020 19:41:30 +1200 Subject: [PATCH 04/11] Fix --url command line parameter to work with both "=" and " " --- interface/src/Application.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b7b2fea67d..a5cb1c2936 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3939,12 +3939,15 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; - // when --url in command line, teleport to location - const QString HIFI_URL_COMMAND_LINE_KEY = "--url"; - int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY); QString addressLookupString; - if (urlIndex != -1) { - QUrl url(arguments().value(urlIndex + 1)); + + // when --url in command line, teleport to location + QCommandLineParser parser; + QCommandLineOption urlOption("url", "", "value"); + parser.addOption(urlOption); + parser.parse(arguments()); + if (parser.isSet(urlOption)) { + QUrl url = QUrl(parser.value(urlOption)); if (url.scheme() == URL_SCHEME_HIFIAPP) { Setting::Handle("startUpApp").set(url.path()); } else { From 382e47471eb0088f9698fbdee984d6e638f30027 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 29 Jul 2020 22:06:24 -0400 Subject: [PATCH 05/11] Fix date display for logs. --- scripts/communityScripts/chat/FloofChat.html | 3 ++- scripts/communityScripts/chat/FloofChat.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index 7baac63455..b493b05090 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -389,7 +389,8 @@ function time() { var d = new Date(); - var month = (d.getMonth()).toString(); + // Months are returned in range 0-11 instead of 1-12, so we have to add 1. + var month = (d.getMonth() + 1).toString(); var day = (d.getDate()).toString(); var h = (d.getHours()).toString(); var m = (d.getMinutes()).toString(); diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 6200540532..1ad58ce766 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -516,7 +516,8 @@ function messageReceived(channel, message) { function time() { var d = new Date(); - var month = (d.getMonth()).toString(); + // Months are returned in range 0-11 instead of 1-12, so we have to add 1. + var month = (d.getMonth() + 1).toString(); var day = (d.getDate()).toString(); var h = (d.getHours()).toString(); var m = (d.getMinutes()).toString(); From c933f21a7738b935dc668916b0727de9cfdc413f Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 29 Jul 2020 22:06:43 -0400 Subject: [PATCH 06/11] Add ability to click on message to display chat window. --- .../notificationCore/notificationCore.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/communityScripts/notificationCore/notificationCore.js b/scripts/communityScripts/notificationCore/notificationCore.js index da88ff7c5d..f25d91bd6b 100644 --- a/scripts/communityScripts/notificationCore/notificationCore.js +++ b/scripts/communityScripts/notificationCore/notificationCore.js @@ -1,3 +1,17 @@ +// +// notificationCore.js +// +// Created by Fluffy Jenkins January 2020. +// Copyright 2020 Fluffy Jenkins +// Copyright 2020 Vircadia contributors. +// +// For any future coders, please keep me in the loop when making changes. +// Please tag me in any Pull Requests. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + "use strict"; var notificationList = []; @@ -6,6 +20,7 @@ var sizeData = {30: {widthMul: 1.8, heightMul: 2.05, split: 35, size: 30}}; var DEFAULT_SIZE = 30; var DEFAULT_OFFSET = 10; var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif"; +var MAIN_CHAT_APP_CHANNEL = "Chat"; var offset = DEFAULT_OFFSET; @@ -161,4 +176,19 @@ function notif(text, colour) { notificationList.push(noti); } +Controller.mousePressEvent.connect(function (event) { + // Overlays.getOverlayAtPoint applies only to 2D overlays. + var overlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y }); + if (overlay) { + for (var i = 0; i < notificationList.length; i++) { + if (overlay == notificationList[i].id) { + Overlays.deleteOverlay(notificationList[i].id) + Messages.sendMessage(MAIN_CHAT_APP_CHANNEL, JSON.stringify({ + type: "ShowChatWindow", + })); + } + } + } +}); + Script.scriptEnding.connect(cleanUp); \ No newline at end of file From a64b391a7bd9833949f22e9b1da6f3c703d92726 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 29 Jul 2020 22:07:02 -0400 Subject: [PATCH 07/11] Add user enter and leave domain notification to chat. --- scripts/communityScripts/chat/FloofChat.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 1ad58ce766..45ee61eaaf 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -6,6 +6,7 @@ // // Created by Fluffy Jenkins January 2020. // Copyright 2020 Fluffy Jenkins +// Copyright 2020 Vircadia contributors. // // For any future coders, please keep me in the loop when making changes. // Please tag me in any Pull Requests. @@ -98,6 +99,8 @@ function init() { chatBar.sendToQml(JSON.stringify({visible: false, history: chatBarHistory})); Controller.keyPressEvent.connect(keyPressEvent); Messages.messageReceived.connect(messageReceived); + AvatarManager.avatarAddedEvent.connect(avatarJoinsDomain); + AvatarManager.avatarRemovedEvent.connect(avatarLeavesDomain); connectWebSocket(); } @@ -510,6 +513,9 @@ function messageReceived(channel, message) { })); } } + if (cmd.type === "ShowChatWindow") { + toggleMainChatWindow(); + } } } } @@ -619,6 +625,28 @@ function setVisible(_visible) { visible = _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} + })); +} + +function avatarLeavesDomain(sessionID) { + var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has left." + 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} + })); +} + function keyPressEvent(event) { if (event.key === H_KEY && !event.isAutoRepeat && event.isControl) { toggleMainChatWindow() @@ -637,11 +665,25 @@ function shutdown() { } catch (e) { // empty } + + try { + AvatarManager.avatarAddedEvent.disconnect(avatarJoinsDomain); + } catch (e) { + // empty + } + + try { + AvatarManager.avatarRemovedEvent.disconnect(avatarLeavesDomain); + } catch (e) { + // empty + } + try { Controller.keyPressEvent.disconnect(keyPressEvent); } catch (e) { // empty } + chatBar.close(); chatHistory.close(); } From 22085e2166fc85d59e417d32ded78e6dadeb3c73 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Wed, 29 Jul 2020 22:16:07 -0400 Subject: [PATCH 08/11] 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)", From bec293b8c7fad4b835f92f0bda8a37fa0154618e Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 31 Jul 2020 17:22:15 -0400 Subject: [PATCH 09/11] Fix display name being incorrect. --- scripts/communityScripts/chat/FloofChat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 7ae8fd73dc..224b6eb7a8 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -627,7 +627,7 @@ function setVisible(_visible) { function avatarJoinsDomain(sessionID) { Script.setTimeout(function () { - var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has joined." + var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has joined." var messageColor = {red: 122, green: 122, blue: 122}; playNotificationSound(); addToLog(messageText, "Notice", messageColor, "Domain"); @@ -640,7 +640,7 @@ function avatarJoinsDomain(sessionID) { } function avatarLeavesDomain(sessionID) { - var messageText = AvatarManager.getPalData(sessionID).data[0].sessionDisplayName + " has left." + var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has left." var messageColor = {red: 122, green: 122, blue: 122}; playNotificationSound(); addToLog(messageText, "Notice", messageColor, "Domain"); From b64c44f5eec83fff0601ef7c027177193cb83dc6 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 31 Jul 2020 17:30:50 -0400 Subject: [PATCH 10/11] Make notices respect domain mute settings. --- scripts/communityScripts/chat/FloofChat.js | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 224b6eb7a8..00a55c48a2 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -629,26 +629,40 @@ function avatarJoinsDomain(sessionID) { 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} - })); + + if (!mutedAudio["Domain"]) { + playNotificationSound(); + } + + if (!muted["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)", - text: messageText, - colour: {text: messageColor} - })); + + if (!mutedAudio["Domain"]) { + playNotificationSound(); + } + + if (!muted["Domain"]) { + Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ + sender: "(D)", + text: messageText, + colour: {text: messageColor} + })); + } } function keyPressEvent(event) { From cc43112bf320a6e3a8f17bdbe131672d4323b458 Mon Sep 17 00:00:00 2001 From: kasenvr <52365539+kasenvr@users.noreply.github.com> Date: Sat, 1 Aug 2020 13:46:02 -0400 Subject: [PATCH 11/11] Apply suggestions from code review Co-authored-by: David Rowe --- scripts/communityScripts/chat/FloofChat.js | 8 ++++---- .../communityScripts/notificationCore/notificationCore.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index 00a55c48a2..d1324bd560 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -628,7 +628,7 @@ function setVisible(_visible) { function avatarJoinsDomain(sessionID) { Script.setTimeout(function () { var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has joined." - var messageColor = {red: 122, green: 122, blue: 122}; + var messageColor = { red: 122, green: 122, blue: 122 }; addToLog(messageText, "Notice", messageColor, "Domain"); @@ -640,7 +640,7 @@ function avatarJoinsDomain(sessionID) { Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ sender: "(D)", text: messageText, - colour: {text: messageColor} + colour: { text: messageColor } })); } }, 500); // Wait 500ms for the avatar to load to properly get info about them. @@ -648,7 +648,7 @@ function avatarJoinsDomain(sessionID) { function avatarLeavesDomain(sessionID) { var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has left." - var messageColor = {red: 122, green: 122, blue: 122}; + var messageColor = { red: 122, green: 122, blue: 122 }; addToLog(messageText, "Notice", messageColor, "Domain"); @@ -660,7 +660,7 @@ function avatarLeavesDomain(sessionID) { Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({ sender: "(D)", text: messageText, - colour: {text: messageColor} + colour: { text: messageColor } })); } } diff --git a/scripts/communityScripts/notificationCore/notificationCore.js b/scripts/communityScripts/notificationCore/notificationCore.js index f25d91bd6b..7920a575ec 100644 --- a/scripts/communityScripts/notificationCore/notificationCore.js +++ b/scripts/communityScripts/notificationCore/notificationCore.js @@ -181,7 +181,7 @@ Controller.mousePressEvent.connect(function (event) { var overlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y }); if (overlay) { for (var i = 0; i < notificationList.length; i++) { - if (overlay == notificationList[i].id) { + if (overlay === notificationList[i].id) { Overlays.deleteOverlay(notificationList[i].id) Messages.sendMessage(MAIN_CHAT_APP_CHANNEL, JSON.stringify({ type: "ShowChatWindow", @@ -191,4 +191,4 @@ Controller.mousePressEvent.connect(function (event) { } }); -Script.scriptEnding.connect(cleanUp); \ No newline at end of file +Script.scriptEnding.connect(cleanUp);