From d4555ef5fbf706c43faccf5fdb3f023696197727 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 30 Aug 2022 12:36:24 +0300 Subject: Add `String.to_{camel,pascal,snake}_case` methods --- editor/plugins/bone_map_editor_plugin.cpp | 2 +- editor/plugins/script_text_editor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index c16dca00a3..988f9cc394 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -609,7 +609,7 @@ int BoneMapper::search_bone_by_name(Skeleton3D *p_skeleton, Vector p_pic } BoneMapper::BoneSegregation BoneMapper::guess_bone_segregation(String p_bone_name) { - String fixed_bn = p_bone_name.camelcase_to_underscore().to_lower(); + String fixed_bn = p_bone_name.to_snake_case(); LocalVector left_words; left_words.push_back("(?get_name()).camelcase_to_underscore(true).validate_identifier(); + String variable_name = String(node->get_name()).to_snake_case().validate_identifier(); if (use_type) { text_to_drop += vformat("@onready var %s: %s = %s%s\n", variable_name, node->get_class_name(), is_unique ? "%" : "$", path); } else { -- cgit v1.2.3