From 6cf9608c97e2ffc143fb630d1e3a974d1060f58a Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 18 Oct 2018 13:12:04 -0700 Subject: [PATCH] adding fade in and fade outt in interstitial for progress --- scripts/system/interstitialPage.js | 9 +++++++-- scripts/system/progress.js | 13 ++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 995f936345..4f73d8e598 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -381,8 +381,8 @@ function updateOverlays(physicsEnabled) { - if (isInterstitialOverlaysVisible !== !physicsEnabled) { - // visible changed + if (isInterstitialOverlaysVisible !== !physicsEnabled && !physicsEnabled === true) { + // visible changed to true. isInterstitialOverlaysVisible = !physicsEnabled; } @@ -432,6 +432,11 @@ if (physicsEnabled) { Camera.mode = previousCameraMode; } + + if (isInterstitialOverlaysVisible !== !physicsEnabled && !physicsEnabled === false) { + // visible changed to false. + isInterstitialOverlaysVisible = !physicsEnabled; + } } function scaleInterstitialPage(sensorToWorldScale) { diff --git a/scripts/system/progress.js b/scripts/system/progress.js index 02af74af49..b373612790 100644 --- a/scripts/system/progress.js +++ b/scripts/system/progress.js @@ -267,7 +267,7 @@ // Update state if (!visible) { // Not visible because no recent downloads - if ((displayProgress < 100 || gpuTextures > 0) && !(isInInterstitialMode || isInterstitialOverlaysVisible)) { // Have started downloading so fade in + if ((displayProgress < 100 || gpuTextures > 0) && !isInInterstitialMode && !isInterstitialOverlaysVisible) { // Have started downloading so fade in visible = true; alphaDelta = ALPHA_DELTA_IN; fadeTimer = Script.setInterval(fade, FADE_INTERVAL); @@ -307,10 +307,13 @@ } else { x = x * BAR_HMD_REPEAT; } + if (isInInterstitialMode || isInterstitialOverlaysVisible) { + visible = false; + } // Update progress bar Overlays.editOverlay(barDesktop.overlay, { - visible: !isHMD, + visible: !isHMD && visible, bounds: { x: barDesktop.repeat - x, y: windowHeight - barDesktop.height, @@ -320,7 +323,7 @@ }); Overlays.editOverlay(barHMD.overlay, { - visible: isHMD, + visible: isHMD && visible, bounds: { x: BAR_HMD_REPEAT - x, y: windowHeight - BAR_HMD_HEIGHT, @@ -330,11 +333,11 @@ }); Overlays.editOverlay(textDesktop.overlay, { - visible: !isHMD + visible: !isHMD && visible }); Overlays.editOverlay(textHMD.overlay, { - visible: isHMD + visible: isHMD && visible }); // Update 2D overlays to maintain positions at bottom middle of window