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

Retrieving argument from a function using .get_method_list() doesnt return type, value and argument name #73215

Closed
KStormStudio opened this issue Feb 13, 2023 · 2 comments
Labels

Comments

@KStormStudio
Copy link

KStormStudio commented Feb 13, 2023

Godot version

4.0 beta 14

System information

Win 11

Issue description

I have a node with 2 or more declared functions. Each function has different argument type and name.
func public_setPositionX(x : float): .. func public_setCaption(caption : String): .. (node is the node with the script with those functions) for p in node.get_method_list(): print(p["args"]) print(p["args"][0]["type"])

I got the same output:
[{ "name": "arg0", "class_name": &"", "type": 0, "hint": 0, "hint_string": "", "usage": 6 }]

So no way to get the argument name as "x" for instance, type and value, how can i do that please?
Thank you very much

Steps to reproduce

func public_setPositionX(x : float):
..
func public_setCaption(caption : String):
..
(node is the node with the script with those functions)
for p in node.get_method_list():
print(p["args"])
print(p["args"][0]["type"])

@KStormStudio KStormStudio changed the title Retrieving argument from a function doesnt return type, value and argument name Retrieving argument from a function using .get_method_list() doesnt return type, value and argument name Feb 13, 2023
@KStormStudio
Copy link
Author

Especially in case of functions with more than a argument that would be essential. Anyone please?

@KoBeWi
Copy link
Member

KoBeWi commented Mar 10, 2023

Looks like duplicate of #33624
The last comment includes a potential workaround.

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants