Fix QA feedback

This commit is contained in:
Thijs Wenker 2018-10-23 04:49:45 +02:00
parent 358b0b76d1
commit 83051940a8
4 changed files with 58 additions and 18 deletions

View file

@ -147,7 +147,7 @@
"tooltip": "The speed of the animation." "tooltip": "The speed of the animation."
}, },
"textures": { "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": { "originalTextures": {
"tooltip": "A JSON string containing the original texture used on the model." "tooltip": "A JSON string containing the original texture used on the model."
@ -171,6 +171,10 @@
"maxParticles": { "maxParticles": {
"tooltip": "The maximum number of particles to render at one time. Older particles are swapped out for new ones." "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": { "emitRate": {
"tooltip": "The number of particles per second to emit." "tooltip": "The number of particles per second to emit."
}, },
@ -244,18 +248,18 @@
"rotateWithEntity": { "rotateWithEntity": {
"tooltip": "If enabled, each particle will spin relative to the roation of the entity as a whole." "tooltip": "If enabled, each particle will spin relative to the roation of the entity as a whole."
}, },
"azimuthStart": {
"tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis."
},
"azimuthFinish": {
"tooltip": ""
},
"polarStart": { "polarStart": {
"tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis." "tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis."
}, },
"polarFinish": { "polarFinish": {
"tooltip": "" "tooltip": ""
}, },
"azimuthStart": {
"tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis."
},
"azimuthFinish": {
"tooltip": ""
},
"lightColor": { "lightColor": {
"tooltip": "The color of the light emitted.", "tooltip": "The color of the light emitted.",
"jsPropertyName": "color" "jsPropertyName": "color"
@ -300,6 +304,12 @@
"registrationPoint": { "registrationPoint": {
"tooltip": "The point in the entity at which the entity is rotated about." "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": { "collisionless": {
"tooltip": "If enabled, this entity will collide with other entities or avatars." "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).", "tooltip": "If enabled, this entity will collide with other kinematic entities (they have velocity but are not dynamic).",
"jsPropertyName": "collidesWith" "jsPropertyName": "collidesWith"
}, },
"collidesWithOtherAvatars": { "collidesWithOtherAvatar": {
"tooltip": "If enabled, this entity will collide with other user's avatars.", "tooltip": "If enabled, this entity will collide with other user's avatars.",
"jsPropertyName": "collidesWith" "jsPropertyName": "collidesWith"
}, },
"collidesWithMyAvatar": {
"tooltip": "If enabled, this entity will collide with your own avatar.",
"jsPropertyName": "collidesWith"
},
"collisionSoundURL": { "collisionSoundURL": {
"tooltip": "The URL of a sound to play when the entity collides with something else." "tooltip": "The URL of a sound to play when the entity collides with something else."
}, },
"grabbable": { "grab.grabbable": {
"tooltip": "If enabled, this entity will allow grabbing input and will be moveable.", "tooltip": "If enabled, this entity will allow grabbing input and will be moveable."
"jsPropertyName": "userData[\"grabbableKey\"][\"grabbable\"]"
}, },
"triggerable": { "grab.triggerable": {
"tooltip": "If enabled, the collider on this entity is used for triggering events.", "tooltip": "If enabled, the collider on this entity is used for triggering events."
"jsPropertyName": "userData[\"grabbableKey\"][\"triggerable\"]"
}, },
"cloneable": { "cloneable": {
"tooltip": "If enabled, this entity can be duplicated." "tooltip": "If enabled, this entity can be duplicated."
@ -348,9 +360,8 @@
"cloneAvatarEntity": { "cloneAvatarEntity": {
"tooltip": "If enabled, then clones created from this entity will be created as avatar entities." "tooltip": "If enabled, then clones created from this entity will be created as avatar entities."
}, },
"ignoreIK": { "grab.grabFollowsController": {
"tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand.", "tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand."
"jsPropertyName": "userData[\"grabbableKey\"][\"ignoreIK\"]"
}, },
"canCastShadow": { "canCastShadow": {
"tooltip": "If enabled, this geometry of this entity casts shadows when a shadow-casting light source shines on it." "tooltip": "If enabled, this geometry of this entity casts shadows when a shadow-casting light source shines on it."
@ -411,6 +422,10 @@
"acceleration": { "acceleration": {
"tooltip": "A acceleration that the entity should move with, in world space." "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": { "createModel": {
"tooltip": "An entity that is based on a custom mesh created from an .OBJ or .FBX.", "tooltip": "An entity that is based on a custom mesh created from an .OBJ or .FBX.",
"skipJSProperty": true "skipJSProperty": true

View file

@ -2484,7 +2484,8 @@ var PropertiesTool = function (opts) {
} else if (data.type === "tooltipsRequest") { } else if (data.type === "tooltipsRequest") {
emitScriptEvent({ emitScriptEvent({
type: 'tooltipsReply', type: 'tooltipsReply',
tooltips: Script.require('./assets/data/createAppTooltips.json') tooltips: Script.require('./assets/data/createAppTooltips.json'),
hmdActive: HMD.active,
}); });
} }
}; };

View file

@ -8,17 +8,20 @@
const CREATE_APP_TOOLTIP_OFFSET = 20; const CREATE_APP_TOOLTIP_OFFSET = 20;
const TOOLTIP_DELAY = 500; // ms const TOOLTIP_DELAY = 500; // ms
const TOOLTIP_DEBUG = false;
function CreateAppTooltip() { function CreateAppTooltip() {
this._tooltipData = null; this._tooltipData = null;
this._tooltipDiv = null; this._tooltipDiv = null;
this._delayTimeout = null; this._delayTimeout = null;
this._isEnabled = false;
} }
CreateAppTooltip.prototype = { CreateAppTooltip.prototype = {
_tooltipData: null, _tooltipData: null,
_tooltipDiv: null, _tooltipDiv: null,
_delayTimeout: null, _delayTimeout: null,
_isEnabled: null,
_removeTooltipIfExists: function() { _removeTooltipIfExists: function() {
if (this._delayTimeout !== null) { if (this._delayTimeout !== null) {
@ -32,12 +35,19 @@ CreateAppTooltip.prototype = {
} }
}, },
setIsEnabled: function(isEnabled) {
this._isEnabled = isEnabled;
},
setTooltipData: function(tooltipData) { setTooltipData: function(tooltipData) {
this._tooltipData = tooltipData; this._tooltipData = tooltipData;
}, },
registerTooltipElement: function(element, tooltipID) { registerTooltipElement: function(element, tooltipID) {
element.addEventListener("mouseover", function() { element.addEventListener("mouseover", function() {
if (!this._isEnabled) {
return;
}
this._removeTooltipIfExists(); this._removeTooltipIfExists();
@ -45,8 +55,11 @@ CreateAppTooltip.prototype = {
let tooltipData = this._tooltipData[tooltipID]; let tooltipData = this._tooltipData[tooltipID];
if (!tooltipData || tooltipData.tooltip === "") { if (!tooltipData || tooltipData.tooltip === "") {
if (!TOOLTIP_DEBUG) {
return; return;
} }
tooltipData = {tooltip: 'PLEASE SET THIS TOOLTIP'};
}
let elementRect = element.getBoundingClientRect(); let elementRect = element.getBoundingClientRect();
let elTip = document.createElement("div"); let elTip = document.createElement("div");
@ -74,6 +87,7 @@ CreateAppTooltip.prototype = {
let elementTop = window.pageYOffset + elementRect.top; let elementTop = window.pageYOffset + elementRect.top;
let desiredTooltipTop = elementTop + element.clientHeight + CREATE_APP_TOOLTIP_OFFSET; let desiredTooltipTop = elementTop + element.clientHeight + CREATE_APP_TOOLTIP_OFFSET;
let desiredTooltipLeft = window.pageXOffset + elementRect.left;
if ((window.innerHeight + window.pageYOffset) < (desiredTooltipTop + elTip.clientHeight)) { if ((window.innerHeight + window.pageYOffset) < (desiredTooltipTop + elTip.clientHeight)) {
// show above when otherwise out of bounds // show above when otherwise out of bounds
@ -82,12 +96,20 @@ CreateAppTooltip.prototype = {
// show tooltip on below by default // show tooltip on below by default
elTip.style.top = desiredTooltipTop; 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; this._tooltipDiv = elTip;
}.bind(this), TOOLTIP_DELAY); }.bind(this), TOOLTIP_DELAY);
}.bind(this), false); }.bind(this), false);
element.addEventListener("mouseout", function() { element.addEventListener("mouseout", function() {
if (!this._isEnabled) {
return;
}
this._removeTooltipIfExists(); this._removeTooltipIfExists();
}.bind(this), false); }.bind(this), false);
} }

View file

@ -3154,6 +3154,7 @@ function loaded() {
} }
} }
} else if (data.type === 'tooltipsReply') { } else if (data.type === 'tooltipsReply') {
createAppTooltip.setIsEnabled(!data.hmdActive);
createAppTooltip.setTooltipData(data.tooltips); createAppTooltip.setTooltipData(data.tooltips);
} }
}); });
@ -3170,6 +3171,7 @@ function loaded() {
let elLabel = document.createElement('label'); let elLabel = document.createElement('label');
elLabel.setAttribute("for", serverScriptStatusElementID); elLabel.setAttribute("for", serverScriptStatusElementID);
elLabel.innerText = "Server Script Status"; elLabel.innerText = "Server Script Status";
createAppTooltip.registerTooltipElement(elLabel, "serverScriptsStatus");
let elServerScriptStatus = document.createElement('span'); let elServerScriptStatus = document.createElement('span');
elServerScriptStatus.setAttribute("id", serverScriptStatusElementID); elServerScriptStatus.setAttribute("id", serverScriptStatusElementID);
elDiv.appendChild(elLabel); elDiv.appendChild(elLabel);