mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +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.
|
||||
auto pluginManager = PluginManager::getInstance();
|
||||
auto plugins = pluginManager->getPreferredDisplayPlugins();
|
||||
for (auto plugin : plugins) {
|
||||
auto menu = Menu::getInstance();
|
||||
if (auto action = menu->getActionForOption(plugin->getName())) {
|
||||
action->setChecked(true);
|
||||
action->trigger();
|
||||
// Find and activated highest priority plugin, bail for the rest
|
||||
break;
|
||||
auto menu = Menu::getInstance();
|
||||
if (plugins.size() > 0) {
|
||||
for (auto plugin : plugins) {
|
||||
if (auto action = menu->getActionForOption(plugin->getName())) {
|
||||
action->setChecked(true);
|
||||
action->trigger();
|
||||
// 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