Added static method information the generated builtin API JSON
This commit is contained in:
parent
8fddab9209
commit
ec806c5c5b
2 changed files with 5 additions and 2 deletions
|
@ -599,7 +599,7 @@ void GDAPI godot_variant_call_static(godot_variant_type p_type, const godot_stri
|
|||
const Variant **args = (const Variant **)p_args;
|
||||
Variant ret;
|
||||
Callable::CallError error;
|
||||
Variant().call_static(type, *method, args, p_argcount, ret, error);
|
||||
Variant::call_static(type, *method, args, p_argcount, ret, error);
|
||||
memnew_placement_custom(r_return, Variant, Variant(ret));
|
||||
|
||||
if (r_error) {
|
||||
|
@ -615,7 +615,7 @@ void GDAPI godot_variant_call_static_with_cstring(godot_variant_type p_type, con
|
|||
const Variant **args = (const Variant **)p_args;
|
||||
Variant ret;
|
||||
Callable::CallError error;
|
||||
Variant().call_static(type, method, args, p_argcount, ret, error);
|
||||
Variant::call_static(type, method, args, p_argcount, ret, error);
|
||||
memnew_placement_custom(r_return, Variant, Variant(ret));
|
||||
|
||||
if (r_error) {
|
||||
|
|
|
@ -71,6 +71,7 @@ struct MethodAPI {
|
|||
bool is_editor = false;
|
||||
bool is_noscript = false;
|
||||
bool is_const = false;
|
||||
bool is_static = false; // For builtin types.
|
||||
bool is_reverse = false;
|
||||
bool is_virtual = false;
|
||||
bool is_from_script = false;
|
||||
|
@ -528,6 +529,7 @@ List<ClassAPI> generate_c_builtin_api_types() {
|
|||
method_api.argument_count = Variant::get_builtin_method_argument_count(type, method_name);
|
||||
method_api.has_varargs = Variant::is_builtin_method_vararg(type, method_name);
|
||||
method_api.is_const = Variant::is_builtin_method_const(type, method_name);
|
||||
method_api.is_static = Variant::is_builtin_method_static(type, method_name);
|
||||
|
||||
for (int i = 0; i < method_api.argument_count; i++) {
|
||||
method_api.argument_names.push_back(Variant::get_builtin_method_argument_name(type, method_name, i));
|
||||
|
@ -757,6 +759,7 @@ static void write_builtin_method(StringBuilder &p_source, const MethodAPI &p_met
|
|||
append_indented(p_source, vformat(R"("name": "%s",)", p_method.method_name));
|
||||
append_indented(p_source, vformat(R"("return_type": "%s",)", p_method.return_type));
|
||||
append_indented(p_source, vformat(R"("is_const": %s,)", p_method.is_const ? "true" : "false"));
|
||||
append_indented(p_source, vformat(R"("is_static": %s,)", p_method.is_static ? "true" : "false"));
|
||||
append_indented(p_source, vformat(R"("has_varargs": %s,)", p_method.has_varargs ? "true" : "false"));
|
||||
|
||||
append_indented(p_source, R"("arguments": [)");
|
||||
|
|
Loading…
Add table
Reference in a new issue