mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 10:06:57 +02:00
Show/hide jumping & flying checkbox depending on movement mode
This commit is contained in:
parent
5ab22a1f40
commit
4813f4d042
2 changed files with 25 additions and 5 deletions
|
@ -18,8 +18,20 @@ Preference {
|
||||||
|
|
||||||
height: control.height + hifi.dimensions.controlInterlineHeight
|
height: control.height + hifi.dimensions.controlInterlineHeight
|
||||||
|
|
||||||
|
property int value: 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
repeater.itemAt(preference.value).checked = true
|
value = preference.value;
|
||||||
|
repeater.itemAt(preference.value).checked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateValue() {
|
||||||
|
for (var i = 0; i < repeater.count; i++) {
|
||||||
|
if (repeater.itemAt(i).checked) {
|
||||||
|
value = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
|
@ -61,9 +73,9 @@ Preference {
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
onClicked: updateValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,10 +123,18 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Runtime customization of preferences.
|
// Runtime customization of preferences.
|
||||||
|
var locomotionPreference = findPreference("VR Movement", "Teleporting only / Walking and teleporting");
|
||||||
|
var flyingPreference = findPreference("VR Movement", "Jumping and flying");
|
||||||
|
if (locomotionPreference && flyingPreference) {
|
||||||
|
flyingPreference.visible = (locomotionPreference.value === 1);
|
||||||
|
locomotionPreference.valueChanged.connect(function () {
|
||||||
|
flyingPreference.visible = (locomotionPreference.value === 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (HMD.isHeadControllerAvailable("Oculus")) {
|
if (HMD.isHeadControllerAvailable("Oculus")) {
|
||||||
var preference = findPreference("VR Movement", "Show room boundaries while teleporting");
|
var boundariesPreference = findPreference("VR Movement", "Show room boundaries while teleporting");
|
||||||
if (preference) {
|
if (boundariesPreference) {
|
||||||
preference.label = "Show room boundaries and sensors while teleporting";
|
boundariesPreference.label = "Show room boundaries and sensors while teleporting";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue