From ecee31960299f71859d621568ccdfa029c778d8a Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Tue, 13 Nov 2018 15:20:46 -0800 Subject: [PATCH] Get logic working correctly. --- interface/resources/html/tabletHelp.html | 2 +- interface/src/Application.cpp | 46 +++++++++++++++++++----- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index 8d4214d5af..dd7931d0ed 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -144,7 +144,7 @@ handControllerImageURL = "img/tablet-help-oculus.jpg"; break; default: - handControllerImageURL = null; + handControllerImageURL = ""; count = 2; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e537d618e9..9430d15794 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3400,21 +3400,51 @@ void Application::showHelp() { static const QString TAB_GAMEPAD = "gamepad"; static const QString TAB_HAND_CONTROLLERS = "handControllers"; - QString handControllerName = ""; + QString handControllerName; QString defaultTab = TAB_KEYBOARD_MOUSE; - if (PluginUtils::isViveControllerAvailable()) { - defaultTab = TAB_HAND_CONTROLLERS; - handControllerName = HAND_CONTROLLER_NAME_VIVE; - } else if (PluginUtils::isOculusTouchControllerAvailable()) { - defaultTab = TAB_HAND_CONTROLLERS; - handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; - } else if (qApp->getActiveDisplayPlugin()->getName() == "WindowMS") { + qDebug() << "Printing names..."; + for (auto& inputPlugin : PluginManager::getInstance()->getInputPlugins()) { + qDebug() << inputPlugin->getName(); + auto subdeviceNames = inputPlugin->getSubdeviceNames(); + for (auto& subdeviceName : subdeviceNames) { + qDebug() << " -|" << subdeviceName; + } + } + + qDebug() << "----------------------"; + + auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); + for (auto& displayPlugin : displayPlugins) { + qDebug() << displayPlugin->getName(); + } + + if (PluginUtils::isHMDAvailable("WindowsMR")) { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; + //} else if (PluginUtils::isViveControllerAvailable()) { + } else if (PluginUtils::isHMDAvailable("HTC Vive")) { + defaultTab = TAB_HAND_CONTROLLERS; + handControllerName = HAND_CONTROLLER_NAME_VIVE; + } else if (PluginUtils::isHMDAvailable("Oculus Rift")) { + defaultTab = TAB_HAND_CONTROLLERS; + handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; } else if (PluginUtils::isXboxControllerAvailable()) { defaultTab = TAB_GAMEPAD; } + //if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "WindowsMR") == 0) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; + ////} else if (PluginUtils::isViveControllerAvailable()) { + //} else if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "HTC Vive") == 0) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_VIVE; + //} else if (PluginUtils::isOculusTouchControllerAvailable()) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; + //} else if (PluginUtils::isXboxControllerAvailable()) { + // defaultTab = TAB_GAMEPAD; + //} // TODO need some way to detect windowsMR to load controls reference default tab in Help > Controls Reference menu. QUrlQuery queryString;