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

Allow signals to be called without a argument #5001

Closed
IsotoxalDev opened this issue Jul 28, 2022 · 5 comments
Closed

Allow signals to be called without a argument #5001

IsotoxalDev opened this issue Jul 28, 2022 · 5 comments

Comments

@IsotoxalDev
Copy link

Describe the project you are working on

I am working on a UI project that is called GoDAW: A DAW being made using godot.

Describe the problem or limitation you are having in your project

image
If i want to update the grid which is made of draw() function i just need the signal to call the function without any argument. now as a workaround I have to create a function to call the update function

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

If there was an option to connect a signal to a function and don't pass in any argument It would make the code rater clean and reduce me from writing a meaningless function.

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

As of now, godot has this option to add on extra arguments to the connected function. This can be done in the GUI interface of godot using the Advanced CheckButton. In the same menu an option to remove the already set argument would be great!!

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

The work around is as simple as _on_hsplit_dragged(offset): grid.update() but this is extremely inconvinient. when i could have done the same with a signal with no arguments.

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

The signal connect thingy is defined in the core iirc.....

@Mickeon
Copy link

Mickeon commented Jul 28, 2022

Someone correct me if I'm wrong, but because Godot 4 allows arguments to be unbound, this proposal is already done, in a way?

@kleonc
Copy link
Member

kleonc commented Jul 28, 2022

Someone correct me if I'm wrong, but because Godot 4 allows arguments to be unbound, this proposal is already done, in a way?

Yeah:
godot windows tools 64_b805MXn4cH
ANOedG1p2t

The UI in this dialog could definitely be improved though.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 28, 2022

Closing as this is already implemented.

As for the connection dialog UX, there are some PRs that improve it:
godotengine/godot#60478
godotengine/godot#27988
Feel free to open proposals if you have more ideas for improvements.

EDIT:
btw the proposal was duplicate of #762

@IsotoxalDev
Copy link
Author

Can this feature be added to 3.x.

@KoBeWi
Copy link
Member

KoBeWi commented Sep 5, 2022

It can't be done in the same way as 4.0, but I guess for 3.x godotengine/godot#38289 could be revived. It doesn't make sense to add a unique feature in older version of Godot though, so no.

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

5 participants