Change play area option text for Oculus

This commit is contained in:
David Rowe 2018-09-27 17:07:42 +12:00
parent 3284b2a90e
commit 5ab22a1f40

View file

@ -122,6 +122,14 @@ Item {
}
}
// Runtime customization of preferences.
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";
}
}
if (sections.length) {
// Default sections to expanded/collapsed as appropriate for dialog.
if (sections.length === 1) {
@ -234,4 +242,32 @@ Item {
}
}
}
function findPreference(category, name) {
var section = null;
var preference = null;
var i;
// Find category section.
i = 0;
while (!section && i < sections.length) {
if (sections[i].name === category) {
section = sections[i];
}
i++;
}
// Find named preference.
if (section) {
i = 0;
while (!preference && i < section.preferences.length) {
if (section.preferences[i].preference && section.preferences[i].preference.name === name) {
preference = section.preferences[i];
}
i++;
}
}
return preference;
}
}