godot-headers icon indicating copy to clipboard operation
godot-headers copied to clipboard

Default arguments in signals

Open vonagam opened this issue 3 years ago • 2 comments

There are default_args, num_default_args in godot_signal and default_value in godot_signal_argument.

Based on source code for godot_nativescript_register_signal (link to master, there are no changes to relevant part in question since third version) seems like default_args are not used. Instead a number of num_default_args default_values is collected from the start of args for use as defaults.

So seems like either default_args or default_value should be removed.

It seems wrong that default values are collected from the start and not the end of args.

And usage property in godot_signal_argument seems meaningless (it is absent from godot_method_arg for example).

vonagam avatar Apr 22 '21 22:04 vonagam

Excuse me for necroposting, but a quick update: While these args are still present on 3.5 and 3.x, the overhauled 4.0 GDExtension header (#107) does not expose them and whether they’re still present in the source code (I couldn’t search it) is not us header users’ concern.

ParadoxV5 avatar Apr 29 '23 19:04 ParadoxV5

I don't think it is necroposting as it is one of few open issues here. And as I understand until your PR is merged it is still valid one. After that, I guess, it can be close as I don't see default_args in json of your PR.

vonagam avatar May 01 '23 18:05 vonagam