mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 20:58:30 +02:00
Update help window to auto select xbox or vive controller tab on availability of device
This commit is contained in:
parent
16d91833e8
commit
3147ea9e33
2 changed files with 28 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body onload="load()">
|
||||
<div id="image_area">
|
||||
<img id="main_image" src="img/controls-help-keyboard.png" width="1024px" height="720px"></img>
|
||||
<a href="#" id="kbm_button" onmousedown="showKbm()"></a>
|
||||
<a href="#" id="hand_controllers_button" onmousedown="showHandControllers()"></a>
|
||||
<a href="#" id="game_controller_button" onmousedown="showGameController()"></a>
|
||||
<a href="#" id="hand_controllers_button" onmousedown="showViveControllers()"></a>
|
||||
<a href="#" id="game_controller_button" onmousedown="showXboxController()"></a>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue