-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Change make_function
API to work well with different script languages
#12908
Comments
make_function
API to work well with different script languages
The clock is ticking if you want to implement this for 3.0. |
agreed, shuold be done, though i think it should also somehow work with visual script |
Please don't close this in the transition to godotengine/godot-proposals as I plan to implement it myself for 4.0. At least for text based scripts; I haven't thought about visual script yet. |
Just commenting to clarify that this is still relevant despite the issue's age. |
This is still relevant, and there is even a note in code about this limitation. But changing it in 4.x as described would be a breaking change, so we would need to think of a better solution, perhaps. |
I'm no longer convinced about the solution I propose in my original message, because this feature still has problems with external editors, which is what most C# devs use. Perhaps the code could be copied to the clipboard instead (displaying a toast notification). |
This comment was marked as off-topic.
This comment was marked as off-topic.
@JensvandeWiel Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead. |
Issue description:
Currently, the API to add a function to scripts, which is used by the connections dialog, is
ScriptLanguage::make_function(class, name, args)
.This method is expected to return a string with the function's declaration and body. The returned string is appended to the end of the script's source. This may be fine for languages like GDScript, but it won't work for other languages.
This API should be changed to receive
Ref<Script>
and either be expected to modify it or to return its full source code with the newly added function.The text was updated successfully, but these errors were encountered: