diff --git a/interface/resources/fonts/vircadia_glyphs.ttf b/interface/resources/fonts/vircadia_glyphs.ttf index b6a8c2e7ad..7d3fe9d913 100644 Binary files a/interface/resources/fonts/vircadia_glyphs.ttf and b/interface/resources/fonts/vircadia_glyphs.ttf differ diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 5c488a71ee..69e2e94818 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -1696,7 +1696,7 @@ function recursiveDelete(entities, childrenList, deletedIDs, entityHostType) { } function unparentSelectedEntities() { - if (SelectionManager.hasSelection()) { + if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var selectedEntities = selectionManager.selections; var parentCheck = false; @@ -1720,6 +1720,9 @@ function unparentSelectedEntities() { } else { Window.notify("Entity unparented"); } + //Refresh + entityListTool.sendUpdate(); + selectionManager._update(false, this); } else { audioFeedback.rejection(); if (selectedEntities.length > 1) { @@ -1730,11 +1733,11 @@ function unparentSelectedEntities() { } } else { audioFeedback.rejection(); - Window.notifyEditError("You have nothing selected to unparent"); + Window.notifyEditError("You have nothing selected or the selection has locked entities."); } } function parentSelectedEntities() { - if (SelectionManager.hasSelection()) { + if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var selectedEntities = selectionManager.selections; if (selectedEntities.length <= 1) { audioFeedback.rejection(); @@ -1756,17 +1759,20 @@ function parentSelectedEntities() { if (parentCheck) { audioFeedback.confirmation(); Window.notify("Entities parented"); + //Refresh + entityListTool.sendUpdate(); + selectionManager._update(false, this); } else { audioFeedback.rejection(); Window.notify("Entities are already parented to last"); } } else { audioFeedback.rejection(); - Window.notifyEditError("You have nothing selected to parent"); + Window.notifyEditError("You have nothing selected or the selection has locked entities."); } } function deleteSelectedEntities() { - if (SelectionManager.hasSelection()) { + if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var deletedIDs = []; SelectionManager.saveProperties(); @@ -1797,6 +1803,9 @@ function deleteSelectedEntities() { pushCommandForSelections([], savedProperties); entityListTool.deleteEntities(deletedIDs); } + } else { + audioFeedback.rejection(); + Window.notifyEditError("You have nothing selected or the selection has locked entities."); } } @@ -2963,4 +2972,22 @@ function zoneSortOrder(a, b) { return 0; } +function getParentState(id) { + var state = "NONE"; + var properties = Entities.getEntityProperties(id, ["parentID"]); + var children = Entities.getChildrenIDs(id); + if (properties.parentID !== Uuid.NULL) { + if (children.length > 0) { + state = "PARENT_CHILDREN"; + } else { + state = "CHILDREN"; + } + } else { + if (children.length > 0) { + state = "PARENT"; + } + } + return state; +} + }()); // END LOCAL_SCOPE diff --git a/scripts/system/create/entityList/entityList.js b/scripts/system/create/entityList/entityList.js index 4b8163968d..252481d44d 100644 --- a/scripts/system/create/entityList/entityList.js +++ b/scripts/system/create/entityList/entityList.js @@ -190,7 +190,7 @@ EntityListTool = function(shouldUseEditTabletApp) { PROFILE("getMultipleProperties", function () { var multipleProperties = Entities.getMultipleEntityProperties(ids, ['position', 'name', 'type', 'locked', 'visible', 'renderInfo', 'modelURL', 'materialURL', 'imageURL', 'script', 'certificateID', - 'skybox.url', 'ambientLight.url']); + 'skybox.url', 'ambientLight.url', 'created', 'lastEdited']); for (var i = 0; i < multipleProperties.length; i++) { var properties = multipleProperties[i]; @@ -203,6 +203,17 @@ EntityListTool = function(shouldUseEditTabletApp) { } else if (properties.type === "Image") { url = properties.imageURL; } + + var parentStatus = getParentState(ids[i]); + var parentState = ""; + if (parentStatus === "PARENT") { + parentState = "A"; + } else if (parentStatus === "CHILDREN") { + parentState = "C"; + } else if (parentStatus === "PARENT_CHILDREN") { + parentState = "B"; + } + entities.push({ id: ids[i], name: properties.name, @@ -222,7 +233,10 @@ EntityListTool = function(shouldUseEditTabletApp) { isBaked: entityIsBaked(properties), drawCalls: (properties.renderInfo !== undefined ? valueIfDefined(properties.renderInfo.drawCalls) : ""), - hasScript: properties.script !== "" + hasScript: properties.script !== "", + parentState: parentState, + created: formatToStringDateTime(properties.created), + lastEdited: formatToStringDateTime(properties.lastEdited) }); } } @@ -242,6 +256,22 @@ EntityListTool = function(shouldUseEditTabletApp) { }); }; + function formatToStringDateTime(timestamp) { + var d = new Date(Math.floor(timestamp/1000)); + var dateTime = d.getUTCFullYear() + "-" + zeroPad((d.getUTCMonth() + 1), 2) + "-" + zeroPad(d.getUTCDate(), 2); + dateTime = dateTime + " " + zeroPad(d.getUTCHours(), 2) + ":" + zeroPad(d.getUTCMinutes(), 2) + ":" + zeroPad(d.getUTCSeconds(), 2); + dateTime = dateTime + "." + zeroPad(d.getUTCMilliseconds(), 3); + return dateTime; + } + + function zeroPad(num, size) { + num = num.toString(); + while (num.length < size) { + num = "0" + num; + } + return num; + } + function onFileSaveChanged(filename) { Window.saveFileChanged.disconnect(onFileSaveChanged); if (filename !== "") { @@ -323,6 +353,24 @@ EntityListTool = function(shouldUseEditTabletApp) { unparentSelectedEntities(); } else if (data.type === 'hmdMultiSelectMode') { hmdMultiSelectMode = data.value; + } else if (data.type === 'selectAllInBox') { + selectAllEntitiesInCurrentSelectionBox(false); + } else if (data.type === 'selectAllTouchingBox') { + selectAllEntitiesInCurrentSelectionBox(true); + } else if (data.type === 'selectParent') { + SelectionManager.selectParent(); + } else if (data.type === 'selectTopParent') { + SelectionManager.selectTopParent(); + } else if (data.type === 'addChildrenToSelection') { + SelectionManager.addChildrenToSelection(); + } else if (data.type === 'selectFamily') { + SelectionManager.selectFamily(); + } else if (data.type === 'selectTopFamily') { + SelectionManager.selectTopFamily(); + } else if (data.type === 'teleportToEntity') { + SelectionManager.teleportToEntity(); + } else if (data.type === 'moveEntitySelectionToAvatar') { + SelectionManager.moveEntitiesSelectionToAvatar(); } }; diff --git a/scripts/system/create/entityList/html/entityList.html b/scripts/system/create/entityList/html/entityList.html index 824ca380ec..b22cd87a65 100644 --- a/scripts/system/create/entityList/html/entityList.html +++ b/scripts/system/create/entityList/html/entityList.html @@ -32,19 +32,8 @@ - - - - -