Showing the changes to interface/src/Application.cpp (1 of 21 files). Show all
Unified · Split
| @@ -2413,15 +2413,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 2412 unmodified lines | ||
| 2413 | 2413 | |
| 2414 | 2414 | // Check HMD use (may be technically available without being in use) |
| 2415 | 2415 | bool hasHMD = PluginUtils::isHMDAvailable(); |
| 2416 | − bool isUsingHMD = hasHMD && hasHandControllers && _displayPlugin->isHmd(); | |
| 2416 | + bool isUsingHMD = _displayPlugin->isHmd(); | |
| 2417 | + bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD; | |
| 2417 | 2418 | |
| 2418 | 2419 | Setting::Handle<bool> tutorialComplete{ "tutorialComplete", false }; |
| 2419 | 2420 | Setting::Handle<bool> firstRun{ Settings::firstRun, true }; |
| 2420 | 2421 | |
| 2421 | 2422 | bool isTutorialComplete = tutorialComplete.get(); |
| 2422 | − bool shouldGoToTutorial = isUsingHMD && hasTutorialContent && !isTutorialComplete; | |
| 2423 | + bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete; | |
| 2423 | 2424 | |
| 2424 | − qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMD; | |
| 2425 | + qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; | |
| 2425 | 2426 | qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent << |
| 2426 | 2427 | ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial; |
| 2427 | 2428 | |
| @@ -2435,10 +2436,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 7 unmodified lines | ||
| 2435 | 2436 | |
| 2436 | 2437 | const QString TUTORIAL_PATH = "/tutorial_begin"; |
| 2437 | 2438 | |
| 2439 | + static const QString SENT_TO_TUTORIAL = "tutorial"; | |
| 2440 | + static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location"; | |
| 2441 | + static const QString SENT_TO_ENTRY = "entry"; | |
| 2442 | + static const QString SENT_TO_SANDBOX = "sandbox"; | |
| 2443 | + | |
| 2444 | + QString sentTo; | |
| 2445 | + | |
| 2438 | 2446 | if (shouldGoToTutorial) { |
| 2439 | 2447 | if (sandboxIsRunning) { |
| 2440 | 2448 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2441 | 2449 | DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH); |
| 2450 | + sentTo = SENT_TO_TUTORIAL; | |
| 2442 | 2451 | } else { |
| 2443 | 2452 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2444 | 2453 | if (firstRun.get()) { |
| @@ -2446,8 +2455,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 1 unmodified line | ||
| 2446 | 2455 | } |
| 2447 | 2456 | if (addressLookupString.isEmpty()) { |
| 2448 | 2457 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2458 | + sentTo = SENT_TO_ENTRY; | |
| 2449 | 2459 | } else { |
| 2450 | 2460 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2461 | + sentTo = SENT_TO_PREVIOUS_LOCATION; | |
| 2451 | 2462 | } |
| 2452 | 2463 | } |
| 2453 | 2464 | } else { |
| @@ -2460,23 +2471,40 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 6 unmodified lines | ||
| 2460 | 2471 | |
| 2461 | 2472 | // If this is a first run we short-circuit the address passed in |
| 2462 | 2473 | if (isFirstRun) { |
| 2463 | − if (isUsingHMD) { | |
| 2474 | + if (isUsingHMDAndHandControllers) { | |
| 2464 | 2475 | if (sandboxIsRunning) { |
| 2465 | 2476 | qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; |
| 2466 | 2477 | DependencyManager::get<AddressManager>()->goToLocalSandbox(); |
| 2478 | + sentTo = SENT_TO_SANDBOX; | |
| 2467 | 2479 | } else { |
| 2468 | 2480 | qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; |
| 2469 | 2481 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2482 | + sentTo = SENT_TO_ENTRY; | |
| 2470 | 2483 | } |
| 2471 | 2484 | } else { |
| 2472 | 2485 | DependencyManager::get<AddressManager>()->goToEntry(); |
| 2486 | + sentTo = SENT_TO_ENTRY; | |
| 2473 | 2487 | } |
| 2474 | 2488 | } else { |
| 2475 | 2489 | qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); |
| 2476 | 2490 | DependencyManager::get<AddressManager>()->loadSettings(addressLookupString); |
| 2491 | + sentTo = SENT_TO_PREVIOUS_LOCATION; | |
| 2477 | 2492 | } |
| 2478 | 2493 | } |
| 2479 | 2494 | |
| 2495 | + UserActivityLogger::getInstance().logAction("startup_sent_to", { | |
| 2496 | + { "sent_to", sentTo }, | |
| 2497 | + { "sandbox_is_running", sandboxIsRunning }, | |
| 2498 | + { "has_hmd", hasHMD }, | |
| 2499 | + { "has_hand_controllers", hasHandControllers }, | |
| 2500 | + { "is_using_hmd", isUsingHMD }, | |
| 2501 | + { "is_using_hmd_and_hand_controllers", isUsingHMDAndHandControllers }, | |
| 2502 | + { "content_version", contentVersion }, | |
| 2503 | + { "is_tutorial_complete", isTutorialComplete }, | |
| 2504 | + { "has_tutorial_content", hasTutorialContent }, | |
| 2505 | + { "should_go_to_tutorial", shouldGoToTutorial } | |
| 2506 | + }); | |
| 2507 | + | |
| 2480 | 2508 | _connectionMonitor.init(); |
| 2481 | 2509 | |
| 2482 | 2510 | // After all of the constructor is completed, then set firstRun to false. |