mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Can now delete from prefab editor
This commit is contained in:
@@ -280,10 +280,22 @@ void PrefabEditorWindow::Draw()
|
||||
|
||||
DrawEntityTree(prefab->Root);
|
||||
|
||||
|
||||
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
|
||||
if (QueueDeletion.GetHandle() != -1)
|
||||
{
|
||||
virtualScene->DestroyEntity(QueueDeletion);
|
||||
|
||||
// Clear Selection
|
||||
Selection = EditorSelection();
|
||||
|
||||
QueueDeletion = Nuake::Entity{ (entt::entity)-1, scene.get() };
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleVar();
|
||||
@@ -511,7 +523,7 @@ void PrefabEditorWindow::DrawEntityTree(Nuake::Entity e)
|
||||
|
||||
if (!isRenaming && Selection.Type == EditorSelectionType::Entity && Input::IsKeyPressed(Key::DELETE_KEY))
|
||||
{
|
||||
//QueueDeletion = Selection.Entity;
|
||||
QueueDeletion = Selection.Entity;
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupContextItem())
|
||||
@@ -534,7 +546,7 @@ void PrefabEditorWindow::DrawEntityTree(Nuake::Entity e)
|
||||
|
||||
if (ImGui::Selectable("Remove"))
|
||||
{
|
||||
//QueueDeletion = e;
|
||||
QueueDeletion = e;
|
||||
}
|
||||
|
||||
if (entity.GetComponent<ParentComponent>().HasParent && ImGui::Selectable("Move to root"))
|
||||
|
||||
Reference in New Issue
Block a user