mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
Add hiding of certified properties in Create
This commit is contained in:
parent
55f59a720f
commit
bf844e0472
3 changed files with 31 additions and 13 deletions
|
@ -23,6 +23,7 @@ const SCROLLBAR_WIDTH = 20;
|
|||
const RESIZER_WIDTH = 10;
|
||||
const DELTA_X_MOVE_COLUMNS_THRESHOLD = 2;
|
||||
const DELTA_X_COLUMN_SWAP_POSITION = 5;
|
||||
const CERTIFIED_PLACEHOLDER = "** Certified **";
|
||||
|
||||
const COLUMNS = {
|
||||
type: {
|
||||
|
@ -635,10 +636,11 @@ function loaded() {
|
|||
id: entity.id,
|
||||
name: entity.name,
|
||||
type: type,
|
||||
url: filename,
|
||||
fullUrl: entity.url,
|
||||
url: entity.certificateID === "" ? filename : "<i>" + CERTIFIED_PLACEHOLDER + "</i>",
|
||||
fullUrl: entity.certificateID === "" ? filename : CERTIFIED_PLACEHOLDER,
|
||||
locked: entity.locked,
|
||||
visible: entity.visible,
|
||||
certificateID: entity.certificateID,
|
||||
verticesCount: displayIfNonZero(entity.verticesCount),
|
||||
texturesCount: displayIfNonZero(entity.texturesCount),
|
||||
texturesSize: decimalMegabytes(entity.texturesSize),
|
||||
|
@ -876,7 +878,7 @@ function loaded() {
|
|||
if (column.data.glyph) {
|
||||
elCell.innerHTML = itemData[column.data.propertyID] ? column.data.columnHeader : null;
|
||||
} else {
|
||||
elCell.innerText = itemData[column.data.propertyID];
|
||||
elCell.innerHTML = itemData[column.data.propertyID];
|
||||
}
|
||||
elCell.style = "min-width:" + column.widthPx + "px;" + "max-width:" + column.widthPx + "px;";
|
||||
elCell.className = createColumnClassName(column.columnID);
|
||||
|
|
|
@ -390,7 +390,9 @@ const GROUPS = [
|
|||
{
|
||||
label: "Model",
|
||||
type: "string",
|
||||
placeholder: "URL",
|
||||
propertyID: "modelURL",
|
||||
hideIfCertified: true,
|
||||
},
|
||||
{
|
||||
label: "Collision Shape",
|
||||
|
@ -404,11 +406,13 @@ const GROUPS = [
|
|||
label: "Compound Shape",
|
||||
type: "string",
|
||||
propertyID: "compoundShapeURL",
|
||||
hideIfCertified: true,
|
||||
},
|
||||
{
|
||||
label: "Animation",
|
||||
type: "string",
|
||||
propertyID: "animation.url",
|
||||
hideIfCertified: true,
|
||||
},
|
||||
{
|
||||
label: "Play Automatically",
|
||||
|
@ -460,6 +464,7 @@ const GROUPS = [
|
|||
type: "textarea",
|
||||
propertyID: "originalTextures",
|
||||
readOnly: true,
|
||||
hideIfCertified: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
@ -1181,6 +1186,7 @@ const GROUPS = [
|
|||
buttons: [ { id: "reload", label: "F", className: "glyph", onClick: reloadScripts } ],
|
||||
propertyID: "script",
|
||||
placeholder: "URL",
|
||||
hideIfCertified: true,
|
||||
},
|
||||
{
|
||||
label: "Server Script",
|
||||
|
@ -1267,6 +1273,7 @@ const GROUPS = [
|
|||
placeholder: "URL",
|
||||
propertyID: "collisionSoundURL",
|
||||
showPropertyRule: { "collisionless": "false" },
|
||||
hideIfCertified: true,
|
||||
},
|
||||
{
|
||||
label: "Dynamic",
|
||||
|
@ -3084,6 +3091,15 @@ function loaded() {
|
|||
|
||||
showGroupsForType(selectedEntityProperties.type);
|
||||
|
||||
if (selectedEntityProperties.locked) {
|
||||
disableProperties();
|
||||
getPropertyInputElement("locked").removeAttribute('disabled');
|
||||
} else {
|
||||
enableProperties();
|
||||
disableSaveUserDataButton();
|
||||
disableSaveMaterialDataButton()
|
||||
}
|
||||
|
||||
for (let propertyID in properties) {
|
||||
let property = properties[propertyID];
|
||||
let propertyData = property.data;
|
||||
|
@ -3094,6 +3110,14 @@ function loaded() {
|
|||
if (propertyValue === undefined && !isSubProperty) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (propertyData.hideIfCertified) {
|
||||
let shouldHide = selectedEntityProperties.certificateID !== "";
|
||||
if (shouldHide) {
|
||||
propertyValue = "** Certified **";
|
||||
}
|
||||
property.elInput.disabled = shouldHide;
|
||||
}
|
||||
|
||||
let isPropertyNotNumber = false;
|
||||
switch (propertyData.type) {
|
||||
|
@ -3272,15 +3296,6 @@ function loaded() {
|
|||
hideMaterialDataSaved();
|
||||
}
|
||||
|
||||
if (selectedEntityProperties.locked) {
|
||||
disableProperties();
|
||||
getPropertyInputElement("locked").removeAttribute('disabled');
|
||||
} else {
|
||||
enableProperties();
|
||||
disableSaveUserDataButton();
|
||||
disableSaveMaterialDataButton()
|
||||
}
|
||||
|
||||
let activeElement = document.activeElement;
|
||||
if (doSelectElement && typeof activeElement.select !== "undefined") {
|
||||
activeElement.select();
|
||||
|
|
|
@ -164,7 +164,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
var cameraPosition = Camera.position;
|
||||
PROFILE("getMultipleProperties", function () {
|
||||
var multipleProperties = Entities.getMultipleEntityProperties(ids, ['name', 'type', 'locked',
|
||||
'visible', 'renderInfo', 'modelURL', 'materialURL', 'script']);
|
||||
'visible', 'renderInfo', 'modelURL', 'materialURL', 'script', 'certificateID']);
|
||||
for (var i = 0; i < multipleProperties.length; i++) {
|
||||
var properties = multipleProperties[i];
|
||||
|
||||
|
@ -182,6 +182,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
|
|||
url: url,
|
||||
locked: properties.locked,
|
||||
visible: properties.visible,
|
||||
certificateID: properties.certificateID,
|
||||
verticesCount: (properties.renderInfo !== undefined ?
|
||||
valueIfDefined(properties.renderInfo.verticesCount) : ""),
|
||||
texturesCount: (properties.renderInfo !== undefined ?
|
||||
|
|
Loading…
Reference in a new issue