mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
Merge pull request #1523 from AleziaKurdis/CreateApp_BUGFIX-1517
Create App: Prevent locked entities and their children from being duplicated.
This commit is contained in:
commit
4641652899
1 changed files with 14 additions and 7 deletions
|
@ -343,6 +343,19 @@ SelectionManager = (function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var duplicateInterrupted = false;
|
var duplicateInterrupted = false;
|
||||||
|
for (var j = 0; j < entitiesToDuplicate.length; j++) {
|
||||||
|
var lockedEntities = Entities.getEntityProperties(entitiesToDuplicate[j], 'locked');
|
||||||
|
if (lockedEntities.locked) {
|
||||||
|
duplicateInterrupted = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (duplicateInterrupted) {
|
||||||
|
audioFeedback.rejection();
|
||||||
|
Window.notifyEditError("At least one of the selected entities or one of their children are locked.");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// duplicate entities from above and store their original to new entity mappings and children needing re-parenting
|
// duplicate entities from above and store their original to new entity mappings and children needing re-parenting
|
||||||
for (var i = 0; i < entitiesToDuplicate.length; i++) {
|
for (var i = 0; i < entitiesToDuplicate.length; i++) {
|
||||||
var originalEntityID = entitiesToDuplicate[i];
|
var originalEntityID = entitiesToDuplicate[i];
|
||||||
|
@ -389,8 +402,6 @@ SelectionManager = (function() {
|
||||||
duplicatedChildrenWithOldParents[newEntityID] = properties.parentID;
|
duplicatedChildrenWithOldParents[newEntityID] = properties.parentID;
|
||||||
}
|
}
|
||||||
originalEntityToNewEntityID[originalEntityID] = newEntityID;
|
originalEntityToNewEntityID[originalEntityID] = newEntityID;
|
||||||
} else {
|
|
||||||
duplicateInterrupted = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,11 +420,7 @@ SelectionManager = (function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (duplicateInterrupted) {
|
audioFeedback.confirmation();
|
||||||
audioFeedback.rejection();
|
|
||||||
} else {
|
|
||||||
audioFeedback.confirmation();
|
|
||||||
}
|
|
||||||
return duplicatedEntityIDs;
|
return duplicatedEntityIDs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue