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"))
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Nuake
|
||||
class Scene;
|
||||
class FrameBuffer;
|
||||
class Texture;
|
||||
class Entity;
|
||||
}
|
||||
|
||||
class PrefabEditorWindow
|
||||
@@ -36,6 +37,7 @@ private:
|
||||
|
||||
EditorSelectionPanel SelectionPanel;
|
||||
EditorSelection Selection;
|
||||
Nuake::Entity QueueDeletion;
|
||||
|
||||
private:
|
||||
void DrawViewportWindow();
|
||||
|
||||
Reference in New Issue
Block a user