mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 12:23:00 +02:00
Update logic for going to tutorial on launch
This commit is contained in:
parent
d2a1957e08
commit
9c7ea6ac7c
1 changed files with 22 additions and 15 deletions
|
@ -1275,29 +1275,22 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
bool hasTutorialContent = contentVersion >= 1;
|
bool hasTutorialContent = contentVersion >= 1;
|
||||||
|
|
||||||
Setting::Handle<bool> firstRun { Settings::firstRun, true };
|
Setting::Handle<bool> firstRun { Settings::firstRun, true };
|
||||||
bool isOnVive = _displayPlugin && _displayPlugin->getName() == "OpenVR (Vive)";
|
bool hasVive = false;
|
||||||
|
for (auto& displayPlugin : PluginManager::getInstance()->getDisplayPlugins()) {
|
||||||
|
if (displayPlugin->getName() == "OpenVR (Vive)") {
|
||||||
|
hasVive = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
Setting::Handle<bool> tutorialComplete { "tutorialComplete", false };
|
Setting::Handle<bool> tutorialComplete { "tutorialComplete", false };
|
||||||
|
|
||||||
bool shouldGoToTutorial = isOnVive && hasTutorialContent && !tutorialComplete.get();
|
bool shouldGoToTutorial = hasVive && hasTutorialContent && !tutorialComplete.get();
|
||||||
qDebug() << "Is on vive " << isOnVive << ", " << _displayPlugin->getName();
|
qDebug() << "has vive: " << hasVive << ", current plugin: " << _displayPlugin->getName();
|
||||||
qDebug() << "has tutorial content" << hasTutorialContent;
|
qDebug() << "has tutorial content" << hasTutorialContent;
|
||||||
qDebug() << "tutorial complete" << tutorialComplete.get();
|
qDebug() << "tutorial complete" << tutorialComplete.get();
|
||||||
qDebug() << "should go to tutorial " << shouldGoToTutorial;
|
qDebug() << "should go to tutorial " << shouldGoToTutorial;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (shouldGoToTutorial) {
|
|
||||||
DependencyManager::get<AddressManager>()->ifLocalSandboxRunningElse([=]() {
|
|
||||||
qDebug() << "Home sandbox appears to be running, going to Home.";
|
|
||||||
//DependencyManager::get<AddressManager>()->goToLocalSandbox("/tutorial");
|
|
||||||
DependencyManager::get<AddressManager>()->loadSettings("hifi://sport/tutorial");
|
|
||||||
}, [=]() {
|
|
||||||
qDebug() << "Home sandbox does not appear to be running, going to Entry.";
|
|
||||||
showHelp();
|
|
||||||
DependencyManager::get<AddressManager>()->goToEntry();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// when --url in command line, teleport to location
|
// when --url in command line, teleport to location
|
||||||
const QString HIFI_URL_COMMAND_LINE_KEY = "--url";
|
const QString HIFI_URL_COMMAND_LINE_KEY = "--url";
|
||||||
int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY);
|
int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY);
|
||||||
|
@ -1306,6 +1299,22 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
addressLookupString = arguments().value(urlIndex + 1);
|
addressLookupString = arguments().value(urlIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldGoToTutorial) {
|
||||||
|
DependencyManager::get<AddressManager>()->ifLocalSandboxRunningElse([=]() {
|
||||||
|
qDebug() << "Home sandbox appears to be running, going to Home.";
|
||||||
|
//DependencyManager::get<AddressManager>()->goToLocalSandbox("/tutorial");
|
||||||
|
DependencyManager::get<AddressManager>()->loadSettings("hifi://sport/tutorial_begin");
|
||||||
|
}, [=]() {
|
||||||
|
qDebug() << "Home sandbox does not appear to be running, going to Entry.";
|
||||||
|
showHelp();
|
||||||
|
if (addressLookupString.isEmpty()) {
|
||||||
|
DependencyManager::get<AddressManager>()->goToEntry();
|
||||||
|
} else {
|
||||||
|
DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
if (firstRun.get()) {
|
if (firstRun.get()) {
|
||||||
showHelp();
|
showHelp();
|
||||||
}
|
}
|
||||||
|
@ -5391,8 +5400,6 @@ void Application::initPlugins(const QStringList& arguments) {
|
||||||
auto preferredDisplays = parser.value(display).split(',', QString::SkipEmptyParts);
|
auto preferredDisplays = parser.value(display).split(',', QString::SkipEmptyParts);
|
||||||
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
||||||
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
||||||
} else {
|
|
||||||
PluginManager::getInstance()->setPreferredDisplayPlugins({ "OpenVR (Vive)", "Oculus Rift" });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parser.isSet(disableDisplays)) {
|
if (parser.isSet(disableDisplays)) {
|
||||||
|
|
Loading…
Reference in a new issue