Add new web and other properties to Create

This commit is contained in:
Ryan Huffman 2019-03-27 16:29:04 -07:00
parent 69a83e647e
commit 9abd0943ff
3 changed files with 78 additions and 4 deletions

View file

@ -549,6 +549,27 @@
"acceleration": {
"tooltip": "A acceleration that the entity should move with, in world space."
},
"renderLayer": {
"tooltip": "The layer on which this entity is rendered."
},
"primitiveMode": {
"tooltip": "The mode in which to draw an entity, either \"Solid\" or \"Wireframe\"."
},
"groupCulled": {
"tooltip": "If false, individual pieces of the entity may be culled by the render engine. If true, either the entire entity will be culled, or it won't at all."
},
"webColor": {
"tooltip": "The tint of the web entity."
},
"webAlpha": {
"tooltip": "The alpha of the web entity."
},
"maxFPS": {
"tooltip": "The FPS at which to render the web entity. Higher values will have a performance impact."
},
"scriptURL": {
"tooltip": "The URL of a script to inject into the web page."
},
"alignToGrid": {
"tooltip": "Used to align entities to the grid, or floor of the environment.",
"skipJSProperty": true

View file

@ -43,7 +43,7 @@ CreateAppTooltip.prototype = {
this._tooltipData = tooltipData;
},
registerTooltipElement: function(element, tooltipID) {
registerTooltipElement: function(element, tooltipID, jsPropertyName) {
element.addEventListener("mouseover", function() {
if (!this._isEnabled) {
return;
@ -70,7 +70,7 @@ CreateAppTooltip.prototype = {
elTipDescription.innerText = tooltipData.tooltip;
elTip.appendChild(elTipDescription);
let jsAttribute = tooltipID;
let jsAttribute = jsPropertyName;
if (tooltipData.jsPropertyName) {
jsAttribute = tooltipData.jsPropertyName;
}

View file

@ -75,6 +75,25 @@ const GROUPS = [
propertyID: "visible",
replaceID: "placeholder-property-visible",
},
{
label: "Render Layer",
type: "dropdown",
options: {
world: "World",
front: "Front",
hud: "HUD"
},
propertyID: "renderLayer",
},
{
label: "Primitive Mode",
type: "dropdown",
options: {
solid: "Solid",
lines: "Wireframe",
},
propertyID: "primitiveMode",
},
]
},
{
@ -520,6 +539,11 @@ const GROUPS = [
readOnly: true,
hideIfCertified: true,
},
{
label: "Group Culled",
type: "bool",
propertyID: "groupCulled",
},
]
},
{
@ -579,6 +603,35 @@ const GROUPS = [
type: "number-draggable",
propertyID: "dpi",
},
{
label: "Web Color",
type: "color",
propertyID: "webColor",
propertyName: "color", // actual entity property name
},
{
label: "Web Alpha",
type: "number-draggable",
step: 0.001,
decimals: 3,
propertyID: "webAlpha",
propertyName: "alpha",
},
{
label: "Max FPS",
type: "number-draggable",
step: 1,
decimals: 0,
min: 0,
max: 240,
propertyID: "maxFPS",
},
{
label: "Script URL",
type: "string",
propertyID: "scriptURL",
placeholder: "URL",
},
]
},
{
@ -3152,7 +3205,7 @@ function loaded() {
}
if (elLabel) {
createAppTooltip.registerTooltipElement(elLabel.childNodes[0], propertyID);
createAppTooltip.registerTooltipElement(elLabel.childNodes[0], propertyID, propertyName);
}
let elProperty = createElementFromHTML('<div style="width: 100%;"></div>');
@ -3177,7 +3230,7 @@ function loaded() {
property.spaceMode = propertySpaceMode;
let elLabel = createElementFromHTML(`<div class="triple-label">${innerPropertyData.label}</div>`);
createAppTooltip.registerTooltipElement(elLabel, propertyID);
createAppTooltip.registerTooltipElement(elLabel, propertyID, propertyName);
elWrapper.appendChild(elLabel);