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

Support builtin class methods with varcall #382

Open
Bromeon opened this issue Aug 13, 2023 · 4 comments
Open

Support builtin class methods with varcall #382

Bromeon opened this issue Aug 13, 2023 · 4 comments
Labels
c: engine Godot classes (nodes, resources, ...) feature Adds functionality to the library

Comments

@Bromeon
Copy link
Member

Bromeon commented Aug 13, 2023

The following methods on builtins take varargs and thus follow the varcall convention:

Callable::call
Callable::call_deferred
Callable::rpc
Callable::rpc_id
Callable::bind
Signal::emit

The variant_get_ptr_builtin_method API returns null when invoked for the respective variant types, methods names and hashes.

This likely needs an additional API on GDExtension side.

@Bromeon Bromeon added bug status: upstream Depending on upstream fix (typically Godot) c: engine Godot classes (nodes, resources, ...) labels Aug 13, 2023
@Bromeon
Copy link
Member Author

Bromeon commented Sep 17, 2023

Looks like Godot implemented support for builtin methods via varcall, so we could provide them as well.

@Bromeon Bromeon added feature Adds functionality to the library and removed bug labels Sep 17, 2023
@Bromeon Bromeon mentioned this issue Feb 28, 2024
@Bromeon Bromeon removed the status: upstream Depending on upstream fix (typically Godot) label Apr 3, 2024
@TitanNano
Copy link
Contributor

This is available from 4.2.

@Bromeon Bromeon changed the title Builtin class methods with varcall are not available in GDExtension Support builtin class methods with varcall Aug 31, 2024
@ansdor
Copy link

ansdor commented Dec 13, 2024

I just started using godot-rs and I'm loving it so far, but Callable::bind is a very significant missing piece. Binding arguments to callables is the most convenient way to do some things in godot, such as when you have a list of buttons and you want to connect their "pressed" signals to the same receiving function and you want the buttons to identify themselves to the receiver

I wish I could do this myself but I'm not nearly familiarized enough with godot or godot-rs to write the code. But if there's no more objections on the godot C++ side I'd really love to see this implemented on godot-rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: engine Godot classes (nodes, resources, ...) feature Adds functionality to the library
Projects
None yet
Development

No branches or pull requests

3 participants