From 7d84aae6701f786b91b3469791329cb45fe2dec0 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 12 Jan 2017 17:29:38 +0000 Subject: [PATCH] closing tablet when taking snapshot --- interface/src/scripting/HMDScriptingInterface.cpp | 4 ++++ interface/src/scripting/HMDScriptingInterface.h | 2 ++ scripts/system/snapshot.js | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/HMDScriptingInterface.cpp b/interface/src/scripting/HMDScriptingInterface.cpp index 1178e25af3..2bca793d80 100644 --- a/interface/src/scripting/HMDScriptingInterface.cpp +++ b/interface/src/scripting/HMDScriptingInterface.cpp @@ -77,6 +77,10 @@ bool HMDScriptingInterface::shouldShowHandControllers() const { return _showHandControllersCount > 0; } +void HMDScriptingInterface::closeTablet() { + _showTablet = false; +} + QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) { glm::vec3 hudIntersection; auto instance = DependencyManager::get(); diff --git a/interface/src/scripting/HMDScriptingInterface.h b/interface/src/scripting/HMDScriptingInterface.h index e509c72191..9e8e70af25 100644 --- a/interface/src/scripting/HMDScriptingInterface.h +++ b/interface/src/scripting/HMDScriptingInterface.h @@ -72,6 +72,8 @@ public: // rotate the overlay UI sphere so that it is centered about the the current HMD position and orientation Q_INVOKABLE void centerUI(); + Q_INVOKABLE void closeTablet(); + signals: bool shouldShowHandControllersChanged(); diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 06a148be2f..1909061cb1 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -11,6 +11,7 @@ (function() { // BEGIN LOCAL_SCOPE var SNAPSHOT_DELAY = 500; // 500ms +var FINISH_SOUND_DELAY = 350; var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var resetOverlays; var reticleVisible; @@ -119,8 +120,11 @@ function onClicked() { // take snapshot (with no notification) Script.setTimeout(function () { - Window.takeSnapshot(false, true, 1.91); - }, SNAPSHOT_DELAY); + HMD.closeTablet(); + Script.setTimeout(function () { + Window.takeSnapshot(false, true, 1.91); + }, SNAPSHOT_DELAY); + }, FINISH_SOUND_DELAY); } function isDomainOpen(id) {