1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Add contains_char() for single-character 'contains' calls.

This commit is contained in:
Lukas Tenbrink
2024-12-05 17:56:08 +01:00
parent eb5103093c
commit b5c31ebb41
61 changed files with 108 additions and 99 deletions

View File

@@ -504,7 +504,7 @@ void AnimationPlayerEditor::_animation_rename() {
String selected_name = animation->get_item_text(selected);
// Remove library prefix if present.
if (selected_name.contains("/")) {
if (selected_name.contains_char('/')) {
selected_name = selected_name.get_slice("/", 1);
}
@@ -537,7 +537,7 @@ void AnimationPlayerEditor::_animation_remove_confirmed() {
ERR_FAIL_COND(al.is_null());
// For names of form lib_name/anim_name, remove library name prefix.
if (current.contains("/")) {
if (current.contains_char('/')) {
current = current.get_slice("/", 1);
}
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
@@ -626,7 +626,7 @@ void AnimationPlayerEditor::_animation_name_edited() {
// Extract library prefix if present.
String new_library_prefix = "";
if (current.contains("/")) {
if (current.contains_char('/')) {
new_library_prefix = current.get_slice("/", 0) + "/";
current = current.get_slice("/", 1);
}
@@ -1340,7 +1340,7 @@ void AnimationPlayerEditor::_animation_duplicate() {
break;
}
if (new_name.contains("/")) {
if (new_name.contains_char('/')) {
// Discard library prefix.
new_name = new_name.get_slice("/", 1);
}