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

EditorUndoRedoManager.create_action() needs more context #10043

Open
TokisanGames opened this issue Oct 4, 2024 · 0 comments
Open

EditorUndoRedoManager.create_action() needs more context #10043

TokisanGames opened this issue Oct 4, 2024 · 0 comments
Labels

Comments

@TokisanGames
Copy link

Your Godot version:
4.2.2, 4.3

URL to the documentation page:
https://docs.godotengine.org/en/stable/classes/class_editorundoredomanager.html#class-editorundoredomanager-method-create-action

Issue description:
EditorUndoRedoManager.create_action() defines a custom_context parameter and states only this information:

If custom_context object is provided, it will be used for deducing target history (instead of using the first operation).

@KoBeWi here provides further explanation that should be added.
godotengine/godot-proposals#2153 (comment)

If the object can be identified as part of a scene, the action will be performed in the context of the scene and mark it as dirty.
Scene actions show as white in History dock, global actions show with "accent color"
Unlike scene actions, the global actions only make the project dirty (you can see * in the Godot's title bar).

The documentation should be expanded with this additional information, which we were able to use in order to link Terrain3D to all of our EditorUndoRedoManager actions which now mark the scene as unsaved without having to implement _get_unsaved_status(). TokisanGames/Terrain3D#508

However note that the above seems contradictory and should be verified for accuracy:

  • 'global actions mark the scene dirty, scene actions don't.' **
  • 'If an object can be identified, actions are done in scene context'
  • 'Scene actions appear white'

** I think this might be the opposite. We linked Terrain3D to our actions, the history is white, an undo action now causes our scenes to be dirty. Before this link, our custom_context was null, our history was still white, but the scenes were not marked as dirty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant