-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add support for exposing/exporting Script Methods to the Editor #4743
Comments
Related to #2149. The linked proposal already has an implementation, so I recommend you give it a try locally. |
Can you be more specific what problem does this solve? If it's about the boolean setter trick to expose custom actions to the inspector, then this is a duplicate of the aforementioned proposal. And in that case, we already have a PR that has been discussed and approved with some pending changes. |
Apologies, I should have checked. Closing now. |
Ah I didn't notice this proposal before. It was opened after our discussion on the chat about The problem with #2149's implementation is that it won't support editor's UndoRedo. The UndoRedo is basically only available from plugins and passing it as an argument to the method might be the only option to resolve this. However it will be impossible when godotengine/godot#59564 gets merged. |
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
Ease of Use and Reusability.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add an Annotation, the name of which can be discussed, that will allow developers to expose/export their Script's Methods to the Editor, allowing them to be run in the Editor. Also expose the UndoRedo Class to GDScript to allow it to be used/passed to Script Methods that are called by the Editor.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Base Example:
One of the drawbacks of the current hack of exposing a Script's Method to the Editor, is that UndoRedo is not supported, which messes with consistency.
To support UndoRedo, any Method called by the Editor with the Annotation will have UndoRedo passed as the first parameter of the Method.
Or, maybe some kind of static/global access to the UndoRedo, instead of passing it as an argument.
User-Parameters may be able to be supported by opening a new Popup that shows an inspector of the Parameters allowing you to fill them in, and a button for calling the Method and one for canceling.
If this enhancement will not be used often, can it be worked around with a few lines of script?
An Editor Plugin can be created, although not ideal.
Is there a reason why this should be core and not an add-on in the asset library?
It requires changing alot of core and editor code.
The text was updated successfully, but these errors were encountered: