mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
Code minor adjustments.
Code minor adjustments to be compliant with the coding convention.
This commit is contained in:
parent
4a1926a901
commit
d1c641de49
1 changed files with 130 additions and 131 deletions
|
@ -1,5 +1,5 @@
|
||||||
//VERSION 2.0
|
//VERSION 2.0
|
||||||
// Modified by Alezia Kurdis on on 02/27/2020
|
// Modified by Alezia Kurdis on on 02/27/2020
|
||||||
// for "Project Athena"
|
// for "Project Athena"
|
||||||
//
|
//
|
||||||
// Addition of a tab mechanism instead of collapsible sections to reduce the scrolling.
|
// Addition of a tab mechanism instead of collapsible sections to reduce the scrolling.
|
||||||
|
@ -147,7 +147,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "text",
|
id: "text",
|
||||||
label: "TEXT",
|
label: "TEXT",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Text",
|
label: "Text",
|
||||||
|
@ -235,7 +235,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone",
|
id: "zone",
|
||||||
label: "ZONE",
|
label: "ZONE",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Shape Type",
|
label: "Shape Type",
|
||||||
|
@ -270,7 +270,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_key_light",
|
id: "zone_key_light",
|
||||||
label: "ZONE KEY LIGHT",
|
label: "ZONE KEY LIGHT",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Key Light",
|
label: "Key Light",
|
||||||
|
@ -345,7 +345,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_skybox",
|
id: "zone_skybox",
|
||||||
label: "ZONE SKYBOX",
|
label: "ZONE SKYBOX",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Skybox",
|
label: "Skybox",
|
||||||
|
@ -364,12 +364,12 @@ const GROUPS = [
|
||||||
type: "string",
|
type: "string",
|
||||||
propertyID: "skybox.url",
|
propertyID: "skybox.url",
|
||||||
showPropertyRule: { "skyboxMode": "enabled" },
|
showPropertyRule: { "skyboxMode": "enabled" },
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_ambient_light",
|
id: "zone_ambient_light",
|
||||||
label: "ZONE AMBIENT LIGHT",
|
label: "ZONE AMBIENT LIGHT",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Ambient Light",
|
label: "Ambient Light",
|
||||||
|
@ -399,12 +399,12 @@ const GROUPS = [
|
||||||
className: "black", onClick: copySkyboxURLToAmbientURL } ],
|
className: "black", onClick: copySkyboxURLToAmbientURL } ],
|
||||||
propertyID: "copyURLToAmbient",
|
propertyID: "copyURLToAmbient",
|
||||||
showPropertyRule: { "ambientLightMode": "enabled" },
|
showPropertyRule: { "ambientLightMode": "enabled" },
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_haze",
|
id: "zone_haze",
|
||||||
label: "ZONE HAZE",
|
label: "ZONE HAZE",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Haze",
|
label: "Haze",
|
||||||
|
@ -488,12 +488,12 @@ const GROUPS = [
|
||||||
decimals: 0,
|
decimals: 0,
|
||||||
propertyID: "haze.hazeGlareAngle",
|
propertyID: "haze.hazeGlareAngle",
|
||||||
showPropertyRule: { "hazeMode": "enabled" },
|
showPropertyRule: { "hazeMode": "enabled" },
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_bloom",
|
id: "zone_bloom",
|
||||||
label: "ZONE BLOOM",
|
label: "ZONE BLOOM",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Bloom",
|
label: "Bloom",
|
||||||
|
@ -530,24 +530,24 @@ const GROUPS = [
|
||||||
decimals: 3,
|
decimals: 3,
|
||||||
propertyID: "bloom.bloomSize",
|
propertyID: "bloom.bloomSize",
|
||||||
showPropertyRule: { "bloomMode": "enabled" },
|
showPropertyRule: { "bloomMode": "enabled" },
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "zone_avatar_priority",
|
id: "zone_avatar_priority",
|
||||||
label: "ZONE AVATAR PRIORITY",
|
label: "ZONE AVATAR PRIORITY",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Avatar Priority",
|
label: "Avatar Priority",
|
||||||
type: "dropdown",
|
type: "dropdown",
|
||||||
options: { inherit: "Inherit", crowd: "Crowd", hero: "Hero" },
|
options: { inherit: "Inherit", crowd: "Crowd", hero: "Hero" },
|
||||||
propertyID: "avatarPriority",
|
propertyID: "avatarPriority",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "model",
|
id: "model",
|
||||||
label: "MODEL",
|
label: "MODEL",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Model",
|
label: "Model",
|
||||||
|
@ -637,7 +637,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "image",
|
id: "image",
|
||||||
label: "IMAGE",
|
label: "IMAGE",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Image",
|
label: "Image",
|
||||||
|
@ -680,7 +680,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "web",
|
id: "web",
|
||||||
label: "WEB",
|
label: "WEB",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Source",
|
label: "Source",
|
||||||
|
@ -725,7 +725,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "light",
|
id: "light",
|
||||||
label: "LIGHT",
|
label: "LIGHT",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Light Color",
|
label: "Light Color",
|
||||||
|
@ -776,7 +776,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "material",
|
id: "material",
|
||||||
label: "MATERIAL",
|
label: "MATERIAL",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Material URL",
|
label: "Material URL",
|
||||||
|
@ -850,7 +850,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "grid",
|
id: "grid",
|
||||||
label: "GRID",
|
label: "GRID",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Color",
|
label: "Color",
|
||||||
|
@ -883,7 +883,7 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "particles",
|
id: "particles",
|
||||||
label: "PARTICLES",
|
label: "PARTICLES",
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Emit",
|
label: "Emit",
|
||||||
|
@ -913,7 +913,7 @@ const GROUPS = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "particles_emit",
|
id: "particles_emit",
|
||||||
label: "PARTICLES EMIT",
|
label: "PARTICLES EMIT",
|
||||||
//isMinor: true,
|
//isMinor: true,
|
||||||
properties: [
|
properties: [
|
||||||
|
@ -986,7 +986,7 @@ const GROUPS = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "particles_size",
|
id: "particles_size",
|
||||||
label: "PARTICLES SIZE",
|
label: "PARTICLES SIZE",
|
||||||
//isMinor: true,
|
//isMinor: true,
|
||||||
properties: [
|
properties: [
|
||||||
|
@ -1100,7 +1100,7 @@ const GROUPS = [
|
||||||
step: 0.001,
|
step: 0.001,
|
||||||
decimals: 3,
|
decimals: 3,
|
||||||
propertyID: "alphaSpread",
|
propertyID: "alphaSpread",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1444,7 +1444,7 @@ const GROUPS = [
|
||||||
propertyID: "userData",
|
propertyID: "userData",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "collision",
|
id: "collision",
|
||||||
label: "COLLISION",
|
label: "COLLISION",
|
||||||
|
@ -1609,7 +1609,7 @@ const GROUPS_PER_TYPE = {
|
||||||
Light: [ 'base', 'light', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
Light: [ 'base', 'light', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
||||||
Material: [ 'base', 'material', 'spatial', 'behavior', 'scripts' ],
|
Material: [ 'base', 'material', 'spatial', 'behavior', 'scripts' ],
|
||||||
ParticleEffect: [ 'base', 'particles', 'particles_emit', 'particles_size', 'particles_color',
|
ParticleEffect: [ 'base', 'particles', 'particles_emit', 'particles_size', 'particles_color',
|
||||||
'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'scripts', 'physics' ],
|
'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'scripts', 'physics' ],
|
||||||
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
||||||
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
||||||
PolyVox: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
PolyVox: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
|
||||||
|
@ -1698,7 +1698,7 @@ function isFlagSet(value, flag) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getPropertyInputElement(propertyID) {
|
function getPropertyInputElement(propertyID) {
|
||||||
let property = properties[propertyID];
|
let property = properties[propertyID];
|
||||||
switch (property.data.type) {
|
switch (property.data.type) {
|
||||||
case 'string':
|
case 'string':
|
||||||
case 'number':
|
case 'number':
|
||||||
|
@ -1783,7 +1783,7 @@ function setPropertyVisibility(property, visible) {
|
||||||
|
|
||||||
function resetProperties() {
|
function resetProperties() {
|
||||||
for (let propertyID in properties) {
|
for (let propertyID in properties) {
|
||||||
let property = properties[propertyID];
|
let property = properties[propertyID];
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
switch (propertyData.type) {
|
switch (propertyData.type) {
|
||||||
|
@ -1860,7 +1860,7 @@ function resetProperties() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let showPropertyRules = properties[propertyID].showPropertyRules;
|
let showPropertyRules = properties[propertyID].showPropertyRules;
|
||||||
if (showPropertyRules !== undefined) {
|
if (showPropertyRules !== undefined) {
|
||||||
for (let propertyToHide in showPropertyRules) {
|
for (let propertyToHide in showPropertyRules) {
|
||||||
|
@ -1885,7 +1885,7 @@ function showGroupsForType(type) {
|
||||||
showOnTheSamePage("Shape");
|
showOnTheSamePage("Shape");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type === "None"){
|
if (type === "None") {
|
||||||
showGroupsForTypes(["None"]);
|
showGroupsForTypes(["None"]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1905,9 +1905,9 @@ function showGroupsForTypes(types) {
|
||||||
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
|
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
|
||||||
if (types.map(type => GROUPS_PER_TYPE[type].includes(groupKey)).every(function (hasGroup) { return hasGroup; })) {
|
if (types.map(type => GROUPS_PER_TYPE[type].includes(groupKey)).every(function (hasGroup) { return hasGroup; })) {
|
||||||
elGroup.style.display = "none";
|
elGroup.style.display = "none";
|
||||||
if(types != "None"){
|
if (types !== "None") {
|
||||||
document.getElementById("tab-" + groupKey).style.display = "block";
|
document.getElementById("tab-" + groupKey).style.display = "block";
|
||||||
}else{
|
} else {
|
||||||
document.getElementById("tab-" + groupKey).style.display = "none";
|
document.getElementById("tab-" + groupKey).style.display = "none";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2309,7 +2309,7 @@ function updateCheckedSubProperty(propertyName, propertyMultiValue, subPropertyE
|
||||||
* PROPERTY ELEMENT CREATION FUNCTIONS
|
* PROPERTY ELEMENT CREATION FUNCTIONS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function createStringProperty(property, elProperty) {
|
function createStringProperty(property, elProperty) {
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
|
@ -2322,12 +2322,12 @@ function createStringProperty(property, elProperty) {
|
||||||
${propertyData.readOnly ? 'readonly' : ''}/>
|
${propertyData.readOnly ? 'readonly' : ''}/>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
||||||
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
||||||
if (propertyData.onChange !== undefined) {
|
if (propertyData.onChange !== undefined) {
|
||||||
elInput.addEventListener('change', propertyData.onChange);
|
elInput.addEventListener('change', propertyData.onChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let elMultiDiff = document.createElement('span');
|
let elMultiDiff = document.createElement('span');
|
||||||
elMultiDiff.className = "multi-diff";
|
elMultiDiff.className = "multi-diff";
|
||||||
|
@ -2338,7 +2338,7 @@ function createStringProperty(property, elProperty) {
|
||||||
if (propertyData.buttons !== undefined) {
|
if (propertyData.buttons !== undefined) {
|
||||||
addButtons(elProperty, elementID, propertyData.buttons, false);
|
addButtons(elProperty, elementID, propertyData.buttons, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return elInput;
|
return elInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2346,9 +2346,9 @@ function createBoolProperty(property, elProperty) {
|
||||||
let propertyName = property.name;
|
let propertyName = property.name;
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className = "checkbox";
|
elProperty.className = "checkbox";
|
||||||
|
|
||||||
if (propertyData.glyph !== undefined) {
|
if (propertyData.glyph !== undefined) {
|
||||||
let elSpan = document.createElement('span');
|
let elSpan = document.createElement('span');
|
||||||
elSpan.innerHTML = propertyData.glyph;
|
elSpan.innerHTML = propertyData.glyph;
|
||||||
|
@ -2577,7 +2577,7 @@ function createVec3Property(property, elProperty) {
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className = propertyData.vec3Type + " fstuple";
|
elProperty.className = propertyData.vec3Type + " fstuple";
|
||||||
|
|
||||||
let elNumberX = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.X_NUMBER]);
|
let elNumberX = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.X_NUMBER]);
|
||||||
let elNumberY = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Y_NUMBER]);
|
let elNumberY = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Y_NUMBER]);
|
||||||
let elNumberZ = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Z_NUMBER]);
|
let elNumberZ = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Z_NUMBER]);
|
||||||
|
@ -2592,7 +2592,7 @@ function createVec3Property(property, elProperty) {
|
||||||
elNumberX.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'x'));
|
elNumberX.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'x'));
|
||||||
elNumberY.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'y'));
|
elNumberY.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'y'));
|
||||||
elNumberZ.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'z'));
|
elNumberZ.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'z'));
|
||||||
|
|
||||||
let elResult = [];
|
let elResult = [];
|
||||||
elResult[VECTOR_ELEMENTS.X_NUMBER] = elNumberX;
|
elResult[VECTOR_ELEMENTS.X_NUMBER] = elNumberX;
|
||||||
elResult[VECTOR_ELEMENTS.Y_NUMBER] = elNumberY;
|
elResult[VECTOR_ELEMENTS.Y_NUMBER] = elNumberY;
|
||||||
|
@ -2600,11 +2600,11 @@ function createVec3Property(property, elProperty) {
|
||||||
return elResult;
|
return elResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createVec2Property(property, elProperty) {
|
function createVec2Property(property, elProperty) {
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className = propertyData.vec2Type + " fstuple";
|
elProperty.className = propertyData.vec2Type + " fstuple";
|
||||||
|
|
||||||
let elTuple = document.createElement('div');
|
let elTuple = document.createElement('div');
|
||||||
elTuple.className = "tuple";
|
elTuple.className = "tuple";
|
||||||
|
|
||||||
|
@ -2641,19 +2641,19 @@ function createColorProperty(property, elProperty) {
|
||||||
let propertyName = property.name;
|
let propertyName = property.name;
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className += " rgb fstuple";
|
elProperty.className += " rgb fstuple";
|
||||||
|
|
||||||
let elColorPicker = document.createElement('div');
|
let elColorPicker = document.createElement('div');
|
||||||
elColorPicker.className = "color-picker";
|
elColorPicker.className = "color-picker";
|
||||||
elColorPicker.setAttribute("id", elementID);
|
elColorPicker.setAttribute("id", elementID);
|
||||||
|
|
||||||
let elTuple = document.createElement('div');
|
let elTuple = document.createElement('div');
|
||||||
elTuple.className = "tuple";
|
elTuple.className = "tuple";
|
||||||
|
|
||||||
elProperty.appendChild(elColorPicker);
|
elProperty.appendChild(elColorPicker);
|
||||||
elProperty.appendChild(elTuple);
|
elProperty.appendChild(elTuple);
|
||||||
|
|
||||||
if (propertyData.min === undefined) {
|
if (propertyData.min === undefined) {
|
||||||
propertyData.min = COLOR_MIN;
|
propertyData.min = COLOR_MIN;
|
||||||
}
|
}
|
||||||
|
@ -2663,19 +2663,19 @@ function createColorProperty(property, elProperty) {
|
||||||
if (propertyData.step === undefined) {
|
if (propertyData.step === undefined) {
|
||||||
propertyData.step = COLOR_STEP;
|
propertyData.step = COLOR_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
let elNumberR = createTupleNumberInput(property, "red");
|
let elNumberR = createTupleNumberInput(property, "red");
|
||||||
let elNumberG = createTupleNumberInput(property, "green");
|
let elNumberG = createTupleNumberInput(property, "green");
|
||||||
let elNumberB = createTupleNumberInput(property, "blue");
|
let elNumberB = createTupleNumberInput(property, "blue");
|
||||||
elTuple.appendChild(elNumberR.elDiv);
|
elTuple.appendChild(elNumberR.elDiv);
|
||||||
elTuple.appendChild(elNumberG.elDiv);
|
elTuple.appendChild(elNumberG.elDiv);
|
||||||
elTuple.appendChild(elNumberB.elDiv);
|
elTuple.appendChild(elNumberB.elDiv);
|
||||||
|
|
||||||
let valueChangeFunction = createEmitColorPropertyUpdateFunction(property);
|
let valueChangeFunction = createEmitColorPropertyUpdateFunction(property);
|
||||||
elNumberR.setValueChangeFunction(valueChangeFunction);
|
elNumberR.setValueChangeFunction(valueChangeFunction);
|
||||||
elNumberG.setValueChangeFunction(valueChangeFunction);
|
elNumberG.setValueChangeFunction(valueChangeFunction);
|
||||||
elNumberB.setValueChangeFunction(valueChangeFunction);
|
elNumberB.setValueChangeFunction(valueChangeFunction);
|
||||||
|
|
||||||
let colorPickerID = "#" + elementID;
|
let colorPickerID = "#" + elementID;
|
||||||
colorPickers[colorPickerID] = $(colorPickerID).colpick({
|
colorPickers[colorPickerID] = $(colorPickerID).colpick({
|
||||||
colorScheme: 'dark',
|
colorScheme: 'dark',
|
||||||
|
@ -2704,7 +2704,7 @@ function createColorProperty(property, elProperty) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let elResult = [];
|
let elResult = [];
|
||||||
elResult[COLOR_ELEMENTS.COLOR_PICKER] = elColorPicker;
|
elResult[COLOR_ELEMENTS.COLOR_PICKER] = elColorPicker;
|
||||||
elResult[COLOR_ELEMENTS.RED_NUMBER] = elNumberR;
|
elResult[COLOR_ELEMENTS.RED_NUMBER] = elNumberR;
|
||||||
|
@ -2729,26 +2729,26 @@ function createDropdownProperty(property, propertyID, elProperty) {
|
||||||
option.text = propertyData.options[optionKey];
|
option.text = propertyData.options[optionKey];
|
||||||
elInput.add(option);
|
elInput.add(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
||||||
|
|
||||||
elProperty.appendChild(elInput);
|
elProperty.appendChild(elInput);
|
||||||
|
|
||||||
return elInput;
|
return elInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTextareaProperty(property, elProperty) {
|
function createTextareaProperty(property, elProperty) {
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className = "textarea";
|
elProperty.className = "textarea";
|
||||||
|
|
||||||
let elInput = document.createElement('textarea');
|
let elInput = document.createElement('textarea');
|
||||||
elInput.setAttribute("id", elementID);
|
elInput.setAttribute("id", elementID);
|
||||||
if (propertyData.readOnly) {
|
if (propertyData.readOnly) {
|
||||||
elInput.readOnly = true;
|
elInput.readOnly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
||||||
|
|
||||||
let elMultiDiff = document.createElement('span');
|
let elMultiDiff = document.createElement('span');
|
||||||
|
@ -2756,42 +2756,42 @@ function createTextareaProperty(property, elProperty) {
|
||||||
|
|
||||||
elProperty.appendChild(elInput);
|
elProperty.appendChild(elInput);
|
||||||
elProperty.appendChild(elMultiDiff);
|
elProperty.appendChild(elMultiDiff);
|
||||||
|
|
||||||
if (propertyData.buttons !== undefined) {
|
if (propertyData.buttons !== undefined) {
|
||||||
addButtons(elProperty, elementID, propertyData.buttons, true);
|
addButtons(elProperty, elementID, propertyData.buttons, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return elInput;
|
return elInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createIconProperty(property, elProperty) {
|
function createIconProperty(property, elProperty) {
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
|
|
||||||
elProperty.className = "value";
|
elProperty.className = "value";
|
||||||
|
|
||||||
let elSpan = document.createElement('span');
|
let elSpan = document.createElement('span');
|
||||||
elSpan.setAttribute("id", elementID + "-icon");
|
elSpan.setAttribute("id", elementID + "-icon");
|
||||||
elSpan.className = 'icon';
|
elSpan.className = 'icon';
|
||||||
|
|
||||||
elProperty.appendChild(elSpan);
|
elProperty.appendChild(elSpan);
|
||||||
|
|
||||||
return elSpan;
|
return elSpan;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTextureProperty(property, elProperty) {
|
function createTextureProperty(property, elProperty) {
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
|
|
||||||
elProperty.className = "texture";
|
elProperty.className = "texture";
|
||||||
|
|
||||||
let elDiv = document.createElement("div");
|
let elDiv = document.createElement("div");
|
||||||
let elImage = document.createElement("img");
|
let elImage = document.createElement("img");
|
||||||
elDiv.className = "texture-image no-texture";
|
elDiv.className = "texture-image no-texture";
|
||||||
elDiv.appendChild(elImage);
|
elDiv.appendChild(elImage);
|
||||||
|
|
||||||
let elInput = document.createElement('input');
|
let elInput = document.createElement('input');
|
||||||
elInput.setAttribute("id", elementID);
|
elInput.setAttribute("id", elementID);
|
||||||
elInput.setAttribute("type", "text");
|
elInput.setAttribute("type", "text");
|
||||||
|
|
||||||
let imageLoad = function(url) {
|
let imageLoad = function(url) {
|
||||||
elDiv.style.display = null;
|
elDiv.style.display = null;
|
||||||
if (url.slice(0, 5).toLowerCase() === "atp:/") {
|
if (url.slice(0, 5).toLowerCase() === "atp:/") {
|
||||||
|
@ -2828,7 +2828,7 @@ function createTextureProperty(property, elProperty) {
|
||||||
elMultiDiff.className = "multi-diff";
|
elMultiDiff.className = "multi-diff";
|
||||||
elProperty.appendChild(elMultiDiff);
|
elProperty.appendChild(elMultiDiff);
|
||||||
elProperty.appendChild(elDiv);
|
elProperty.appendChild(elDiv);
|
||||||
|
|
||||||
let elResult = [];
|
let elResult = [];
|
||||||
elResult[TEXTURE_ELEMENTS.IMAGE] = elImage;
|
elResult[TEXTURE_ELEMENTS.IMAGE] = elImage;
|
||||||
elResult[TEXTURE_ELEMENTS.TEXT_INPUT] = elInput;
|
elResult[TEXTURE_ELEMENTS.TEXT_INPUT] = elInput;
|
||||||
|
@ -2844,23 +2844,23 @@ function createButtonsProperty(property, elProperty) {
|
||||||
if (propertyData.buttons !== undefined) {
|
if (propertyData.buttons !== undefined) {
|
||||||
addButtons(elProperty, elementID, propertyData.buttons, false);
|
addButtons(elProperty, elementID, propertyData.buttons, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return elProperty;
|
return elProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDynamicMultiselectProperty(property, elProperty) {
|
function createDynamicMultiselectProperty(property, elProperty) {
|
||||||
let elementID = property.elementID;
|
let elementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
elProperty.className = "dynamic-multiselect";
|
elProperty.className = "dynamic-multiselect";
|
||||||
|
|
||||||
let elDivOptions = document.createElement('div');
|
let elDivOptions = document.createElement('div');
|
||||||
elDivOptions.setAttribute("id", elementID + "-options");
|
elDivOptions.setAttribute("id", elementID + "-options");
|
||||||
elDivOptions.style = "overflow-y:scroll;max-height:160px;";
|
elDivOptions.style = "overflow-y:scroll;max-height:160px;";
|
||||||
|
|
||||||
let elDivButtons = document.createElement('div');
|
let elDivButtons = document.createElement('div');
|
||||||
elDivButtons.setAttribute("id", elDivOptions.getAttribute("id") + "-buttons");
|
elDivButtons.setAttribute("id", elDivOptions.getAttribute("id") + "-buttons");
|
||||||
|
|
||||||
let elLabel = document.createElement('label');
|
let elLabel = document.createElement('label');
|
||||||
elLabel.innerText = "No Options";
|
elLabel.innerText = "No Options";
|
||||||
elDivOptions.appendChild(elLabel);
|
elDivOptions.appendChild(elLabel);
|
||||||
|
@ -2868,10 +2868,10 @@ function createDynamicMultiselectProperty(property, elProperty) {
|
||||||
let buttons = [ { id: "selectAll", label: "Select All", className: "black", onClick: selectAllMaterialTarget },
|
let buttons = [ { id: "selectAll", label: "Select All", className: "black", onClick: selectAllMaterialTarget },
|
||||||
{ id: "clearAll", label: "Clear All", className: "black", onClick: clearAllMaterialTarget } ];
|
{ id: "clearAll", label: "Clear All", className: "black", onClick: clearAllMaterialTarget } ];
|
||||||
addButtons(elDivButtons, elementID, buttons, false);
|
addButtons(elDivButtons, elementID, buttons, false);
|
||||||
|
|
||||||
elProperty.appendChild(elDivOptions);
|
elProperty.appendChild(elDivOptions);
|
||||||
elProperty.appendChild(elDivButtons);
|
elProperty.appendChild(elDivButtons);
|
||||||
|
|
||||||
return elDivOptions;
|
return elDivOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2889,13 +2889,13 @@ function createTupleNumberInput(property, subLabel) {
|
||||||
let propertyElementID = property.elementID;
|
let propertyElementID = property.elementID;
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
let elementID = propertyElementID + "-" + subLabel.toLowerCase();
|
let elementID = propertyElementID + "-" + subLabel.toLowerCase();
|
||||||
|
|
||||||
let elLabel = document.createElement('label');
|
let elLabel = document.createElement('label');
|
||||||
elLabel.className = "sublabel " + subLabel;
|
elLabel.className = "sublabel " + subLabel;
|
||||||
elLabel.innerText = subLabel[0].toUpperCase() + subLabel.slice(1);
|
elLabel.innerText = subLabel[0].toUpperCase() + subLabel.slice(1);
|
||||||
elLabel.setAttribute("for", elementID);
|
elLabel.setAttribute("for", elementID);
|
||||||
elLabel.style.visibility = "visible";
|
elLabel.style.visibility = "visible";
|
||||||
|
|
||||||
let dragStartFunction = createDragStartFunction(property);
|
let dragStartFunction = createDragStartFunction(property);
|
||||||
let dragEndFunction = createDragEndFunction(property);
|
let dragEndFunction = createDragEndFunction(property);
|
||||||
let elDraggableNumber = new DraggableNumber(propertyData.min, propertyData.max, propertyData.step,
|
let elDraggableNumber = new DraggableNumber(propertyData.min, propertyData.max, propertyData.step,
|
||||||
|
@ -2903,14 +2903,14 @@ function createTupleNumberInput(property, subLabel) {
|
||||||
elDraggableNumber.elInput.setAttribute("id", elementID);
|
elDraggableNumber.elInput.setAttribute("id", elementID);
|
||||||
elDraggableNumber.elDiv.className += " fstuple";
|
elDraggableNumber.elDiv.className += " fstuple";
|
||||||
elDraggableNumber.elDiv.insertBefore(elLabel, elDraggableNumber.elLeftArrow);
|
elDraggableNumber.elDiv.insertBefore(elLabel, elDraggableNumber.elLeftArrow);
|
||||||
|
|
||||||
return elDraggableNumber;
|
return elDraggableNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addButtons(elProperty, propertyID, buttons, newRow) {
|
function addButtons(elProperty, propertyID, buttons, newRow) {
|
||||||
let elDiv = document.createElement('div');
|
let elDiv = document.createElement('div');
|
||||||
elDiv.className = "row";
|
elDiv.className = "row";
|
||||||
|
|
||||||
buttons.forEach(function(button) {
|
buttons.forEach(function(button) {
|
||||||
let elButton = document.createElement('input');
|
let elButton = document.createElement('input');
|
||||||
elButton.className = button.className;
|
elButton.className = button.className;
|
||||||
|
@ -2932,7 +2932,7 @@ function addButtons(elProperty, propertyID, buttons, newRow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createProperty(propertyData, propertyElementID, propertyName, propertyID, elProperty) {
|
function createProperty(propertyData, propertyElementID, propertyName, propertyID, elProperty) {
|
||||||
let property = {
|
let property = {
|
||||||
data: propertyData,
|
data: propertyData,
|
||||||
elementID: propertyElementID,
|
elementID: propertyElementID,
|
||||||
name: propertyName,
|
name: propertyName,
|
||||||
|
@ -3523,15 +3523,15 @@ function requestMaterialTarget() {
|
||||||
entityID: getFirstSelectedID(),
|
entityID: getFirstSelectedID(),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMaterialTargetData(materialTargetData) {
|
function setMaterialTargetData(materialTargetData) {
|
||||||
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
||||||
resetDynamicMultiselectProperty(elDivOptions);
|
resetDynamicMultiselectProperty(elDivOptions);
|
||||||
|
|
||||||
if (materialTargetData === undefined) {
|
if (materialTargetData === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
elDivOptions.firstChild.style.display = "none"; // hide "No Options" text
|
elDivOptions.firstChild.style.display = "none"; // hide "No Options" text
|
||||||
elDivOptions.parentNode.lastChild.style.display = null; // show Select/Clear all buttons
|
elDivOptions.parentNode.lastChild.style.display = null; // show Select/Clear all buttons
|
||||||
|
|
||||||
|
@ -3539,7 +3539,7 @@ function setMaterialTargetData(materialTargetData) {
|
||||||
for (let i = 0; i < numMeshes; ++i) {
|
for (let i = 0; i < numMeshes; ++i) {
|
||||||
addMaterialTarget(elDivOptions, i, false);
|
addMaterialTarget(elDivOptions, i, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
let materialNames = materialTargetData.materialNames;
|
let materialNames = materialTargetData.materialNames;
|
||||||
let materialNamesAdded = [];
|
let materialNamesAdded = [];
|
||||||
for (let i = 0; i < materialNames.length; ++i) {
|
for (let i = 0; i < materialNames.length; ++i) {
|
||||||
|
@ -3549,7 +3549,7 @@ function setMaterialTargetData(materialTargetData) {
|
||||||
materialNamesAdded.push(materialName);
|
materialNamesAdded.push(materialName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
materialTargetPropertyUpdate(elDivOptions.propertyValue);
|
materialTargetPropertyUpdate(elDivOptions.propertyValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3557,12 +3557,12 @@ function addMaterialTarget(elDivOptions, targetID, isMaterialName) {
|
||||||
let elementID = elDivOptions.getAttribute("id");
|
let elementID = elDivOptions.getAttribute("id");
|
||||||
elementID += isMaterialName ? "-material-" : "-mesh-";
|
elementID += isMaterialName ? "-material-" : "-mesh-";
|
||||||
elementID += targetID;
|
elementID += targetID;
|
||||||
|
|
||||||
let elDiv = document.createElement('div');
|
let elDiv = document.createElement('div');
|
||||||
elDiv.className = "materialTargetDiv";
|
elDiv.className = "materialTargetDiv";
|
||||||
elDiv.onclick = onToggleMaterialTarget;
|
elDiv.onclick = onToggleMaterialTarget;
|
||||||
elDivOptions.appendChild(elDiv);
|
elDivOptions.appendChild(elDiv);
|
||||||
|
|
||||||
let elInput = document.createElement('input');
|
let elInput = document.createElement('input');
|
||||||
elInput.className = "materialTargetInput";
|
elInput.className = "materialTargetInput";
|
||||||
elInput.setAttribute("type", "checkbox");
|
elInput.setAttribute("type", "checkbox");
|
||||||
|
@ -3570,12 +3570,12 @@ function addMaterialTarget(elDivOptions, targetID, isMaterialName) {
|
||||||
elInput.setAttribute("targetID", targetID);
|
elInput.setAttribute("targetID", targetID);
|
||||||
elInput.setAttribute("isMaterialName", isMaterialName);
|
elInput.setAttribute("isMaterialName", isMaterialName);
|
||||||
elDiv.appendChild(elInput);
|
elDiv.appendChild(elInput);
|
||||||
|
|
||||||
let elLabel = document.createElement('label');
|
let elLabel = document.createElement('label');
|
||||||
elLabel.setAttribute("for", elementID);
|
elLabel.setAttribute("for", elementID);
|
||||||
elLabel.innerText = isMaterialName ? "Material " + targetID : "Mesh Index " + targetID;
|
elLabel.innerText = isMaterialName ? "Material " + targetID : "Mesh Index " + targetID;
|
||||||
elDiv.appendChild(elLabel);
|
elDiv.appendChild(elLabel);
|
||||||
|
|
||||||
return elDiv;
|
return elDiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3608,7 +3608,7 @@ function clearAllMaterialTarget() {
|
||||||
function sendMaterialTargetProperty() {
|
function sendMaterialTargetProperty() {
|
||||||
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
||||||
let elInputs = elDivOptions.getElementsByClassName("materialTargetInput");
|
let elInputs = elDivOptions.getElementsByClassName("materialTargetInput");
|
||||||
|
|
||||||
let materialTargetList = [];
|
let materialTargetList = [];
|
||||||
for (let i = 0; i < elInputs.length; ++i) {
|
for (let i = 0; i < elInputs.length; ++i) {
|
||||||
let elInput = elInputs[i];
|
let elInput = elInputs[i];
|
||||||
|
@ -3621,26 +3621,26 @@ function sendMaterialTargetProperty() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let propertyValue = materialTargetList.join(",");
|
let propertyValue = materialTargetList.join(",");
|
||||||
if (propertyValue.length > 1) {
|
if (propertyValue.length > 1) {
|
||||||
propertyValue = "[" + propertyValue + "]";
|
propertyValue = "[" + propertyValue + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
updateProperty("parentMaterialName", propertyValue, false);
|
updateProperty("parentMaterialName", propertyValue, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function materialTargetPropertyUpdate(propertyValue) {
|
function materialTargetPropertyUpdate(propertyValue) {
|
||||||
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
let elDivOptions = getPropertyInputElement("parentMaterialName");
|
||||||
let elInputs = elDivOptions.getElementsByClassName("materialTargetInput");
|
let elInputs = elDivOptions.getElementsByClassName("materialTargetInput");
|
||||||
|
|
||||||
if (propertyValue.startsWith('[')) {
|
if (propertyValue.startsWith('[')) {
|
||||||
propertyValue = propertyValue.substring(1, propertyValue.length);
|
propertyValue = propertyValue.substring(1, propertyValue.length);
|
||||||
}
|
}
|
||||||
if (propertyValue.endsWith(']')) {
|
if (propertyValue.endsWith(']')) {
|
||||||
propertyValue = propertyValue.substring(0, propertyValue.length - 1);
|
propertyValue = propertyValue.substring(0, propertyValue.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let materialTargets = propertyValue.split(",");
|
let materialTargets = propertyValue.split(",");
|
||||||
for (let i = 0; i < elInputs.length; ++i) {
|
for (let i = 0; i < elInputs.length; ++i) {
|
||||||
let elInput = elInputs[i];
|
let elInput = elInputs[i];
|
||||||
|
@ -3651,7 +3651,7 @@ function materialTargetPropertyUpdate(propertyValue) {
|
||||||
}
|
}
|
||||||
elInput.checked = materialTargets.indexOf(materialTargetName) >= 0;
|
elInput.checked = materialTargets.indexOf(materialTargetName) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
elDivOptions.propertyValue = propertyValue;
|
elDivOptions.propertyValue = propertyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4014,29 +4014,29 @@ function loaded() {
|
||||||
let elGroup;
|
let elGroup;
|
||||||
|
|
||||||
elGroup = document.createElement('div');
|
elGroup = document.createElement('div');
|
||||||
elGroup.className = 'section ' + "major";
|
elGroup.className = 'section ' + "major";
|
||||||
elGroup.setAttribute("id", "properties-" + group.id);
|
elGroup.setAttribute("id", "properties-" + group.id);
|
||||||
elPropertiesList.appendChild(elGroup);
|
elPropertiesList.appendChild(elGroup);
|
||||||
|
|
||||||
|
|
||||||
if (group.label !== undefined) {
|
if (group.label !== undefined) {
|
||||||
let elLegend = document.createElement('div');
|
let elLegend = document.createElement('div');
|
||||||
elLegend.className = "tab-section-header";
|
elLegend.className = "tab-section-header";
|
||||||
elLegend.appendChild(createElementFromHTML(`<div class="labelTabHeader">${group.label}</div>`));
|
elLegend.appendChild(createElementFromHTML(`<div class="labelTabHeader">${group.label}</div>`));
|
||||||
elGroup.appendChild(elLegend);
|
elGroup.appendChild(elLegend);
|
||||||
tabs = tabs +'<button id="tab-'+ group.id +'" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
|
tabs = tabs +'<button id="tab-'+ group.id +'" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
|
||||||
|
//tabs = tabs +'<button id="tab-'+ group.id +'" title="' + group.label + '" onclick="showPage(' + "'" + group.id + "'" + ');"><img src="tabs/'+ group.id +'.png"></button>';
|
||||||
}
|
}
|
||||||
|
|
||||||
group.properties.forEach(function(propertyData) {
|
group.properties.forEach(function(propertyData) {
|
||||||
let propertyType = propertyData.type;
|
let propertyType = propertyData.type;
|
||||||
let propertyID = propertyData.propertyID;
|
let propertyID = propertyData.propertyID;
|
||||||
let propertyName = propertyData.propertyName !== undefined ? propertyData.propertyName : propertyID;
|
let propertyName = propertyData.propertyName !== undefined ? propertyData.propertyName : propertyID;
|
||||||
let propertySpaceMode = propertyData.spaceMode !== undefined ? propertyData.spaceMode : PROPERTY_SPACE_MODE.ALL;
|
let propertySpaceMode = propertyData.spaceMode !== undefined ? propertyData.spaceMode : PROPERTY_SPACE_MODE.ALL;
|
||||||
let propertyElementID = "property-" + propertyID;
|
let propertyElementID = "property-" + propertyID;
|
||||||
propertyElementID = propertyElementID.replace('.', '-');
|
propertyElementID = propertyElementID.replace('.', '-');
|
||||||
|
|
||||||
let elContainer, elLabel;
|
let elContainer, elLabel;
|
||||||
|
|
||||||
if (propertyData.replaceID === undefined) {
|
if (propertyData.replaceID === undefined) {
|
||||||
// Create subheader, or create new property and append it.
|
// Create subheader, or create new property and append it.
|
||||||
if (propertyType === "sub-header") {
|
if (propertyType === "sub-header") {
|
||||||
|
@ -4126,15 +4126,15 @@ function loaded() {
|
||||||
property.elContainer = elContainer;
|
property.elContainer = elContainer;
|
||||||
property.spaceMode = propertySpaceMode;
|
property.spaceMode = propertySpaceMode;
|
||||||
property.group_id = group.id;
|
property.group_id = group.id;
|
||||||
|
|
||||||
if (property.type !== 'placeholder') {
|
if (property.type !== 'placeholder') {
|
||||||
properties[propertyID] = property;
|
properties[propertyID] = property;
|
||||||
}
|
}
|
||||||
if (propertyData.type === 'number' || propertyData.type === 'number-draggable' ||
|
if (propertyData.type === 'number' || propertyData.type === 'number-draggable' ||
|
||||||
propertyData.type === 'vec2' || propertyData.type === 'vec3' || propertyData.type === 'rect') {
|
propertyData.type === 'vec2' || propertyData.type === 'vec3' || propertyData.type === 'rect') {
|
||||||
propertyRangeRequests.push(propertyID);
|
propertyRangeRequests.push(propertyID);
|
||||||
}
|
}
|
||||||
|
|
||||||
let showPropertyRule = propertyData.showPropertyRule;
|
let showPropertyRule = propertyData.showPropertyRule;
|
||||||
if (showPropertyRule !== undefined) {
|
if (showPropertyRule !== undefined) {
|
||||||
let dependentProperty = Object.keys(showPropertyRule)[0];
|
let dependentProperty = Object.keys(showPropertyRule)[0];
|
||||||
|
@ -4149,12 +4149,12 @@ function loaded() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
elGroups[group.id] = elGroup;
|
elGroups[group.id] = elGroup;
|
||||||
});
|
});
|
||||||
|
|
||||||
updateVisibleSpaceModeProperties();
|
updateVisibleSpaceModeProperties();
|
||||||
|
|
||||||
if (window.EventBridge !== undefined) {
|
if (window.EventBridge !== undefined) {
|
||||||
EventBridge.scriptEventReceived.connect(function(data) {
|
EventBridge.scriptEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
@ -4233,7 +4233,7 @@ function loaded() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'tooltipsRequest' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'tooltipsRequest' }));
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'propertyRangeRequest', properties: propertyRangeRequests }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'propertyRangeRequest', properties: propertyRangeRequests }));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server Script Status
|
// Server Script Status
|
||||||
let elServerScriptStatusOuter = document.getElementById('div-property-serverScriptStatus');
|
let elServerScriptStatusOuter = document.getElementById('div-property-serverScriptStatus');
|
||||||
let elServerScriptStatusContainer = document.getElementById('div-property-serverScriptStatus').childNodes[1];
|
let elServerScriptStatusContainer = document.getElementById('div-property-serverScriptStatus').childNodes[1];
|
||||||
|
@ -4242,7 +4242,7 @@ function loaded() {
|
||||||
let elServerScriptStatus = document.createElement('div');
|
let elServerScriptStatus = document.createElement('div');
|
||||||
elServerScriptStatus.setAttribute("id", serverScriptStatusElementID);
|
elServerScriptStatus.setAttribute("id", serverScriptStatusElementID);
|
||||||
elServerScriptStatusContainer.appendChild(elServerScriptStatus);
|
elServerScriptStatusContainer.appendChild(elServerScriptStatus);
|
||||||
|
|
||||||
// Server Script Error
|
// Server Script Error
|
||||||
let elServerScripts = getPropertyInputElement("serverScripts");
|
let elServerScripts = getPropertyInputElement("serverScripts");
|
||||||
let elDiv = document.createElement('div');
|
let elDiv = document.createElement('div');
|
||||||
|
@ -4252,11 +4252,11 @@ function loaded() {
|
||||||
elServerScriptError.setAttribute("id", serverScriptErrorElementID);
|
elServerScriptError.setAttribute("id", serverScriptErrorElementID);
|
||||||
elDiv.appendChild(elServerScriptError);
|
elDiv.appendChild(elServerScriptError);
|
||||||
elServerScriptStatusContainer.appendChild(elDiv);
|
elServerScriptStatusContainer.appendChild(elDiv);
|
||||||
|
|
||||||
let elScript = getPropertyInputElement("script");
|
let elScript = getPropertyInputElement("script");
|
||||||
elScript.parentNode.className = "url refresh";
|
elScript.parentNode.className = "url refresh";
|
||||||
elServerScripts.parentNode.className = "url refresh";
|
elServerScripts.parentNode.className = "url refresh";
|
||||||
|
|
||||||
// User Data
|
// User Data
|
||||||
let userDataProperty = properties["userData"];
|
let userDataProperty = properties["userData"];
|
||||||
let elUserData = userDataProperty.elInput;
|
let elUserData = userDataProperty.elInput;
|
||||||
|
@ -4275,7 +4275,7 @@ function loaded() {
|
||||||
elDiv.insertBefore(elStaticUserData, elUserData);
|
elDiv.insertBefore(elStaticUserData, elUserData);
|
||||||
elDiv.insertBefore(elUserDataEditor, elUserData);
|
elDiv.insertBefore(elUserDataEditor, elUserData);
|
||||||
elDiv.insertBefore(elUserDataEditorStatus, elUserData);
|
elDiv.insertBefore(elUserDataEditorStatus, elUserData);
|
||||||
|
|
||||||
// Material Data
|
// Material Data
|
||||||
let materialDataProperty = properties["materialData"];
|
let materialDataProperty = properties["materialData"];
|
||||||
let elMaterialData = materialDataProperty.elInput;
|
let elMaterialData = materialDataProperty.elInput;
|
||||||
|
@ -4311,7 +4311,7 @@ function loaded() {
|
||||||
curCollapsibleElement.addEventListener("click", toggleCollapsedEvent, true);
|
curCollapsibleElement.addEventListener("click", toggleCollapsedEvent, true);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Textarea scrollbars
|
// Textarea scrollbars
|
||||||
let elTextareas = document.getElementsByTagName("TEXTAREA");
|
let elTextareas = document.getElementsByTagName("TEXTAREA");
|
||||||
|
|
||||||
|
@ -4328,7 +4328,7 @@ function loaded() {
|
||||||
event; mouseup is a partial stand-in but doesn't handle resizing if mouse moves outside textarea rectangle. */
|
event; mouseup is a partial stand-in but doesn't handle resizing if mouse moves outside textarea rectangle. */
|
||||||
curTextAreaElement.addEventListener("mouseup", textareaOnChangeEvent, false);
|
curTextAreaElement.addEventListener("mouseup", textareaOnChangeEvent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dropdowns
|
// Dropdowns
|
||||||
// For each dropdown the following replacement is created in place of the original dropdown...
|
// For each dropdown the following replacement is created in place of the original dropdown...
|
||||||
// Structure created:
|
// Structure created:
|
||||||
|
@ -4340,7 +4340,7 @@ function loaded() {
|
||||||
// <li>...</li>
|
// <li>...</li>
|
||||||
// </ul>
|
// </ul>
|
||||||
// </dd>
|
// </dd>
|
||||||
// </dl>
|
// </dl>
|
||||||
let elDropdowns = document.getElementsByTagName("select");
|
let elDropdowns = document.getElementsByTagName("select");
|
||||||
for (let dropDownIndex = 0; dropDownIndex < elDropdowns.length; ++dropDownIndex) {
|
for (let dropDownIndex = 0; dropDownIndex < elDropdowns.length; ++dropDownIndex) {
|
||||||
let elDropdown = elDropdowns[dropDownIndex];
|
let elDropdown = elDropdowns[dropDownIndex];
|
||||||
|
@ -4389,7 +4389,7 @@ function loaded() {
|
||||||
li.addEventListener("click", setDropdownValue);
|
li.addEventListener("click", setDropdownValue);
|
||||||
ul.appendChild(li);
|
ul.appendChild(li);
|
||||||
}
|
}
|
||||||
|
|
||||||
let propertyID = elDropdown.getAttribute("propertyID");
|
let propertyID = elDropdown.getAttribute("propertyID");
|
||||||
let property = properties[propertyID];
|
let property = properties[propertyID];
|
||||||
property.elInput = dt;
|
property.elInput = dt;
|
||||||
|
@ -4450,14 +4450,14 @@ function loaded() {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
window.onblur = function() {
|
window.onblur = function() {
|
||||||
// Fake a change event
|
// Fake a change event
|
||||||
let ev = document.createEvent("HTMLEvents");
|
let ev = document.createEvent("HTMLEvents");
|
||||||
ev.initEvent("change", true, true);
|
ev.initEvent("change", true, true);
|
||||||
document.activeElement.dispatchEvent(ev);
|
document.activeElement.dispatchEvent(ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
// For input and textarea elements, select all of the text on focus
|
// For input and textarea elements, select all of the text on focus
|
||||||
let els = document.querySelectorAll("input, textarea");
|
let els = document.querySelectorAll("input, textarea");
|
||||||
for (let i = 0; i < els.length; ++i) {
|
for (let i = 0; i < els.length; ++i) {
|
||||||
|
@ -4465,17 +4465,16 @@ function loaded() {
|
||||||
e.target.select();
|
e.target.select();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("tabs").innerHTML = tabs;
|
document.getElementById("tabs").innerHTML = tabs;
|
||||||
|
|
||||||
bindAllNonJSONEditorElements();
|
bindAllNonJSONEditorElements();
|
||||||
|
|
||||||
showGroupsForType("None");
|
showGroupsForType("None");
|
||||||
showPage("base");
|
showPage("base");
|
||||||
resetProperties();
|
resetProperties();
|
||||||
disableProperties();
|
disableProperties();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
augmentSpinButtons();
|
augmentSpinButtons();
|
||||||
|
@ -4492,7 +4491,7 @@ function loaded() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showOnTheSamePage(entityType) {
|
function showOnTheSamePage(entityType) {
|
||||||
if(GROUPS_PER_TYPE[entityType].includes(currentTab) == false){
|
if (!GROUPS_PER_TYPE[entityType].includes(currentTab)) {
|
||||||
currentTab = "base";
|
currentTab = "base";
|
||||||
}
|
}
|
||||||
showPage(currentTab);
|
showPage(currentTab);
|
||||||
|
@ -4501,7 +4500,7 @@ function showOnTheSamePage(entityType) {
|
||||||
function showPage(id) {
|
function showPage(id) {
|
||||||
currentTab = id;
|
currentTab = id;
|
||||||
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
|
Object.entries(elGroups).forEach(([groupKey, elGroup]) => {
|
||||||
if (groupKey == id) {
|
if (groupKey === id) {
|
||||||
elGroup.style.display = "block";
|
elGroup.style.display = "block";
|
||||||
document.getElementById("tab-" + groupKey).style.backgroundColor = "#2E2E2E";
|
document.getElementById("tab-" + groupKey).style.backgroundColor = "#2E2E2E";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue