From 672deb903cdbb7dd34bd171dfa5a58c7f25e37cd Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 20 Jan 2017 17:31:16 +0000 Subject: [PATCH 1/2] correct switch icons --- scripts/system/hmd.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index e6e8ed1c5c..26d37d15c7 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -42,6 +42,17 @@ var button; var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode']; function onHmdChanged(isHmd) { //TODO change button icon when the hmd changes + if (isHmd) { + button.editProperties({ + icon: "icons/tablet-icons/switch-a.svg", + text: "DESKTOP" + }); + } else { + button.editProperties({ + icon: "icons/tablet-icons/switch-i.svg", + text: "VR" + }); + } desktopOnlyViews.forEach(function (view) { Menu.setMenuEnabled("View>" + view, !isHmd); }); From 58e04f8e35f80f0126dfe4e2f37de9b382de5b24 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 20 Jan 2017 19:43:13 +0000 Subject: [PATCH 2/2] home button works in desktop mode --- scripts/system/libraries/WebTablet.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 7b321b0dd9..5f0671f389 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -190,7 +190,7 @@ WebTablet.prototype.getOverlayObject = function () { WebTablet.prototype.destroy = function () { Overlays.deleteOverlay(this.webOverlayID); Entities.deleteEntity(this.tabletEntityID); - Overlays.deleteEntity(this.homeButtonEntity); + Overlays.deleteOverlay(this.homeButtonEntity); HMD.displayModeChanged.disconnect(this.myOnHmdChanged); if (HMD.active) { @@ -305,7 +305,10 @@ WebTablet.prototype.mousePressEvent = function (event) { var entityPickResults = Entities.findRayIntersection(pickRay, true); // non-accurate picking if (entityPickResults.intersects && entityPickResults.entityID === this.tabletEntityID) { var overlayPickResults = Overlays.findRayIntersection(pickRay); - if (!overlayPickResults.intersects || !overlayPickResults.overlayID === this.webOverlayID) { + if (overlayPickResults.intersects && overlayPickResults.overlayID === HMD.homeButtonID) { + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet.gotoHomeScreen(); + } else if (!overlayPickResults.intersects || !overlayPickResults.overlayID === this.webOverlayID) { this.dragging = true; var invCameraXform = new Xform(Camera.orientation, Camera.position).inv(); this.initialLocalIntersectionPoint = invCameraXform.xformPoint(entityPickResults.intersection);