godot
godot copied to clipboard
Implement `ClassDB::class_call_static_method`
Implements a method to allow users to call static methods thru ClassDB
The function signature is as follows:
ClassDB::class_call_static_method(class: StringName, method: StringName, ...) -> Variant
I'll look at a fix for the godot-cpp error with bound names, would be relevant to just prefix with p_ there to prevent these errors
Edit: There's already fixes for this in some cases, will see where they are missing for this particular case
Edit 2: Done:
- https://github.com/godotengine/godot-cpp/pull/1490
Edit 3: my bad misses this open fix:
- https://github.com/godotengine/godot-cpp/pull/1485
PR https://github.com/godotengine/godot-cpp/pull/1485 was cherry-picked, so tests here should pass. I just kicked off another test run, so we'll see!
Status update?
Thanks!
Thank you, too! I'm one more commit away from becoming accredited contributor :tada:
It looks like one of my remarks from the original PR got lost here, I never got a response.
Apart from that, what do you think about naming it
class_call_staticinstead ofclass_call_static_method? Simply because that's consistent withObject::call, which isn't namedObject::call_methodeither.
It's a minor thing, but there's another small point besides consistency: in case there are going to be variants of this method in the future (similar to call + call_deferred), we might benefit from a slightly shorter name.
As it's planned for 4.4, we can still change it. That said, if everyone is OK with the current name, that's fine as well, I just wanted to make sure this is a conscious choice. Overall this is a great PR! :slightly_smiling_face:
Ah, I agree that class_call_static (without _method) is a better name. Who would like to make a PR for that?
I can create one in the next few days 👍