From 54e735c1f2e89284bcf65576d7d6451d758e882a Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 8 Mar 2024 11:12:06 +0100 Subject: [PATCH] Added an another piece of missing code. Now properties arrays work. --- editor/editor_inspector.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index d051349c0e..7ff6f8d0f9 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2289,6 +2289,23 @@ void EditorInspector::update_tree() { } } + if (!array_prefix.empty()) { + // If we have an array element, find the according index in array. + String str = p.name.trim_prefix(array_prefix); + int to_char_index = 0; + while (to_char_index < str.length()) { + if (str[to_char_index] < '0' || str[to_char_index] > '9') { + break; + } + to_char_index++; + } + if (to_char_index > 0) { + array_index = str.left(to_char_index).to_int(); + } else { + array_prefix = ""; + } + } + if (!array_prefix.empty()) { path = path.trim_prefix(array_prefix); int char_index = path.find("/");