diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-10-01 17:06:48 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-10-04 16:16:05 +0200 |
commit | b85dfd990e26ffb22643d78e5f00ba135d1f97e7 (patch) | |
tree | 49a5a867b3f89af045b565c832716821b6f91a98 /scene/resources | |
parent | 865b62b1cddbb7989bc520eed2d8428c6923fee9 (diff) |
GDScript completion: Handle quote style ad-hoc to remove editor dependency
`core` and `scene` shouldn't depend on `editor`, so they can't query this style
setting in `get_argument_options`. But we can handle it after the fact in
GDScript's completion code.
Also cleans up a couple extra unused invalid includes in `core`.
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/material.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 3a6af3afb0..08851dbc58 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -32,11 +32,6 @@ #include "core/config/engine.h" #include "core/version.h" - -#ifdef TOOLS_ENABLED -#include "editor/editor_settings.h" -#endif - #include "scene/main/scene_tree.h" #include "scene/scene_string_names.h" @@ -268,19 +263,13 @@ void ShaderMaterial::_bind_methods() { } void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { -#ifdef TOOLS_ENABLED - const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; -#else - const String quote_style = "\""; -#endif - String f = p_function.operator String(); if ((f == "get_shader_param" || f == "set_shader_param") && p_idx == 0) { if (shader.is_valid()) { List<PropertyInfo> pl; shader->get_param_list(&pl); for (const PropertyInfo &E : pl) { - r_options->push_back(E.name.replace_first("shader_param/", "").quote(quote_style)); + r_options->push_back(E.name.replace_first("shader_param/", "").quote()); } } } |