From 2f9119529a67209d0adcfda189ddd6859d52a80f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 6 Sep 2018 17:06:17 -0700 Subject: [PATCH] editing the interstitial page --- interface/src/Application.cpp | 7 ++----- interface/src/Menu.cpp | 1 - scripts/defaultScripts.js | 3 ++- scripts/system/interstitialPage.js | 30 ++++++++++++++++-------------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 73e2fce956..15416b26cb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3488,14 +3488,11 @@ bool Application::isServerlessMode() const { } bool Application::isInterstitialMode() const { - bool interstitialModeEnabled = Menu::getInstance()->isOptionChecked("Enable Interstitial"); - return interstitialModeEnabled ? _interstitialMode : false; + return _interstitialMode; } void Application::setIsInterstitialMode(bool interstitialMode) { - auto menu = Menu::getInstance(); - bool interstitialModeEnabled = menu->isOptionChecked("Enable Interstitial"); - if (_interstitialMode != interstitialMode && interstitialModeEnabled) { + if (_interstitialMode != interstitialMode) { _interstitialMode = interstitialMode; emit interstitialModeChanged(_interstitialMode); } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 15898a73b1..a6ba983ab5 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -787,7 +787,6 @@ Menu::Menu() { // Developer > Show Overlays addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Overlays, 0, true); - addCheckableActionToQMenuAndActionHash(developerMenu, "Enable Interstitial", 0, false); #if 0 /// -------------- REMOVED FOR NOW -------------- addDisabledActionAndSeparator(navigateMenu, "History"); diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index c333a0c8c2..31510831c8 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -34,7 +34,8 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/emote.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ - "system/controllers/controllerScripts.js" + "system/controllers/controllerScripts.js", + "system/interstitialPage.js" //"system/chat.js" ]; diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index c95845656c..aa84fed476 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -14,8 +14,9 @@ (function() { Script.include("/~/system/libraries/Xform.js"); - var DEBUG = false; - var MAX_X_SIZE = 3.8; + var DEBUG = true; + var MIN_LOADING_PROGRESS = 3.6; + var TOTAL_LOADING_PROGRESS = 3.8; var EPSILON = 0.01; var isVisible = false; var VOLUME = 0.4; @@ -55,7 +56,7 @@ "Tip: Log in to make friends, visit new domains, and save avatars!" ]; - var DEFAULT_DIMENSIONS = { x: 20, y: 20, z: 20 }; + var DEFAULT_DIMENSIONS = { x: 24, y: 24, z: 24 }; var loadingSphereID = Overlays.addOverlay("model", { name: "Loading-Sphere", @@ -87,10 +88,10 @@ var domainName = ""; var domainNameTextID = Overlays.addOverlay("text3d", { name: "Loading-Destination-Card-Text", - localPosition: { x: 0.0, y: 0.8, z: 0.0 }, + localPosition: { x: 0.0, y: 0.8, z: -0.001 }, text: domainName, textAlpha: 1, - backgroundAlpha: 0, + backgroundAlpha: 1, lineHeight: 0.42, visible: isVisible, ignoreRayIntersection: true, @@ -106,9 +107,10 @@ localPosition: { x: 0.0, y: 0.32, z: 0.0 }, text: domainText, textAlpha: 1, - backgroundAlpha: 0, + backgroundAlpha: 1, lineHeight: 0.13, visible: isVisible, + backgroundAlpha: 0, ignoreRayIntersection: true, drawInFront: true, grabbable: false, @@ -123,7 +125,7 @@ localPosition: { x: 0.0 , y: -1.6, z: 0.0 }, text: toolTip, textAlpha: 1, - backgroundAlpha: 0, + backgroundAlpha: 1, lineHeight: 0.13, visible: isVisible, ignoreRayIntersection: true, @@ -248,7 +250,6 @@ } function domainChanged(domain) { - print("domain changed: " + domain); if (domain !== currentDomain) { MyAvatar.restoreAnimation(); var name = location.placename; @@ -272,7 +273,6 @@ if (data.status === "success") { var domainInfo = data.data; var domainDescriptionText = domainInfo.place.description; - print("domainText: " + domainDescriptionText); var leftMargin = getLeftMargin(domainDescription, domainDescriptionText); var domainDescriptionProperties = { text: domainDescriptionText, @@ -381,18 +381,18 @@ var domainLoadingProgressPercentage = Window.domainLoadingProgress(); - var progress = MAX_X_SIZE * domainLoadingProgressPercentage; + var progress = MIN_LOADING_PROGRESS * domainLoadingProgressPercentage; if (progress >= target) { target = progress; } - if ((physicsEnabled && (currentProgress < MAX_X_SIZE))) { - target = MAX_X_SIZE; + if ((physicsEnabled && (currentProgress < TOTAL_LOADING_PROGRESS))) { + target = TOTAL_LOADING_PROGRESS; } currentProgress = lerp(currentProgress, target, 0.2); var properties = { - localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / MAX_X_SIZE))), y: -0.935, z: 0.0 }, + localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / TOTAL_LOADING_PROGRESS))), y: -0.935, z: 0.0 }, dimensions: { x: currentProgress, y: 2.8 @@ -400,9 +400,10 @@ }; Overlays.editOverlay(loadingBarProgress, properties); - if ((physicsEnabled && (currentProgress >= (MAX_X_SIZE - EPSILON)))) { + if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio(); + currentDomain = "no domain"; timer = null; return; } @@ -452,6 +453,7 @@ renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = true; renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = true; renderViewTask.getConfig("LightingModel")["enablePointLight"] = true; + Menu.setIsOptionChecked("Show Overlays", physicsEnabled); if (!HMD.active) { toolbar.writeProperty("visible", true); }