Improve undo redo API and docs#117851
Improve undo redo API and docs#117851Goldenlion5648 wants to merge 1 commit intogodotengine:masterfrom
Conversation
AThousandShips
left a comment
There was a problem hiding this comment.
I don't think the new method aliases is a good idea in addition to these changes, but my request for changes is about the documentation errors
|
If we wanted to totally replace the existing methods, is there a preferred way to deprecate the old ones? |
|
Yes to deprecate them, but I don't think there's any real strong reason to do so here, it creates clutter and confusion I'd say, so there would need to be some concrete demand or need for the change, is there a lot of confusion over these names? |
0a0cc5a to
3f68f79
Compare
dfd11a3 to
9cd9867
Compare
|
Sorry to shoehorn, but I have a proposal to turn UndoRedo into a RefCounted class, to avoid the need to free it manually or otherwise get memory leaks: godotengine/godot-proposals#11868 I'm not saying this PR has to be a full rework of UndoRedo, I wouldn't have mentioned it if the PR was just adding a new method without also doing aesthetic renames and deprecating stuff. But since it does, it seems like a good opportunity to fix the mistakes from the initial implementation in one swoop. |
The API was a bit inconsistent and unclear. This attempts to fix some of that with examples and aliases for existing API methods, and exposing
discard_redo()Fixes godotengine/godot-proposals#14539
The examples can be updated to use bind once #107756 gets merged
Maybe in a followup PR or this one depending on what people think:
get_action_namecould beget_action_name_at_index