switching to location api

This commit is contained in:
Dante Ruiz 2018-08-07 16:02:54 -07:00
parent 6a4a56cee3
commit a9fd034f09
2 changed files with 14 additions and 16 deletions

View file

@ -1640,7 +1640,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
audioClient->setMuted(!audioClient->isMuted()); audioClient->setMuted(!audioClient->isMuted());
} else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) { } else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) {
cycleCamera(); cycleCamera();
} else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { } else if (action == controller::toInt(controller::Action::CONTEXT_MENU) && !isInterstitialMode()) {
toggleTabletUI(); toggleTabletUI();
} else if (action == controller::toInt(controller::Action::RETICLE_X)) { } else if (action == controller::toInt(controller::Action::RETICLE_X)) {
auto oldPos = getApplicationCompositor().getReticlePosition(); auto oldPos = getApplicationCompositor().getReticlePosition();
@ -7806,7 +7806,7 @@ float Application::getRenderResolutionScale() const {
} }
void Application::notifyPacketVersionMismatch() { void Application::notifyPacketVersionMismatch() {
if (!_notifiedPacketVersionMismatchThisDomain) { if (!_notifiedPacketVersionMismatchThisDomain && !isInterstitialMode()) {
_notifiedPacketVersionMismatchThisDomain = true; _notifiedPacketVersionMismatchThisDomain = true;
QString message = "The location you are visiting is running an incompatible server version.\n"; QString message = "The location you are visiting is running an incompatible server version.\n";

View file

@ -186,7 +186,6 @@
function startInterstitialPage() { function startInterstitialPage() {
if (timer === null) { if (timer === null) {
print("--------> start page <--------");
updateOverlays(Window.isPhysicsEnabled()); updateOverlays(Window.isPhysicsEnabled());
target = 0; target = 0;
currentProgress = 0.1; currentProgress = 0.1;
@ -195,8 +194,9 @@
} }
function domainChanged(domain) { function domainChanged(domain) {
print("domain changed: " + domain);
if (domain !== currentDomain) { if (domain !== currentDomain) {
print("----------> domain changed <-------------->"); MyAvatar.restoreAnimation();
var name = AddressManager.placename; var name = AddressManager.placename;
domainName = name.charAt(0).toUpperCase() + name.slice(1); domainName = name.charAt(0).toUpperCase() + name.slice(1);
var domainNameLeftMargin = getLeftMargin(domainNameTextID, domainName); var domainNameLeftMargin = getLeftMargin(domainNameTextID, domainName);
@ -205,13 +205,11 @@
leftMargin: domainNameLeftMargin leftMargin: domainNameLeftMargin
}; };
var BY = "by "; /*var hostLeftMargin = getLeftMargin(domainHostname, text);
var text = BY
var hostLeftMargin = getLeftMargin(domainHostname, text);
var hostnameProperties = { var hostnameProperties = {
text: BY, text: BY,
leftMargin: hostLeftMargin leftMargin: hostLeftMargin
}; };*/
var randomIndex = Math.floor(Math.random() * userTips.length); var randomIndex = Math.floor(Math.random() * userTips.length);
var tip = userTips[randomIndex]; var tip = userTips[randomIndex];
@ -222,7 +220,7 @@
}; };
Overlays.editOverlay(domainNameTextID, textProperties); Overlays.editOverlay(domainNameTextID, textProperties);
Overlays.editOverlay(domainHostname, hostnameProperties); // Overlays.editOverlay(domainHostname, hostnameProperties);
Overlays.editOverlay(domainToolTip, toolTipProperties); Overlays.editOverlay(domainToolTip, toolTipProperties);
@ -234,12 +232,9 @@
var THE_PLACE = "hifi://TheSpot"; var THE_PLACE = "hifi://TheSpot";
function clickedOnOverlay(overlayID, event) { function clickedOnOverlay(overlayID, event) {
print(overlayID + " other: " + loadingToTheSpotID); print(overlayID + " other: " + loadingToTheSpotID);
print(event.button === "Primary");
if (loadingToTheSpotID === overlayID) { if (loadingToTheSpotID === overlayID) {
if (timerset) { print("-------> heading to theb spot <--------");
timeElapsed = 0; location.handleLookupString(THE_PLACE);
}
AddressManager.handleLookupString(THE_PLACE);
} }
} }
@ -254,7 +249,7 @@
visible: !physicsEnabled visible: !physicsEnabled
}; };
Menu.setIsOptionChecked("Show Overlays", physicsEnabled); // Menu.setIsOptionChecked("Show Overlays", physicsEnabled);
renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = physicsEnabled; renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = physicsEnabled;
renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled; renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled;
@ -314,7 +309,10 @@
} }
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
Window.domainChanged.connect(domainChanged); location.hostChanged.connect(domainChanged);
location.lookupResultsFinished.connect(function() {
print("connected: " + location.isConnected());
});
function cleanup() { function cleanup() {
Overlays.deleteOverlay(loadingSphereID); Overlays.deleteOverlay(loadingSphereID);