From 59fe5ffdc12acb2d2f7fee14c16344ca5f0f9ce1 Mon Sep 17 00:00:00 2001 From: Liv Date: Fri, 25 Aug 2017 17:48:35 -0700 Subject: [PATCH 1/4] Initial attempt at changing first run behavior --- interface/src/Application.cpp | 50 +++-------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index affbf83081..20d7509ea5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2755,26 +2755,18 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { handControllerType = Oculus; } - // Check tutorial content versioning - bool hasTutorialContent = contentVersion >= MIN_CONTENT_VERSION.at(handControllerType); - // Check HMD use (may be technically available without being in use) bool hasHMD = PluginUtils::isHMDAvailable(); bool isUsingHMD = _displayPlugin->isHmd(); bool isUsingHMDAndHandControllers = hasHMD && hasHandControllers && isUsingHMD; - Setting::Handle tutorialComplete{ "tutorialComplete", false }; Setting::Handle firstRun{ Settings::firstRun, true }; const QString HIFI_SKIP_TUTORIAL_COMMAND_LINE_KEY = "--skipTutorial"; // Skips tutorial/help behavior, and does NOT clear firstRun setting. bool skipTutorial = arguments().contains(HIFI_SKIP_TUTORIAL_COMMAND_LINE_KEY); - bool isTutorialComplete = tutorialComplete.get(); - bool shouldGoToTutorial = isUsingHMDAndHandControllers && hasTutorialContent && !isTutorialComplete && !skipTutorial; qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; - qCDebug(interfaceapp) << "Tutorial version:" << contentVersion << ", sufficient:" << hasTutorialContent << - ", complete:" << isTutorialComplete << ", should go:" << shouldGoToTutorial; // when --url in command line, teleport to location const QString HIFI_URL_COMMAND_LINE_KEY = "--url"; @@ -2784,39 +2776,15 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { addressLookupString = arguments().value(urlIndex + 1); } - const QString TUTORIAL_PATH = "/tutorial_begin"; - - static const QString SENT_TO_TUTORIAL = "tutorial"; static const QString SENT_TO_PREVIOUS_LOCATION = "previous_location"; static const QString SENT_TO_ENTRY = "entry"; static const QString SENT_TO_SANDBOX = "sandbox"; QString sentTo; - if (shouldGoToTutorial) { - if (sandboxIsRunning) { - qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; - DependencyManager::get()->goToLocalSandbox(TUTORIAL_PATH); - sentTo = SENT_TO_TUTORIAL; - } else { - qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; - if (firstRun.get()) { - showHelp(); - } - if (addressLookupString.isEmpty()) { - DependencyManager::get()->goToEntry(); - sentTo = SENT_TO_ENTRY; - } else { - DependencyManager::get()->loadSettings(addressLookupString); - sentTo = SENT_TO_PREVIOUS_LOCATION; - } - } - } else { - // If this is a first run we short-circuit the address passed in - if (firstRun.get() && !skipTutorial) { + if (firstRun.get()) { showHelp(); - if (isUsingHMDAndHandControllers) { if (sandboxIsRunning) { qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; DependencyManager::get()->goToLocalSandbox(); @@ -2826,16 +2794,12 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { DependencyManager::get()->goToEntry(); sentTo = SENT_TO_ENTRY; } - } else { - DependencyManager::get()->goToEntry(); - sentTo = SENT_TO_ENTRY; - } + } else { qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); DependencyManager::get()->loadSettings(addressLookupString); sentTo = SENT_TO_PREVIOUS_LOCATION; } - } UserActivityLogger::getInstance().logAction("startup_sent_to", { { "sent_to", sentTo }, @@ -2844,18 +2808,10 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { { "has_hand_controllers", hasHandControllers }, { "is_using_hmd", isUsingHMD }, { "is_using_hmd_and_hand_controllers", isUsingHMDAndHandControllers }, - { "content_version", contentVersion }, - { "is_tutorial_complete", isTutorialComplete }, - { "has_tutorial_content", hasTutorialContent }, - { "should_go_to_tutorial", shouldGoToTutorial } + { "content_version", contentVersion } }); _connectionMonitor.init(); - - // After all of the constructor is completed, then set firstRun to false. - if (!skipTutorial) { - firstRun.set(false); - } } bool Application::importJSONFromURL(const QString& urlString) { From 59deccaeb5db0479b44c5f83e1687dc2b809bb7e Mon Sep 17 00:00:00 2001 From: Liv Date: Tue, 29 Aug 2017 14:55:59 -0700 Subject: [PATCH 2/4] Remove unused skipTutorial code --- interface/src/Application.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 20d7509ea5..db28516cb0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2762,10 +2762,6 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { Setting::Handle firstRun{ Settings::firstRun, true }; - const QString HIFI_SKIP_TUTORIAL_COMMAND_LINE_KEY = "--skipTutorial"; - // Skips tutorial/help behavior, and does NOT clear firstRun setting. - bool skipTutorial = arguments().contains(HIFI_SKIP_TUTORIAL_COMMAND_LINE_KEY); - qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; // when --url in command line, teleport to location From 2f2b406047cf34aef208bf2a0e07b6a4e840eaa6 Mon Sep 17 00:00:00 2001 From: Liv Date: Wed, 30 Aug 2017 09:23:33 -0700 Subject: [PATCH 3/4] Remove unneeded handcontrollertype code from handle first run checks --- interface/src/Application.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index db28516cb0..233aa4fe81 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2746,13 +2746,8 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { // Get controller availability bool hasHandControllers = false; - HandControllerType handControllerType = Vive; - if (PluginUtils::isViveControllerAvailable()) { + if (PluginUtils::isViveControllerAvailable() || PluginUtils::isOculusTouchControllerAvailable()) { hasHandControllers = true; - handControllerType = Vive; - } else if (PluginUtils::isOculusTouchControllerAvailable()) { - hasHandControllers = true; - handControllerType = Oculus; } // Check HMD use (may be technically available without being in use) From 930243539cd01d1f6d3c210fdca95a309793c7a4 Mon Sep 17 00:00:00 2001 From: Liv Date: Tue, 5 Sep 2017 17:50:25 -0700 Subject: [PATCH 4/4] add back first run to false and fix formatting --- interface/src/Application.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 233aa4fe81..79fb2a9061 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2776,15 +2776,16 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { // If this is a first run we short-circuit the address passed in if (firstRun.get()) { showHelp(); - if (sandboxIsRunning) { - qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; - DependencyManager::get()->goToLocalSandbox(); - sentTo = SENT_TO_SANDBOX; - } else { - qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; - DependencyManager::get()->goToEntry(); - sentTo = SENT_TO_ENTRY; - } + if (sandboxIsRunning) { + qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; + DependencyManager::get()->goToLocalSandbox(); + sentTo = SENT_TO_SANDBOX; + } else { + qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; + DependencyManager::get()->goToEntry(); + sentTo = SENT_TO_ENTRY; + } + firstRun.set(false); } else { qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString);