History

Update tutorial to work with HMD + Hand Controllers only

Ryan Huffman committed 10 years ago

Commit 216cf2b1 parent 66a33d015 files · +116 −33Browse files

Showing the changes to interface/src/Application.cpp (1 of 15 files). Show all

Unified · Split

interface/src/Application.cpp+8−10
@@ -87,6 +87,7 @@ · 86 unmodified lines
8787 #include <PhysicsEngine.h>
8888 #include <PhysicsHelpers.h>
8989 #include <plugins/PluginManager.h>
90+#include <plugins/PluginUtils.h>
9091 #include <plugins/CodecPlugin.h>
9192 #include <RecordingScriptingInterface.h>
9293 #include <RenderableWebEntityItem.h>
@@ -1276,17 +1277,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 1183 unmodified lines
12761277 bool hasTutorialContent = contentVersion >= 1;
12771278
12781279 Setting::Handle<bool> firstRun { Settings::firstRun, true };
1279− bool hasVive = false;
1280− for (auto& displayPlugin : PluginManager::getInstance()->getDisplayPlugins()) {
1281− if (displayPlugin->getName() == "OpenVR (Vive)") {
1282− hasVive = true;
1283− break;
1284− }
1285− }
1280+ bool hasHMDAndHandControllers = PluginUtils::isHMDAvailable() && PluginUtils::isHandControllerAvailable();
12861281 Setting::Handle<bool> tutorialComplete { "tutorialComplete", false };
12871282
1288− bool shouldGoToTutorial = hasVive && hasTutorialContent && !tutorialComplete.get();
1289− qDebug() << "has vive: " << hasVive << ", current plugin: " << _displayPlugin->getName();
1283+ bool shouldGoToTutorial = hasHMDAndHandControllers && hasTutorialContent && !tutorialComplete.get();
1284+
1285+ qDebug() << "Has HMD + Hand Controllers: " << hasHMDAndHandControllers << ", current plugin: " << _displayPlugin->getName();
12901286 qDebug() << "has tutorial content" << hasTutorialContent;
12911287 qDebug() << "tutorial complete" << tutorialComplete.get();
12921288 qDebug() << "should go to tutorial " << shouldGoToTutorial;
@@ -1300,10 +1296,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 7 unmodified lines
13001296 addressLookupString = arguments().value(urlIndex + 1);
13011297 }
13021298
1299+ const QString TUTORIAL_PATH = "/tutorial_begin";
1300+
13031301 if (shouldGoToTutorial) {
13041302 DependencyManager::get<AddressManager>()->ifLocalSandboxRunningElse([=]() {
13051303 qDebug() << "Home sandbox appears to be running, going to Home.";
1306− DependencyManager::get<AddressManager>()->goToLocalSandbox("/tutorial_begin");
1304+ DependencyManager::get<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH);
13071305 }, [=]() {
13081306 qDebug() << "Home sandbox does not appear to be running, going to Entry.";
13091307 if (firstRun.get()) {