10 Days Ago
Improved undo system (#1775) **Goal:** Move away from snapshotting whole scenes as much as possible. Get rid of edit log, mouse up hack and other stuff. The documentation for the new system serves as a nice summary for the API changes added in this PR: https://docs.facepunch.com/doc/scene-undo-system-d4mhnmtil1 Changes: - Fixes a third of our undo actions, which were partially or completely broken - Removes EditLog and replaces it with scope based undo system. - UndoScopes define what objects and events are captured for undo. - Internal system automatically generates a minimal snapshot of all changes made and restores them on undo/redo - Full Scene is only captured when an Gameobject or Component is deleted. - This should make the new system faster and "snappier" - Removes the mouse up/undo accumulation hack; By adding `StartEdit/FinishEdit` events to our `ControlWidgets` & `SerializedObject`. Obsolete: - ISceneEditorSession.AddSelectionUndo & SceneEditorSession.OnEditLog - ISceneEditorSession.OnEditLog & SceneEditorSession.OnEditLog - ISceneEditorSession.RecordChange & SceneEditorSession.RecordChange - SceneEditorSession.PushUndoSelection - SceneEditorSession.FullUndoSnapshot - UndoSystem.SetSnapshotFunction - UndoSystem.Snapshot - GameObject.EditLog - Component.EditLog Resolves [#4477](sbox-issues/issues/4477)