From 83051940a854d8bee91e23f6542fa45554503e98 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Tue, 23 Oct 2018 04:49:45 +0200 Subject: [PATCH] Fix QA feedback --- .../system/assets/data/createAppTooltips.json | 45 ++++++++++++------- scripts/system/edit.js | 3 +- scripts/system/html/js/createAppTooltip.js | 26 ++++++++++- scripts/system/html/js/entityProperties.js | 2 + 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/scripts/system/assets/data/createAppTooltips.json b/scripts/system/assets/data/createAppTooltips.json index 7cc9e0a97e..0e6818c512 100644 --- a/scripts/system/assets/data/createAppTooltips.json +++ b/scripts/system/assets/data/createAppTooltips.json @@ -147,7 +147,7 @@ "tooltip": "The speed of the animation." }, "textures": { - "tooltip": "The URL of a JPG or PNG image file to display for each particle." + "tooltip": "A JSON string containing a texture. Use a name from the Original Texture property to override it." }, "originalTextures": { "tooltip": "A JSON string containing the original texture used on the model." @@ -171,6 +171,10 @@ "maxParticles": { "tooltip": "The maximum number of particles to render at one time. Older particles are swapped out for new ones." }, + "particleTextures": { + "tooltip": "The URL of a JPG or PNG image file to display for each particle.", + "jsPropertyName": "textures" + }, "emitRate": { "tooltip": "The number of particles per second to emit." }, @@ -244,16 +248,16 @@ "rotateWithEntity": { "tooltip": "If enabled, each particle will spin relative to the roation of the entity as a whole." }, - "azimuthStart": { + "polarStart": { "tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis." }, - "azimuthFinish": { + "polarFinish": { "tooltip": "" }, - "polarStart": { + "azimuthStart": { "tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis." }, - "polarFinish": { + "azimuthFinish": { "tooltip": "" }, "lightColor": { @@ -300,6 +304,12 @@ "registrationPoint": { "tooltip": "The point in the entity at which the entity is rotated about." }, + "visible": { + "tooltip": "If enabled, this entity will be visible." + }, + "locked": { + "tooltip": "If enabled, this entity will be locked." + }, "collisionless": { "tooltip": "If enabled, this entity will collide with other entities or avatars." }, @@ -318,20 +328,22 @@ "tooltip": "If enabled, this entity will collide with other kinematic entities (they have velocity but are not dynamic).", "jsPropertyName": "collidesWith" }, - "collidesWithOtherAvatars": { + "collidesWithOtherAvatar": { "tooltip": "If enabled, this entity will collide with other user's avatars.", "jsPropertyName": "collidesWith" }, + "collidesWithMyAvatar": { + "tooltip": "If enabled, this entity will collide with your own avatar.", + "jsPropertyName": "collidesWith" + }, "collisionSoundURL": { "tooltip": "The URL of a sound to play when the entity collides with something else." }, - "grabbable": { - "tooltip": "If enabled, this entity will allow grabbing input and will be moveable.", - "jsPropertyName": "userData[\"grabbableKey\"][\"grabbable\"]" + "grab.grabbable": { + "tooltip": "If enabled, this entity will allow grabbing input and will be moveable." }, - "triggerable": { - "tooltip": "If enabled, the collider on this entity is used for triggering events.", - "jsPropertyName": "userData[\"grabbableKey\"][\"triggerable\"]" + "grab.triggerable": { + "tooltip": "If enabled, the collider on this entity is used for triggering events." }, "cloneable": { "tooltip": "If enabled, this entity can be duplicated." @@ -348,9 +360,8 @@ "cloneAvatarEntity": { "tooltip": "If enabled, then clones created from this entity will be created as avatar entities." }, - "ignoreIK": { - "tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand.", - "jsPropertyName": "userData[\"grabbableKey\"][\"ignoreIK\"]" + "grab.grabFollowsController": { + "tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand." }, "canCastShadow": { "tooltip": "If enabled, this geometry of this entity casts shadows when a shadow-casting light source shines on it." @@ -411,6 +422,10 @@ "acceleration": { "tooltip": "A acceleration that the entity should move with, in world space." }, + "alignToGrid": { + "tooltip": "Used to align entities to the grid, or floor of the environment.", + "skipJSProperty": true + }, "createModel": { "tooltip": "An entity that is based on a custom mesh created from an .OBJ or .FBX.", "skipJSProperty": true diff --git a/scripts/system/edit.js b/scripts/system/edit.js index c6432ac2f9..6425806771 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -2484,7 +2484,8 @@ var PropertiesTool = function (opts) { } else if (data.type === "tooltipsRequest") { emitScriptEvent({ type: 'tooltipsReply', - tooltips: Script.require('./assets/data/createAppTooltips.json') + tooltips: Script.require('./assets/data/createAppTooltips.json'), + hmdActive: HMD.active, }); } }; diff --git a/scripts/system/html/js/createAppTooltip.js b/scripts/system/html/js/createAppTooltip.js index edd0f6366a..a42e5efe05 100644 --- a/scripts/system/html/js/createAppTooltip.js +++ b/scripts/system/html/js/createAppTooltip.js @@ -8,17 +8,20 @@ const CREATE_APP_TOOLTIP_OFFSET = 20; const TOOLTIP_DELAY = 500; // ms +const TOOLTIP_DEBUG = false; function CreateAppTooltip() { this._tooltipData = null; this._tooltipDiv = null; this._delayTimeout = null; + this._isEnabled = false; } CreateAppTooltip.prototype = { _tooltipData: null, _tooltipDiv: null, _delayTimeout: null, + _isEnabled: null, _removeTooltipIfExists: function() { if (this._delayTimeout !== null) { @@ -32,12 +35,19 @@ CreateAppTooltip.prototype = { } }, + setIsEnabled: function(isEnabled) { + this._isEnabled = isEnabled; + }, + setTooltipData: function(tooltipData) { this._tooltipData = tooltipData; }, registerTooltipElement: function(element, tooltipID) { element.addEventListener("mouseover", function() { + if (!this._isEnabled) { + return; + } this._removeTooltipIfExists(); @@ -45,7 +55,10 @@ CreateAppTooltip.prototype = { let tooltipData = this._tooltipData[tooltipID]; if (!tooltipData || tooltipData.tooltip === "") { - return; + if (!TOOLTIP_DEBUG) { + return; + } + tooltipData = {tooltip: 'PLEASE SET THIS TOOLTIP'}; } let elementRect = element.getBoundingClientRect(); @@ -74,6 +87,7 @@ CreateAppTooltip.prototype = { let elementTop = window.pageYOffset + elementRect.top; let desiredTooltipTop = elementTop + element.clientHeight + CREATE_APP_TOOLTIP_OFFSET; + let desiredTooltipLeft = window.pageXOffset + elementRect.left; if ((window.innerHeight + window.pageYOffset) < (desiredTooltipTop + elTip.clientHeight)) { // show above when otherwise out of bounds @@ -82,12 +96,20 @@ CreateAppTooltip.prototype = { // show tooltip on below by default elTip.style.top = desiredTooltipTop; } - elTip.style.left = window.pageXOffset + elementRect.left; + if ((window.innerWidth + window.pageXOffset) < (desiredTooltipLeft + elTip.clientWidth)) { + elTip.style.left = document.body.clientWidth + window.pageXOffset - elTip.offsetWidth; + } else { + elTip.style.left = desiredTooltipLeft; + } this._tooltipDiv = elTip; }.bind(this), TOOLTIP_DELAY); }.bind(this), false); element.addEventListener("mouseout", function() { + if (!this._isEnabled) { + return; + } + this._removeTooltipIfExists(); }.bind(this), false); } diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 59c2ba702b..173d806d59 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -3154,6 +3154,7 @@ function loaded() { } } } else if (data.type === 'tooltipsReply') { + createAppTooltip.setIsEnabled(!data.hmdActive); createAppTooltip.setTooltipData(data.tooltips); } }); @@ -3170,6 +3171,7 @@ function loaded() { let elLabel = document.createElement('label'); elLabel.setAttribute("for", serverScriptStatusElementID); elLabel.innerText = "Server Script Status"; + createAppTooltip.registerTooltipElement(elLabel, "serverScriptsStatus"); let elServerScriptStatus = document.createElement('span'); elServerScriptStatus.setAttribute("id", serverScriptStatusElementID); elDiv.appendChild(elLabel);