From 47cdade1e9a3ba3d123678a46c3a9552beb386f1 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 17 Feb 2017 11:47:37 -0800 Subject: [PATCH] fix home-button on tablet --- interface/src/scripting/HMDScriptingInterface.h | 8 ++++---- scripts/system/libraries/WebTablet.js | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/interface/src/scripting/HMDScriptingInterface.h b/interface/src/scripting/HMDScriptingInterface.h index f5744bb8d1..643fac02fc 100644 --- a/interface/src/scripting/HMDScriptingInterface.h +++ b/interface/src/scripting/HMDScriptingInterface.h @@ -30,7 +30,7 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen Q_PROPERTY(bool mounted READ isMounted) Q_PROPERTY(bool showTablet READ getShouldShowTablet) Q_PROPERTY(QUuid tabletID READ getCurrentTableUIID WRITE setCurrentTabletUIID) - Q_PROPERTY(unsigned int homeButtonID READ getCurrentHomeButtonUUID WRITE setCurrentHomeButtonUUID) + Q_PROPERTY(QUuid homeButtonID READ getCurrentHomeButtonUUID WRITE setCurrentHomeButtonUUID) public: @@ -93,13 +93,13 @@ public: void setCurrentTabletUIID(QUuid tabletID) { _tabletUIID = tabletID; } QUuid getCurrentTableUIID() const { return _tabletUIID; } - void setCurrentHomeButtonUUID(unsigned int homeButtonID) { _homeButtonID = homeButtonID; } - unsigned int getCurrentHomeButtonUUID() const { return _homeButtonID; } + void setCurrentHomeButtonUUID(QUuid homeButtonID) { _homeButtonID = homeButtonID; } + QUuid getCurrentHomeButtonUUID() const { return _homeButtonID; } private: bool _showTablet { false }; QUuid _tabletUIID; // this is the entityID of the WebEntity which is part of (a child of) the tablet-ui. - unsigned int _homeButtonID; + QUuid _homeButtonID; QUuid _tabletEntityID; // Get the position of the HMD diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 74bbd788be..0990440801 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -159,7 +159,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { }); this.receive = function (channel, senderID, senderUUID, localOnly) { - if (_this.homeButtonEntity === parseInt(senderID)) { + if (_this.homeButtonEntity == senderID) { var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var onHomeScreen = tablet.onHomeScreen(); if (onHomeScreen) { @@ -219,7 +219,6 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { }; WebTablet.prototype.setHomeButtonTexture = function() { - print(this.homeButtonEntity); Entities.editEntity(this.tabletEntityID, {textures: JSON.stringify({"tex.close": HOME_BUTTON_TEXTURE})}); }; @@ -385,14 +384,10 @@ WebTablet.prototype.register = function() { WebTablet.prototype.cleanUpOldTabletsOnJoint = function(jointIndex) { var children = Entities.getChildrenIDsOfJoint(MyAvatar.sessionUUID, jointIndex); children = children.concat(Entities.getChildrenIDsOfJoint(AVATAR_SELF_ID, jointIndex)); - print("cleanup " + children); children.forEach(function(childID) { var props = Entities.getEntityProperties(childID, ["name"]); if (props.name === "WebTablet Tablet") { - print("cleaning up " + props.name); Entities.deleteEntity(childID); - } else { - print("not cleaning up " + props.name); } }); };