From 5f7a0ea8fc0857723cc7f579eb54e49d06e355f7 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 9 Mar 2017 00:05:26 +0000 Subject: [PATCH] Close tablet when switching form HMD to desktop and vice versa --- scripts/system/hmd.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index c206a76e3f..8174cd960c 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -21,10 +21,12 @@ var desktopMenuItemName = "Desktop"; ['OpenVR (Vive)', 'Oculus Rift'].forEach(function (name) { if (!headset && Menu.menuItemExists(displayMenuName, name)) { headset = name; + } }); -var controllerDisplay = false; + + var controllerDisplay = false; function updateControllerDisplay() { if (HMD.active && Menu.isOptionChecked("Third Person")) { if (!controllerDisplay) { @@ -37,7 +39,9 @@ function updateControllerDisplay() { } } -var button; + + var button; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); // Independent and Entity mode make people sick. Third Person and Mirror have traps that we need to work through. @@ -45,6 +49,7 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode']; function onHmdChanged(isHmd) { + HMD.closeTablet(); if (isHmd) { button.editProperties({ icon: "icons/tablet-icons/switch-desk-i.svg",