Added an another piece of missing code. Now properties arrays work.

This commit is contained in:
Relintai 2024-03-08 11:12:06 +01:00
parent 2e48acd426
commit 54e735c1f2

View File

@ -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("/");