mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Excluding EntityShapeVisualizer from Children list
Excluding EntityShapeVisualizer from Children list Now a name is given to the EntityShape of the EntityShapeVisualizer (used to display the zone) so we can now exclude them from the children list when it's time to figure if there are children for an entity. (This is a better approach than excluding al the local entities) The name has been used because it gives better results than trying to use the id map that arrive always too late. The name is unique for a session, it includes a UUID.
This commit is contained in:
parent
22abf1c2c4
commit
00575ae8f8
1 changed files with 8 additions and 6 deletions
|
@ -117,8 +117,10 @@ var gridTool = new GridTool({
|
|||
});
|
||||
gridTool.setVisible(false);
|
||||
|
||||
var entityShapeVisualizerSessionName = "SHAPE_VISUALIZER_" + Uuid.generate();
|
||||
|
||||
var EntityShapeVisualizer = Script.require('./modules/entityShapeVisualizer.js');
|
||||
var entityShapeVisualizer = new EntityShapeVisualizer(["Zone"]);
|
||||
var entityShapeVisualizer = new EntityShapeVisualizer(["Zone"], entityShapeVisualizerSessionName);
|
||||
|
||||
var entityListTool = new EntityListTool(shouldUseEditTabletApp);
|
||||
|
||||
|
@ -2925,15 +2927,15 @@ function getParentState(id) {
|
|||
|
||||
function getDomainOnlyChildrenIDs(id) {
|
||||
var allChildren = Entities.getChildrenIDs(id);
|
||||
var domainOnlyChildren = [];
|
||||
var realChildren = [];
|
||||
var properties;
|
||||
for (var i = 0; i < allChildren.length; i++) {
|
||||
properties = Entities.getEntityProperties(allChildren[i], ["entityHostType"]);
|
||||
if (properties.entityHostType == "domain") {
|
||||
domainOnlyChildren.push(allChildren[i]);
|
||||
properties = Entities.getEntityProperties(allChildren[i], ["name"]);
|
||||
if (properties.name !== entityShapeVisualizerSessionName && properties.name !== undefined) {
|
||||
realChildren.push(allChildren[i]);
|
||||
}
|
||||
}
|
||||
return domainOnlyChildren;
|
||||
return realChildren;
|
||||
}
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue