From ca1935d6f776a789dda9e046e5624ba0715e2671 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Mon, 17 Dec 2018 23:53:54 -0200 Subject: Add settings for single-quotes on completion --- scene/resources/material.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scene/resources') 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 &p_pass) { @@ -223,6 +227,12 @@ void ShaderMaterial::_bind_methods() { void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List *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 pl; shader->get_param_list(&pl); for (List::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); } } } -- cgit v1.2.3