diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_player.cpp | 6 | ||||
-rw-r--r-- | scene/gui/control.cpp | 6 | ||||
-rw-r--r-- | scene/main/node.cpp | 4 | ||||
-rw-r--r-- | scene/resources/material.cpp | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 5d200ebf86..f6091f224c 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1493,7 +1493,7 @@ NodePath AnimationPlayer::get_root() const { void AnimationPlayer::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) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif @@ -1502,8 +1502,8 @@ void AnimationPlayer::get_argument_options(const StringName &p_function, int p_i if (p_idx == 0 && (p_function == "play" || p_function == "play_backwards" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue")) { List<StringName> al; get_animation_list(&al); - for (const StringName &E : al) { - r_options->push_back(quote_style + String(E) + quote_style); + for (const StringName &name : al) { + r_options->push_back(String(name).quote(quote_style)); } } Node::get_argument_options(p_function, p_idx, r_options); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d37ccd63ec..f114e06c75 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2602,7 +2602,7 @@ bool Control::is_visibility_clip_disabled() const { void Control::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) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif @@ -2625,8 +2625,8 @@ void Control::get_argument_options(const StringName &p_function, int p_idx, List } sn.sort_custom<StringName::AlphCompare>(); - for (const StringName &E : sn) { - r_options->push_back(quote_style + E + quote_style); + for (const StringName &name : sn) { + r_options->push_back(String(name).quote(quote_style)); } } } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index cbd5fa7425..155af30a6d 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2465,7 +2465,7 @@ NodePath Node::get_import_path() const { static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<String> *r_options) { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif @@ -2474,7 +2474,7 @@ static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<S return; } String n = p_base->get_path_to(p_node); - r_options->push_back(quote_style + n + quote_style); + r_options->push_back(n.quote(quote_style)); for (int i = 0; i < p_node->get_child_count(); i++) { _add_nodes_to_options(p_base, p_node->get_child(i), r_options); } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 08f7274ff6..896a33e02e 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -268,7 +268,7 @@ 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) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif @@ -279,7 +279,7 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id List<PropertyInfo> pl; shader->get_param_list(&pl); for (const PropertyInfo &E : pl) { - r_options->push_back(quote_style + E.name.replace_first("shader_param/", "") + quote_style); + r_options->push_back(E.name.replace_first("shader_param/", "").quote(quote_style)); } } } |