mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
add delete filter support
This commit is contained in:
parent
dc35ecf0c2
commit
aea16fe071
3 changed files with 21 additions and 1 deletions
|
@ -245,6 +245,7 @@ void EntityEditFilters::scriptRequestFinished(EntityItemID entityID) {
|
|||
entitiesObject.setProperty("ADD_FILTER_TYPE", EntityTree::FilterType::Add);
|
||||
entitiesObject.setProperty("EDIT_FILTER_TYPE", EntityTree::FilterType::Edit);
|
||||
entitiesObject.setProperty("PHYSICS_FILTER_TYPE", EntityTree::FilterType::Physics);
|
||||
entitiesObject.setProperty("ERASE_FILTER_TYPE", EntityTree::FilterType::Erase);
|
||||
global.setProperty("Entities", entitiesObject);
|
||||
filterData.filterFn = global.property("filter");
|
||||
if (!filterData.filterFn.isFunction()) {
|
||||
|
|
|
@ -1928,6 +1928,24 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
|||
#endif
|
||||
|
||||
EntityItemID entityItemID(entityID);
|
||||
|
||||
EntityItemPointer existingEntity;
|
||||
|
||||
auto startLookup = usecTimestampNow();
|
||||
existingEntity = findEntityByEntityItemID(entityItemID);
|
||||
auto endLookup = usecTimestampNow();
|
||||
_totalLookupTime += endLookup - startLookup;
|
||||
|
||||
auto startFilter = usecTimestampNow();
|
||||
FilterType filterType = FilterType::Erase;
|
||||
EntityItemProperties dummyProperties;
|
||||
bool wasChanged = false;
|
||||
|
||||
bool allowed = (sourceNode->isAllowedEditor()) || filterProperties(existingEntity, dummyProperties, dummyProperties, wasChanged, filterType);
|
||||
auto endFilter = usecTimestampNow();
|
||||
|
||||
_totalFilterTime += endFilter - startFilter;
|
||||
|
||||
entityItemIDsToDelete << entityItemID;
|
||||
|
||||
if (wantEditLogging() || wantTerseEditLogging()) {
|
||||
|
|
|
@ -57,7 +57,8 @@ public:
|
|||
enum FilterType {
|
||||
Add,
|
||||
Edit,
|
||||
Physics
|
||||
Physics,
|
||||
Erase
|
||||
};
|
||||
EntityTree(bool shouldReaverage = false);
|
||||
virtual ~EntityTree();
|
||||
|
|
Loading…
Reference in a new issue