mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:29:02 +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("ADD_FILTER_TYPE", EntityTree::FilterType::Add);
|
||||||
entitiesObject.setProperty("EDIT_FILTER_TYPE", EntityTree::FilterType::Edit);
|
entitiesObject.setProperty("EDIT_FILTER_TYPE", EntityTree::FilterType::Edit);
|
||||||
entitiesObject.setProperty("PHYSICS_FILTER_TYPE", EntityTree::FilterType::Physics);
|
entitiesObject.setProperty("PHYSICS_FILTER_TYPE", EntityTree::FilterType::Physics);
|
||||||
|
entitiesObject.setProperty("ERASE_FILTER_TYPE", EntityTree::FilterType::Erase);
|
||||||
global.setProperty("Entities", entitiesObject);
|
global.setProperty("Entities", entitiesObject);
|
||||||
filterData.filterFn = global.property("filter");
|
filterData.filterFn = global.property("filter");
|
||||||
if (!filterData.filterFn.isFunction()) {
|
if (!filterData.filterFn.isFunction()) {
|
||||||
|
|
|
@ -1928,6 +1928,24 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EntityItemID entityItemID(entityID);
|
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;
|
entityItemIDsToDelete << entityItemID;
|
||||||
|
|
||||||
if (wantEditLogging() || wantTerseEditLogging()) {
|
if (wantEditLogging() || wantTerseEditLogging()) {
|
||||||
|
|
|
@ -57,7 +57,8 @@ public:
|
||||||
enum FilterType {
|
enum FilterType {
|
||||||
Add,
|
Add,
|
||||||
Edit,
|
Edit,
|
||||||
Physics
|
Physics,
|
||||||
|
Erase
|
||||||
};
|
};
|
||||||
EntityTree(bool shouldReaverage = false);
|
EntityTree(bool shouldReaverage = false);
|
||||||
virtual ~EntityTree();
|
virtual ~EntityTree();
|
||||||
|
|
Loading…
Reference in a new issue