diff options
author | Mateus Felipe C. C. Pinto <mateusfccp@gmail.com> | 2018-12-17 23:53:54 -0200 |
---|---|---|
committer | Mateus Felipe C. C. Pinto <mateusfccp@gmail.com> | 2018-12-18 12:48:36 -0200 |
commit | ca1935d6f776a789dda9e046e5624ba0715e2671 (patch) | |
tree | 4f8ac3e95c088f1ae8e30b11dbd8dddb1cdc0b78 /scene/resources | |
parent | 0cff752be1f6c6a61ad72bcdf340c06d08277081 (diff) |
Add settings for single-quotes on completion
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/material.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index f6dc60900f..8dffa860e6 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -30,6 +30,10 @@ #include "material.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_settings.h" +#endif + #include "scene/scene_string_names.h" void Material::set_next_pass(const Ref<Material> &p_pass) { @@ -223,6 +227,12 @@ 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_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; +#else + const String quote_style = "\""; +#endif + String f = p_function.operator String(); if ((f == "get_shader_param" || f == "set_shader_param") && p_idx == 0) { @@ -230,7 +240,7 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id List<PropertyInfo> pl; shader->get_param_list(&pl); for (List<PropertyInfo>::Element *E = pl.front(); E; E = E->next()) { - r_options->push_back("\"" + E->get().name.replace_first("shader_param/", "") + "\""); + r_options->push_back(quote_style + E->get().name.replace_first("shader_param/", "") + quote_style); } } } |