diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-09 11:27:31 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-09 11:27:31 +0100 |
commit | a50a6b9400a843d44756c3e45362af4db2df6489 (patch) | |
tree | 1b5a8b7ff3a5615cf0448aadc3c2315df73df742 /servers/rendering_server.cpp | |
parent | e1f3a56bde093a9436839804bb8909d5399dcfd2 (diff) | |
parent | 472e3b3ad5beed13b1f53f904ca809da081f5bb0 (diff) | |
download | redot-engine-a50a6b9400a843d44756c3e45362af4db2df6489.tar.gz |
Merge pull request #86798 from Mickeon/autocompletion-rendering-server
Add autocompletion for RenderingServer's global shader methods & `has_os_feature`
Diffstat (limited to 'servers/rendering_server.cpp')
-rw-r--r-- | servers/rendering_server.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index e8708e8da8..2d61e47062 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2204,6 +2204,25 @@ void RenderingServer::fix_surface_compatibility(SurfaceData &p_surface, const St } #endif +#ifdef TOOLS_ENABLED +void RenderingServer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { + String pf = p_function; + if (p_idx == 0) { + if (pf == "global_shader_parameter_set" || pf == "global_shader_parameter_set_override" || + pf == "global_shader_parameter_get" || pf == "global_shader_parameter_get_type" || pf == "global_shader_parameter_remove") { + for (StringName E : global_shader_parameter_get_list()) { + r_options->push_back(E.operator String().quote()); + } + } else if (pf == "has_os_feature") { + for (String E : { "\"rgtc\"", "\"s3tc\"", "\"bptc\"", "\"etc\"", "\"etc2\"", "\"astc\"" }) { + r_options->push_back(E); + } + } + } + Object::get_argument_options(p_function, p_idx, r_options); +} +#endif + void RenderingServer::_bind_methods() { BIND_CONSTANT(NO_INDEX_ARRAY); BIND_CONSTANT(ARRAY_WEIGHTS_SIZE); |