godot icon indicating copy to clipboard operation
godot copied to clipboard

Expose EditorUndoRedoManager's `clear_history()`

Open KoBeWi opened this issue 1 year ago • 2 comments

Exposes clear_history() method (I also swapped its arguments, the new order makes more sense). Closes https://github.com/godotengine/godot-proposals/issues/2153

I also exposed EditorUndoRedoManager via EditorInterface, to make it accessible to EditorScripts.

KoBeWi avatar Apr 02 '24 11:04 KoBeWi

I just realized we have EditorInterface.mark_scene_as_unsaved() 🙃 The new method is more general, but it makes the old one redundant.

EDIT: Maybe not completely redundant, as that method adds a generic dirty marker and doesn't clear history.

KoBeWi avatar Apr 02 '24 13:04 KoBeWi

Clearing history is necessary for operations that do changes to the scene which you can't undo them. Also exposing EditorUndoRedoManager is needed for things like #78355 (currently you need an EditorPlugin to use undoredo)

KoBeWi avatar Jun 28 '24 15:06 KoBeWi

Thanks!

akien-mga avatar Aug 30 '24 09:08 akien-mga