From 3147ea9e33c557d48881b849c1ad70a38956f5f3 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 1 Nov 2016 13:43:55 -0700 Subject: [PATCH] Update help window to auto select xbox or vive controller tab on availability of device --- interface/resources/html/help.html | 22 +++++++++++++++++----- interface/src/Application.cpp | 12 +++++++++++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/interface/resources/html/help.html b/interface/resources/html/help.html index 6cc4dab6af..422f5c6b46 100644 --- a/interface/resources/html/help.html +++ b/interface/resources/html/help.html @@ -50,21 +50,33 @@ function showKbm() { document.getElementById("main_image").setAttribute("src", "img/controls-help-keyboard.png"); } - function showHandControllers() { + function showViveControllers() { document.getElementById("main_image").setAttribute("src", "img/controls-help-vive.png"); } - function showGameController() { + function showXboxController() { document.getElementById("main_image").setAttribute("src", "img/controls-help-gamepad.png"); } + function load() { + console.log("In help.html: ", window.location.href); + parts = window.location.href.split("?"); + if (parts.length > 0) { + var defaultTab = parts[1]; + if (defaultTab == "xbox") { + showXboxController(); + } else if (defaultTab == "vive") { + showViveControllers(); + } + } + } - +
- - + +
diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5fe15fa8e5..a18081c664 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2155,7 +2155,17 @@ void Application::aboutApp() { } void Application::showHelp() { - InfoView::show(INFO_HELP_PATH); + static const QString QUERY_STRING_XBOX = "xbox"; + static const QString QUERY_STRING_VIVE = "vive"; + + QString queryString = ""; + if (PluginUtils::isViveControllerAvailable()) { + queryString = QUERY_STRING_VIVE; + } else if (PluginUtils::isXboxControllerAvailable()) { + queryString = QUERY_STRING_XBOX; + } + + InfoView::show(INFO_HELP_PATH, false, queryString); } void Application::resizeEvent(QResizeEvent* event) {