mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-21 07:01:39 +02:00
Close tablet when switching form HMD to desktop and vice versa
This commit is contained in:
parent
31fc50b38c
commit
5f7a0ea8fc
1 changed files with 7 additions and 2 deletions
|
@ -21,10 +21,12 @@ var desktopMenuItemName = "Desktop";
|
||||||
['OpenVR (Vive)', 'Oculus Rift'].forEach(function (name) {
|
['OpenVR (Vive)', 'Oculus Rift'].forEach(function (name) {
|
||||||
if (!headset && Menu.menuItemExists(displayMenuName, name)) {
|
if (!headset && Menu.menuItemExists(displayMenuName, name)) {
|
||||||
headset = name;
|
headset = name;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var controllerDisplay = false;
|
|
||||||
|
var controllerDisplay = false;
|
||||||
function updateControllerDisplay() {
|
function updateControllerDisplay() {
|
||||||
if (HMD.active && Menu.isOptionChecked("Third Person")) {
|
if (HMD.active && Menu.isOptionChecked("Third Person")) {
|
||||||
if (!controllerDisplay) {
|
if (!controllerDisplay) {
|
||||||
|
@ -37,7 +39,9 @@ function updateControllerDisplay() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var button;
|
|
||||||
|
var button;
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
|
||||||
// Independent and Entity mode make people sick. Third Person and Mirror have traps that we need to work through.
|
// Independent and Entity mode make people sick. Third Person and Mirror have traps that we need to work through.
|
||||||
|
@ -45,6 +49,7 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
|
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
|
||||||
|
|
||||||
function onHmdChanged(isHmd) {
|
function onHmdChanged(isHmd) {
|
||||||
|
HMD.closeTablet();
|
||||||
if (isHmd) {
|
if (isHmd) {
|
||||||
button.editProperties({
|
button.editProperties({
|
||||||
icon: "icons/tablet-icons/switch-desk-i.svg",
|
icon: "icons/tablet-icons/switch-desk-i.svg",
|
||||||
|
|
Loading…
Reference in a new issue