mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Add check to go into HMD on first run if available
This commit is contained in:
parent
26e0d02d60
commit
3ad9c1a797
1 changed files with 25 additions and 7 deletions
|
@ -3362,13 +3362,31 @@ void Application::loadSettings() {
|
||||||
// If there is a preferred plugin, we probably messed it up with the menu settings, so fix it.
|
// If there is a preferred plugin, we probably messed it up with the menu settings, so fix it.
|
||||||
auto pluginManager = PluginManager::getInstance();
|
auto pluginManager = PluginManager::getInstance();
|
||||||
auto plugins = pluginManager->getPreferredDisplayPlugins();
|
auto plugins = pluginManager->getPreferredDisplayPlugins();
|
||||||
for (auto plugin : plugins) {
|
auto menu = Menu::getInstance();
|
||||||
auto menu = Menu::getInstance();
|
if (plugins.size() > 0) {
|
||||||
if (auto action = menu->getActionForOption(plugin->getName())) {
|
for (auto plugin : plugins) {
|
||||||
action->setChecked(true);
|
if (auto action = menu->getActionForOption(plugin->getName())) {
|
||||||
action->trigger();
|
action->setChecked(true);
|
||||||
// Find and activated highest priority plugin, bail for the rest
|
action->trigger();
|
||||||
break;
|
// Find and activated highest priority plugin, bail for the rest
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If this is our first run, and no preferred devices were set, default to
|
||||||
|
// an HMD device if available.
|
||||||
|
Setting::Handle<bool> firstRun { Settings::firstRun, true };
|
||||||
|
if (firstRun.get()) {
|
||||||
|
auto displayPlugins = pluginManager->getDisplayPlugins();
|
||||||
|
for (auto& plugin : displayPlugins) {
|
||||||
|
if (plugin->isHmd()) {
|
||||||
|
if (auto action = menu->getActionForOption(plugin->getName())) {
|
||||||
|
action->setChecked(true);
|
||||||
|
action->trigger();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue