From a9fd034f09ca9e8b8f024d188549f92cd9326f53 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 7 Aug 2018 16:02:54 -0700 Subject: [PATCH] switching to location api --- interface/src/Application.cpp | 4 ++-- scripts/system/interstitialPage.js | 26 ++++++++++++-------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a594756a80..39c24d7562 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1640,7 +1640,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo audioClient->setMuted(!audioClient->isMuted()); } else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) { cycleCamera(); - } else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { + } else if (action == controller::toInt(controller::Action::CONTEXT_MENU) && !isInterstitialMode()) { toggleTabletUI(); } else if (action == controller::toInt(controller::Action::RETICLE_X)) { auto oldPos = getApplicationCompositor().getReticlePosition(); @@ -7806,7 +7806,7 @@ float Application::getRenderResolutionScale() const { } void Application::notifyPacketVersionMismatch() { - if (!_notifiedPacketVersionMismatchThisDomain) { + if (!_notifiedPacketVersionMismatchThisDomain && !isInterstitialMode()) { _notifiedPacketVersionMismatchThisDomain = true; QString message = "The location you are visiting is running an incompatible server version.\n"; diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 6960272e11..b18d88d796 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -186,7 +186,6 @@ function startInterstitialPage() { if (timer === null) { - print("--------> start page <--------"); updateOverlays(Window.isPhysicsEnabled()); target = 0; currentProgress = 0.1; @@ -195,8 +194,9 @@ } function domainChanged(domain) { + print("domain changed: " + domain); if (domain !== currentDomain) { - print("----------> domain changed <-------------->"); + MyAvatar.restoreAnimation(); var name = AddressManager.placename; domainName = name.charAt(0).toUpperCase() + name.slice(1); var domainNameLeftMargin = getLeftMargin(domainNameTextID, domainName); @@ -205,13 +205,11 @@ leftMargin: domainNameLeftMargin }; - var BY = "by "; - var text = BY - var hostLeftMargin = getLeftMargin(domainHostname, text); + /*var hostLeftMargin = getLeftMargin(domainHostname, text); var hostnameProperties = { text: BY, leftMargin: hostLeftMargin - }; + };*/ var randomIndex = Math.floor(Math.random() * userTips.length); var tip = userTips[randomIndex]; @@ -222,7 +220,7 @@ }; Overlays.editOverlay(domainNameTextID, textProperties); - Overlays.editOverlay(domainHostname, hostnameProperties); + // Overlays.editOverlay(domainHostname, hostnameProperties); Overlays.editOverlay(domainToolTip, toolTipProperties); @@ -234,12 +232,9 @@ var THE_PLACE = "hifi://TheSpot"; function clickedOnOverlay(overlayID, event) { print(overlayID + " other: " + loadingToTheSpotID); - print(event.button === "Primary"); if (loadingToTheSpotID === overlayID) { - if (timerset) { - timeElapsed = 0; - } - AddressManager.handleLookupString(THE_PLACE); + print("-------> heading to theb spot <--------"); + location.handleLookupString(THE_PLACE); } } @@ -254,7 +249,7 @@ visible: !physicsEnabled }; - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); + // Menu.setIsOptionChecked("Show Overlays", physicsEnabled); renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = physicsEnabled; renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled; @@ -314,7 +309,10 @@ } Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); - Window.domainChanged.connect(domainChanged); + location.hostChanged.connect(domainChanged); + location.lookupResultsFinished.connect(function() { + print("connected: " + location.isConnected()); + }); function cleanup() { Overlays.deleteOverlay(loadingSphereID);