mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:30:39 +02:00
Merge pull request #13298 from danteruiz/fix-vive-configuration-page
Controller Confguration Page fixes
This commit is contained in:
commit
7057e00583
3 changed files with 1111 additions and 1082 deletions
|
@ -171,6 +171,10 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
function textAt(index) {
|
||||
return comboBox.textAt(index);
|
||||
}
|
||||
|
||||
HifiControls.Label {
|
||||
id: comboBoxLabel
|
||||
text: root.label
|
||||
|
|
|
@ -69,10 +69,15 @@ Item {
|
|||
id: stack
|
||||
initialItem: inputConfiguration
|
||||
property alias messageVisible: imageMessageBox.visible
|
||||
property alias selectedPlugin: box.currentText
|
||||
Rectangle {
|
||||
id: inputConfiguration
|
||||
anchors.fill: parent
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
height: 230
|
||||
|
||||
HifiConstants { id: hifi }
|
||||
|
||||
|
@ -168,7 +173,7 @@ Item {
|
|||
text: "show all input devices"
|
||||
|
||||
onClicked: {
|
||||
inputPlugins();
|
||||
box.model = inputPlugins();
|
||||
changeSource();
|
||||
}
|
||||
}
|
||||
|
@ -208,25 +213,28 @@ Item {
|
|||
anchors.leftMargin: 10
|
||||
anchors.topMargin: 30
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: loaderRectangle
|
||||
z: -1
|
||||
color: hifi.colors.baseGray
|
||||
width: parent.width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: inputConfiguration.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
Loader {
|
||||
id: loader
|
||||
asynchronous: false
|
||||
|
||||
width: inputConfiguration.width
|
||||
anchors.left: inputConfiguration.left
|
||||
anchors.right: inputConfiguration.right
|
||||
anchors.top: configurationHeader.bottom
|
||||
anchors.topMargin: 10
|
||||
anchors.bottom: inputConfiguration.bottom
|
||||
|
||||
source: InputConfiguration.configurationLayout(box.currentText);
|
||||
anchors.fill: parent
|
||||
source: InputConfiguration.configurationLayout(box.textAt(box.currentIndex));
|
||||
onLoaded: {
|
||||
if (loader.item.hasOwnProperty("pluginName")) {
|
||||
if (box.currentText === "HTC Vive") {
|
||||
if (box.textAt(box.currentIndex) === "HTC Vive") {
|
||||
loader.item.pluginName = "OpenVR";
|
||||
} else {
|
||||
loader.item.pluginName = box.currentText;
|
||||
loader.item.pluginName = box.textAt(box.currentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,11 +260,12 @@ Item {
|
|||
|
||||
function changeSource() {
|
||||
loader.source = "";
|
||||
var selectedDevice = box.textAt(box.currentIndex);
|
||||
var source = "";
|
||||
if (box.currentText == "Vive") {
|
||||
if (selectedDevice == "HTC Vive") {
|
||||
source = InputConfiguration.configurationLayout("OpenVR");
|
||||
} else {
|
||||
source = InputConfiguration.configurationLayout(box.currentText);
|
||||
source = InputConfiguration.configurationLayout(selectedDevice);
|
||||
}
|
||||
|
||||
loader.source = source;
|
||||
|
|
|
@ -15,13 +15,29 @@ import "../../controls-uit" as HifiControls
|
|||
import "."
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: openVrConfiguration
|
||||
|
||||
Flickable {
|
||||
id: flick
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors.fill: parent
|
||||
contentHeight: 550
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
property string pluginName: ""
|
||||
property var page: null;
|
||||
|
||||
onPluginNameChanged: {
|
||||
if (page !== null) {
|
||||
page.pluginName = flick.pluginName;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
page = config.createObject(flick.contentItem);
|
||||
}
|
||||
Component {
|
||||
id: config
|
||||
Rectangle {
|
||||
id: openVrConfiguration
|
||||
property int leftMargin: 75
|
||||
property int countDown: 0
|
||||
property string pluginName: ""
|
||||
|
@ -73,8 +89,7 @@ Rectangle {
|
|||
size: 12
|
||||
|
||||
color: "white"
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.left: openVrConfiguration.left
|
||||
anchors.leftMargin: leftMargin
|
||||
}
|
||||
|
||||
|
@ -215,7 +230,7 @@ Rectangle {
|
|||
|
||||
anchors.top: (headOffsets.visible ? headOffsets.bottom : headConfig.bottom)
|
||||
anchors.topMargin: (headOffsets.visible ? 22 : 10)
|
||||
anchors.left: parent.left
|
||||
anchors.left: openVrConfiguration.left
|
||||
anchors.leftMargin: leftMargin
|
||||
}
|
||||
|
||||
|
@ -377,7 +392,7 @@ Rectangle {
|
|||
id: feetConfig
|
||||
anchors.top: additional.bottom
|
||||
anchors.topMargin: 15
|
||||
anchors.left: openVrConfiguration.left
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: leftMargin + 10
|
||||
spacing: 10
|
||||
|
||||
|
@ -656,7 +671,7 @@ Rectangle {
|
|||
onClicked: {
|
||||
if (calibrationButton.enabled) {
|
||||
if (openVrConfiguration.state === buttonState.apply) {
|
||||
InputConfiguration.uncalibratePlugin(pluginName);
|
||||
InputConfiguration.uncalibratePlugin(openVrConfiguration.pluginName);
|
||||
updateCalibrationButton();
|
||||
} else {
|
||||
calibrationTimer.interval = timeToCalibrate.realValue * 1000
|
||||
|
@ -694,7 +709,7 @@ Rectangle {
|
|||
repeat: false
|
||||
interval: 20
|
||||
onTriggered: {
|
||||
InputConfiguration.calibratePlugin(pluginName)
|
||||
InputConfiguration.calibratePlugin(openVrConfiguration.pluginName)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -712,7 +727,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
var settings = InputConfiguration.configurationSettings(pluginName);
|
||||
var settings = InputConfiguration.configurationSettings(openVrConfiguration.pluginName);
|
||||
var data = {
|
||||
"num_pucks": settings["puckCount"]
|
||||
}
|
||||
|
@ -829,7 +844,6 @@ Rectangle {
|
|||
|
||||
|
||||
function logAction(action, status) {
|
||||
console.log("calibrated from ui");
|
||||
var data = {
|
||||
"num_pucks": status["puckCount"],
|
||||
"puck_configuration": status["configuration"],
|
||||
|
@ -900,7 +914,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
function displayConfiguration() {
|
||||
var settings = InputConfiguration.configurationSettings(pluginName);
|
||||
var settings = InputConfiguration.configurationSettings(openVrConfiguration.pluginName);
|
||||
var configurationType = settings["trackerConfiguration"];
|
||||
displayTrackerConfiguration(configurationType);
|
||||
|
||||
|
@ -1100,7 +1114,9 @@ Rectangle {
|
|||
|
||||
function sendConfigurationSettings() {
|
||||
var settings = composeConfigurationSettings();
|
||||
InputConfiguration.setConfigurationSettings(settings, pluginName);
|
||||
InputConfiguration.setConfigurationSettings(settings, openVrConfiguration.pluginName);
|
||||
updateCalibrationButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue