The first thing to decide is if this should be a soft deletion like in C++ NF or a full object deletion. I prefer hard deletion now since the old version had several instances of code using deleted objects because it wasn't checking the deleted flag. We just have to make sure the code removes all references of the object from other classes. At the moment that should be easy since the only references I can think of a parents and children referencing each other. Will have to be careful in the future to make sure any new code does this too.
Things to complete or check:
[x] Clear Parent on all the objects children
[x] Remove from Children on its parent
[x] Remove from Objects in the Zone the object is in.
[x] Remove from NanoDB. When undo/redo is added we'll probably want temporary soft delete. That can be handled when undo/redo is added.
[x] Delete any renderer data attached to the object. Can check RenderObject.
[x] Clear SelectedObject in MapEditorDocument.
[x] Double check for any other references to objects that need to be cleared which aren't on this list.
[x] Add option to menu bar
[x] Add keybind. Make sure it doesn't work in popups with keybinds disabled.
The first thing to decide is if this should be a soft deletion like in C++ NF or a full object deletion. I prefer hard deletion now since the old version had several instances of code using deleted objects because it wasn't checking the deleted flag. We just have to make sure the code removes all references of the object from other classes. At the moment that should be easy since the only references I can think of a parents and children referencing each other. Will have to be careful in the future to make sure any new code does this too.
Things to complete or check:
Parent
on all the objects childrenChildren
on its parentObjects
in theZone
the object is in.NanoDB
. When undo/redo is added we'll probably want temporary soft delete. That can be handled when undo/redo is added.RenderObject
.SelectedObject
inMapEditorDocument
.