Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose EditorUndoRedoManager's clear_history() #90130

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 2, 2024

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

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

@KoBeWi KoBeWi added this to the 4.x milestone Apr 2, 2024
@KoBeWi KoBeWi requested review from a team as code owners April 2, 2024 11:36
@KoBeWi KoBeWi force-pushed the erased_from_history branch from b22d8cb to d4d187c Compare April 2, 2024 13:59
@KoBeWi
Copy link
Member Author

KoBeWi commented Apr 2, 2024

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 KoBeWi force-pushed the erased_from_history branch 3 times, most recently from 6643a70 to 4a450bc Compare April 3, 2024 07:40
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the benefit of this at the moment, but it's not exactly "harmful" either.

doc/classes/EditorUndoRedoManager.xml Outdated Show resolved Hide resolved
doc/classes/EditorUndoRedoManager.xml Outdated Show resolved Hide resolved
@KoBeWi
Copy link
Member Author

KoBeWi commented Jun 28, 2024

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 KoBeWi force-pushed the erased_from_history branch from e92f36b to f2c3c72 Compare June 29, 2024 18:25
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me

@KoBeWi KoBeWi force-pushed the erased_from_history branch from f2c3c72 to ad7a2d1 Compare August 29, 2024 17:23
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Aug 30, 2024
@akien-mga akien-mga merged commit 1e57671 into godotengine:master Aug 30, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the erased_from_history branch August 30, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way for plugins to signal that they've made unsaved changes to a scene
4 participants