Skip to content

Commit

Permalink
Added an another piece of missing code. Now properties arrays work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Mar 8, 2024
1 parent 2e48acd commit 54e735c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand Down

0 comments on commit 54e735c

Please sign in to comment.