added quad primitive, shortcuts and safe entity deletion
This commit is contained in:
@@ -133,7 +133,6 @@ namespace OpenEngine {
|
||||
{
|
||||
auto& tag = entity.GetComponents<TagComponent>().tag;
|
||||
|
||||
bool entity_marked_deletion = false;
|
||||
if (renamed_entity == entity && selected_context == entity) {
|
||||
char buffer[255];
|
||||
std::memset(buffer, 0, sizeof(buffer));
|
||||
@@ -161,8 +160,10 @@ namespace OpenEngine {
|
||||
bool opened = ImGui::TreeNodeEx((void*)(uint64_t)(uint32_t)entity, flags, "%s", tag.c_str());
|
||||
|
||||
if (ImGui::BeginPopupContextItem()) {
|
||||
if (ImGui::MenuItem("Delete entity"))
|
||||
entity_marked_deletion = true;
|
||||
if (ImGui::MenuItem("Delete entity")) {
|
||||
scene->MarkEntityForDeletion(entity);
|
||||
selected_context = {};
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
@@ -189,12 +190,6 @@ namespace OpenEngine {
|
||||
if (opened)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (entity_marked_deletion) {
|
||||
scene->DeleteEntity(entity);
|
||||
if (selected_context == entity)
|
||||
selected_context = {};
|
||||
}
|
||||
}
|
||||
|
||||
void SceneHierarchy::DrawComponents(Entity& entity)
|
||||
|
||||
Reference in New Issue
Block a user