diff --git a/scripts/modules/appUi.js b/scripts/modules/appUi.js index dab377911b..f9b4c1a85d 100644 --- a/scripts/modules/appUi.js +++ b/scripts/modules/appUi.js @@ -137,8 +137,8 @@ function AppUi(properties) { that.isOpen = false; } } - console.debug(that.buttonName + " app reports: Tablet screen changed.\nNew screen type: " + type + - "\nNew screen URL: " + url + "\nCurrent app open status: " + that.isOpen + "\n"); + // console.debug(that.buttonName + " app reports: Tablet screen changed.\nNew screen type: " + type + + // "\nNew screen URL: " + url + "\nCurrent app open status: " + that.isOpen + "\n"); }; // Overwrite with the given properties: diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index c8a7dc3e83..49708c44fe 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -178,7 +178,7 @@ localOrientation: Quat.fromVec3Degrees({ x: 0.0, y: 180.0, z: 0.0 }), parentID: anchorOverlay }); - + var TARGET_UPDATE_HZ = 60; // 50hz good enough, but we're using update var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; var lastInterval = Date.now(); @@ -399,17 +399,6 @@ Overlays.editOverlay(loadingBarProgress, properties); - - var hardRefusalErrorsIdx = hardRefusalErrors.indexOf(Window.getLastDomainConnectionError()); - - var redirectProperties = { - visible: (hardRefusalErrorsIdx >= 0) - }; - - Overlays.editOverlay(redirectOopsText, redirectProperties); - Overlays.editOverlay(tryAgainImage, redirectProperties); - Overlays.editOverlay(backImage, redirectProperties); - if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio(); @@ -468,9 +457,6 @@ Overlays.deleteOverlay(loadingBarPlacard); Overlays.deleteOverlay(loadingBarProgress); Overlays.deleteOverlay(anchorOverlay); - Overlays.deleteOverlay(redirectOopsText); - Overlays.deleteOverlay(tryAgainImage); - Overlays.deleteOverlay(backImage); if (DEBUG) { tablet.removeButton(button); diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index b0caba7c52..5d37078a26 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -33,7 +33,7 @@ text: getOopsText(), textAlpha: 1, backgroundAlpha: 0, - lineHeight: 0.13, + lineHeight: 0.10, visible: false, emissive: true, ignoreRayIntersection: false, @@ -43,11 +43,10 @@ parentID: MyAvatar.SELF_ID, parentJointIndex: MyAvatar.getJointIndex("Head") }); - print("redirect oops text = " + redirectOopsText); var tryAgainImage = Overlays.addOverlay("image3d", { name: "tryAgainImage", - localPosition: { x: -0.15, y: -0.4, z: 0.0}, + localPosition: {x: -0.15, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", alpha: 1, visible: false, @@ -58,12 +57,10 @@ orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, parentID: redirectOopsText }); - print("try again image = " + tryAgainImage); - Window.copyToClipboard(redirectOopsText); var backImage = Overlays.addOverlay("image3d", { name: "backImage", - localPosition: { x: 1.0, y: -0.4, z: 0.0}, + localPosition: {x: 1.0, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_back.png", alpha: 1, visible: false, @@ -74,7 +71,6 @@ orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, parentID: redirectOopsText }); - print("back image = " + backImage); var TARGET_UPDATE_HZ = 60; var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; @@ -84,7 +80,7 @@ error = Window.getLastDomainConnectionError(); var errorMessageMapIndex = hardRefusalErrors.indexOf(error); var oopsText = ""; - if (error === -1) { + if (error === -1 || !Window.isPhysicsEnabled() || location.isConnected) { overlaysVisible = false; } else if (errorMessageMapIndex >= 0) { overlaysVisible = true; @@ -96,6 +92,7 @@ var properties = { visible: overlaysVisible }; + var oopsTextProperties = { visible: overlaysVisible, text: oopsText @@ -121,6 +118,7 @@ } function cleanup() { + Script.clearInterval(timer); timer = null; Overlays.deleteOverlay(redirectOopsText); Overlays.deleteOverlay(tryAgainImage); @@ -142,8 +140,8 @@ } }); - // timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS); - Script.update.connect(toggleOverlays); + timer = Script.setInterval(toggleOverlays, 500); + // Script.update.connect(toggleOverlays); Script.scriptEnding.connect(cleanup); }());