Merge pull request #107748 from ydeltastar/fix-eval-properties

Fix `Evaluator`'s format issues caused by special characters in the expression
This commit is contained in:
Thaddeus Crews
2025-08-03 10:51:07 -05:00
2 changed files with 5 additions and 2 deletions

View File

@ -389,7 +389,9 @@ void EditorDebuggerInspector::add_stack_variable(const Array &p_array, int p_off
}
PropertyInfo pinfo;
pinfo.name = type + n;
// Encode special characters to avoid issues with expressions in Evaluator.
// Dots are skipped by uri_encode(), but uri_decode() process them correctly when replaced with "%2E".
pinfo.name = type + n.uri_encode().replace(".", "%2E");
pinfo.type = v.get_type();
pinfo.hint = h;
pinfo.hint_string = hs;
@ -403,7 +405,7 @@ void EditorDebuggerInspector::add_stack_variable(const Array &p_array, int p_off
}
variables->prop_list.insert_before(current, pinfo);
}
variables->prop_values[type + n][0] = v;
variables->prop_values[pinfo.name][0] = v;
variables->update();
edit(variables);
}

View File

@ -3977,6 +3977,7 @@ void EditorInspector::update_tree() {
name_override = name_override.substr(0, dot);
}
}
name_override = name_override.uri_decode();
// Don't localize script variables.
EditorPropertyNameProcessor::Style name_style = property_name_style;