diff --git a/docs/tasks/editor.todo b/docs/tasks/editor.todo index dbc54f9..7d7842e 100644 --- a/docs/tasks/editor.todo +++ b/docs/tasks/editor.todo @@ -1,7 +1,8 @@ Editor: - ☐ Remove Entity - ☐ Remove Component + + ✔ Remove Entity @done(22-10-14 18:28) + ✔ Remove Component @done(22-10-14 18:28) ✔ Add Entity children @done(22-09-14 15:07) ✔ Entity Parent/Child hierarchy system @done(22-09-14 15:07) ✔ Give Entities a name property separate from the tag component @done(22-09-14 15:06) @@ -56,10 +57,14 @@ Editor: ☐ Toolbar with play/pause/stop buttons World Hierarchy (Tree View): - ☐ Handle showing Enities with children @high - ☐ Handle adding child entities @high + ☐ If control is held while dropping and entities, reorder the dropped entity instead of parenting + - This will allow for reorganizing the hierarchy + ☐ Add "move up" and "move down" options to the entity context menu + - Another way to reorganize the hierarchy + ✔ Handle showing Enities with children @high @done(22-10-14 18:29) + ✔ Handle adding child entities @high @done(22-10-14 18:29) If an entity was right clicked on the new entity should be a child of the clicked entity - ☐ Handle drag and dropping entities to change the child/parent relationships @high + ✔ Handle drag and dropping entities to change the child/parent relationships @high @done(22-10-14 18:46) Asset Viewer: ✔ Get references to the EditorAsset objects instead of the raw file locations @done(22-06-01 18:48) diff --git a/src/run_modes/editor/panels/world_tree.cpp b/src/run_modes/editor/panels/world_tree.cpp index cb50d5a..bb6f2c7 100644 --- a/src/run_modes/editor/panels/world_tree.cpp +++ b/src/run_modes/editor/panels/world_tree.cpp @@ -165,7 +165,8 @@ namespace lunarium { namespace editor // If the dropped ent is the parent of pEnt then we need to swap the relationship if (pEnt->HasParent() && pEnt->GetParent() == pDroppedEnt->GetUUID()) { - // TODO: Finish Entity Drop Logic + pDroppedEnt->RemoveChild(pEnt->GetUUID()); + pEnt->AddChild(pDroppedEnt->GetUUID()); } // If the dropped ent is already a child of pEnt then we do nothing @@ -192,9 +193,14 @@ namespace lunarium { namespace editor if (pEnt->HasChildren()) { const std::vector& children = pEnt->GetChildren(); - for (auto iter = children.begin(); iter != children.end(); iter++) + // for (auto iter = children.begin(); iter != children.end(); iter++) + // { + // Entity* pe = mpWorld->GetEntity((*iter)); + // ShowEntity(pe); + // } + for (int i = 0; i < children.size(); i++) { - Entity* pe = mpWorld->GetEntity((*iter)); + Entity* pe = mpWorld->GetEntity(children[i]); ShowEntity(pe); } }