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

Generate c# method when selecting a signal receiver #2078

Closed
GameScripting opened this issue Jan 5, 2021 · 2 comments
Closed

Generate c# method when selecting a signal receiver #2078

GameScripting opened this issue Jan 5, 2021 · 2 comments

Comments

@GameScripting
Copy link

Describe the project you are working on

Playing arround with godot, working on mini games (dev time <10h)

Describe the problem or limitation you are having in your project

I am using godot with mono/c# as my main scripting language. The IDE I am using is Jetbrains Rider.
When creating a new signal (double click (1)) I select the target node (2), the method name is automatically generated (3) and I click "Connect" (4).

grafik

Now Jetbrains Rider opens the script of the receiver node and nothing more happens.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I would like a feature that automatically adds the receiver method to my c# source code file.
Especially when working with signals that use a lot of parameters (for example the signals in the collision space have a lot of parameters) it is annoying to create the c# method by hand. It would be nice if the method could be auto-added to the c# file.
This feature already exists for gdscript.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  1. The editor should parse the c# source file
  2. Generate the required code
  3. Add it to the c# source file

It could also be implemented in a IDE specific way (for example in the Jetrbains Rider plugin), however a generic solution the is independed from the IDE used would provide more overall value. It could be used by anyone using c# with any IDE.

If this enhancement will not be used often, can it be worked around with a few lines of script?

The required method can be manually added to the c# source file, which is exactly what is required to do now.

Is there a reason why this should be core and not an add-on in the asset library?

The feature is already implemented in gdscript and would provide the same value for c# users. A generic solution that is independed from the IDE would provide more overall value. It could be used by anyone using c# with any IDE.

@GameScripting
Copy link
Author

GameScripting commented Jan 5, 2021

This is my first ever contribution / gh-issue on godot.

--

I am willing to implement this feature by myself, however I have no practical experience with c++.

Is there any way to implement it in c#? In my optinion this feature is only required for the "mono edition" of godot, so mono would always be installed and useable. Using the [Tool] annotation it is already possible to run mono code within the editor (see https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html)

What (which c++ file) would be a good starting point? Would it be possible to create this as a plugin?

@Calinou
Copy link
Member

Calinou commented Jan 5, 2021

Duplicate of godotengine/godot#41283, which should be fixed by godotengine/godot#42416. (This is actually a bug.)

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

No branches or pull requests

2 participants