From 51db0cef98138a58e6ab60ada58d5ecb706c3acc Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 9 May 2017 15:12:12 -0700 Subject: [PATCH] Fix tablet showing up for a short time on launch --- scripts/system/libraries/WebTablet.js | 12 ++++++++---- scripts/system/tablet-ui/tabletUI.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 1493ce7953..757743accc 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -96,7 +96,7 @@ function calcSpawnInfo(hand, height) { * @param hand [number] -1 indicates no hand, Controller.Standard.RightHand or Controller.Standard.LeftHand * @param clientOnly [bool] true indicates tablet model is only visible to client. */ -WebTablet = function (url, width, dpi, hand, clientOnly, location) { +WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { var _this = this; @@ -107,6 +107,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) { this.depth = TABLET_NATURAL_DIMENSIONS.z * tabletScaleFactor; this.landscape = false; + visible = visible === true; + if (dpi) { this.dpi = dpi; } else { @@ -125,7 +127,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) { "grabbableKey": {"grabbable": true} }), dimensions: this.getDimensions(), - parentID: AVATAR_SELF_ID + parentID: AVATAR_SELF_ID, + visible: visible }; // compute position, rotation & parentJointIndex of the tablet @@ -158,7 +161,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) { parentID: this.tabletEntityID, parentJointIndex: -1, showKeyboardFocusHighlight: false, - isAA: HMD.active + isAA: HMD.active, + visible: visible }); var HOME_BUTTON_Y_OFFSET = (this.height / 2) - (this.height / 20); @@ -168,7 +172,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) { localRotation: {x: 0, y: 1, z: 0, w: 0}, dimensions: { x: 4 * tabletScaleFactor, y: 4 * tabletScaleFactor, z: 4 * tabletScaleFactor}, alpha: 0.0, - visible: true, + visible: visible, drawInFront: false, parentID: this.tabletEntityID, parentJointIndex: -1 diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index bd5be142a0..f83e8d9550 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -92,7 +92,7 @@ tabletScalePercentage = getTabletScalePercentageFromSettings(); UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", DEFAULT_WIDTH * (tabletScalePercentage / 100), - null, activeHand, true); + null, activeHand, true, null, false); UIWebTablet.register(); HMD.tabletID = UIWebTablet.tabletEntityID; HMD.homeButtonID = UIWebTablet.homeButtonID;