From b5bf7dc12f661169d6ac55b47ef5d5004869a550 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 10 Apr 2017 16:47:35 +1200 Subject: [PATCH] Tidying --- scripts/system/playRecordingAC.js | 3 +-- scripts/system/record.js | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/system/playRecordingAC.js b/scripts/system/playRecordingAC.js index e68d1f435a..cc23188a62 100644 --- a/scripts/system/playRecordingAC.js +++ b/scripts/system/playRecordingAC.js @@ -129,7 +129,6 @@ index += 1; properties = Entities.getEntityProperties(entityIDs[index], ["name", "userData"]); if (properties.name === ENTITY_NAME) { - // TODO: Guard against userData being non-existent or corrupt. userData = JSON.parse(properties.userData); isFound = (Date.now() - userData.timestamp) > ((CLAIM_CHECKS + 1) * TIMESTAMP_UPDATE_INTERVAL); } @@ -188,7 +187,7 @@ var isPlayingRecording = false, recordingFilename = "", autoPlayTimer = null, - AUTOPLAY_SEARCH_INTERVAL = 2000; // TODO: Final value. + AUTOPLAY_SEARCH_INTERVAL = 5000; // TODO: Final value. function playRecording(recording, position, orientation) { Agent.isAvatar = true; diff --git a/scripts/system/record.js b/scripts/system/record.js index 793315fa55..809a43b915 100644 --- a/scripts/system/record.js +++ b/scripts/system/record.js @@ -43,6 +43,11 @@ } + function isUsingToolbar() { + return ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar")) + || (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar"))); + } + CountdownTimer = (function () { // Displays countdown overlay. @@ -387,11 +392,6 @@ }; }()); - function usingToolbar() { - return ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar")) - || (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar"))); - } - function onTabletScreenChanged(type, url) { // Open/close dialog in tablet or window. @@ -400,7 +400,7 @@ if (type === "Home" && url === HOME_URL) { // Start countdown if using toolbar and recording is enabled. - if (usingToolbar() && isRecordingEnabled && Recorder.isIdle()) { + if (isUsingToolbar() && isRecordingEnabled && Recorder.isIdle()) { Recorder.startCountdown(); } isDialogDisplayed = false; @@ -446,7 +446,7 @@ tablet.emitScriptEvent(JSON.stringify({ type: EVENT_BRIDGE_TYPE, action: USING_TOOLBAR_ACTION, - value: usingToolbar() + value: isUsingToolbar() })); } else if (message.action === ENABLE_RECORDING_ACTION) { // User update "enable recording" checkbox.