-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Make UndoRedo use Callables #43872
Make UndoRedo use Callables #43872
Conversation
Why does CI fail all jobs except Windows builds and static checks? |
Click "Details" next to the failed job to check build logs.
MSVC always have different rules. |
df4ba6f
to
618a0f1
Compare
618a0f1
to
8477791
Compare
Ok, finished this. I had to add CallableCustomBind.get_binds() and with some dynamic casting I managed to resolve the callback issue. It was something with live edit, seems to work now. At least when you change properties in the inspector, but when you move nodes it doesn't seem to synchronize properly, no idea why. |
For the record, I suggest closing this. Using callables in UndoRedo means that contributors will be able to provide function pointers instead of instance/string. This breaks live editing, hence it should not be used. |
In worst case we could determine if a method is relevant for live editing (most of them aren't) and show a warning/error if it can't be a callable. I mean, it could use a callable, but the method just still needs to be bound and we'd provide its name in addition to the callable (right now with my changes the |
Closing, as there is too many conflicts. Could be revisited after #59564 is merged. The status is this: tl;dr this can be revived in the future, but should be done carefully to avoid breaking live edit™ |
Superseded by #66070. |
Not really. The current equivalent of this PR would be making EditorUndoRedoManager use callables, but it has the problems I mentioned in my above comment. |
This PR makes UndoRedo use Callables instead of method names and hardcoded argument list. I added
add_undo_method_compat
and changed all old calls to this. We need to port them later and cleanup needlessly bound methods.Likely fixes #26483
And likely fixes #36895
Sumbitting as draft, because I'm not yet sure what to do with
godot/core/object/undo_redo.cpp
Lines 301 to 303 in 7e009a1
Either I need to figure out how to change it to Callable or extract arguments from callable and push them here. For now this part is commented out, everything else seems to work.
Bugsquad edit: This closes godotengine/godot-proposals#5038.