Merge pull request #11187 from zfox23/context_removeWhenDeleting

Remove context overlay (if present) when removing entity
This commit is contained in:
Zach Fox 2017-08-14 15:06:20 -07:00 committed by GitHub
commit ee4a07b10d
2 changed files with 9 additions and 0 deletions

View file

@ -55,6 +55,8 @@ ContextOverlayInterface::ContextOverlayInterface() {
_contextOverlayJustClicked = false;
}
});
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>().data();
connect(entityScriptingInterface, &EntityScriptingInterface::deletingEntity, this, &ContextOverlayInterface::deletingEntity);
}
static const uint32_t LEFT_HAND_HW_ID = 1;
@ -278,3 +280,9 @@ void ContextOverlayInterface::disableEntityHighlight(const EntityItemID& entityI
}
});
}
void ContextOverlayInterface::deletingEntity(const EntityItemID& entityID) {
if (_currentEntityWithContextOverlay == entityID) {
destroyContextOverlay(_currentEntityWithContextOverlay, PointerEvent());
}
}

View file

@ -80,6 +80,7 @@ private:
void enableEntityHighlight(const EntityItemID& entityItemID);
void disableEntityHighlight(const EntityItemID& entityItemID);
void deletingEntity(const EntityItemID& entityItemID);
};
#endif // hifi_ContextOverlayInterface_h