mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 18:13:29 +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
|
||||
|
||||
property int value: 0
|
||||
|
||||
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() {
|
||||
|
@ -61,9 +73,9 @@ Preference {
|
|||
anchors {
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
leftPadding: 0
|
||||
colorScheme: hifi.colorSchemes.dark
|
||||
onClicked: updateValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,10 +123,18 @@ Item {
|
|||
}
|
||||
|
||||
// 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")) {
|
||||
var preference = findPreference("VR Movement", "Show room boundaries while teleporting");
|
||||
if (preference) {
|
||||
preference.label = "Show room boundaries and sensors while teleporting";
|
||||
var boundariesPreference = findPreference("VR Movement", "Show room boundaries while teleporting");
|
||||
if (boundariesPreference) {
|
||||
boundariesPreference.label = "Show room boundaries and sensors while teleporting";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue