From a795822919e9d11662ed76b5e16a8daefb726e9e Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 14 Jun 2017 17:12:37 -0700 Subject: [PATCH] Comments and disable camera when switching --- scripts/system/spectatorCamera.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/system/spectatorCamera.js b/scripts/system/spectatorCamera.js index a7f5dbcc79..f8186f26fe 100644 --- a/scripts/system/spectatorCamera.js +++ b/scripts/system/spectatorCamera.js @@ -187,12 +187,6 @@ setDisplay(monitorShowsCameraView); } - function onHMDChanged(isHMDMode) { - // Will also eventually enable disable app, camera, etc. - setDisplay(monitorShowsCameraView); - addOrRemoveButton(false, isHMDMode); - } - // // Function Name: addOrRemoveButton() // @@ -407,6 +401,26 @@ } } + // + // Function Name: onHMDChanged() + // + // Relevant Variables: + // None + // + // Arguments: + // isHMDMode: "true" if HMD is on; "false" otherwise + // + // Description: + // Called from C++ when HMD mode is changed + // + function onHMDChanged(isHMDMode) { + setDisplay(monitorShowsCameraView); + addOrRemoveButton(false, isHMDMode); + if (!isHMDMode && !showSpectatorInDesktop) { + spectatorCameraOff(); + } + } + // // Function Name: shutdown() //