1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Merge pull request #47502 from KoBeWi/add_0

Always add decimal when converting float to string
This commit is contained in:
Thaddeus Crews
2024-10-31 20:14:39 -05:00
31 changed files with 241 additions and 141 deletions

View File

@@ -1371,6 +1371,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_
Dictionary elem = var;
ERR_FAIL_COND_V_MSG(!elem.has(p_name_field), false, vformat("Validate extension JSON: Element of base_array '%s' is missing field '%s'. This is a bug.", base_array, p_name_field));
String name = elem[p_name_field];
if (name.is_valid_float()) {
name = name.trim_suffix(".0"); // Make "integers" stringified as integers.
}
if (p_compare_operators && elem.has("right_type")) {
name += " " + String(elem["right_type"]);
}
@@ -1386,6 +1389,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_
continue;
}
String name = old_elem[p_name_field];
if (name.is_valid_float()) {
name = name.trim_suffix(".0"); // Make "integers" stringified as integers.
}
if (p_compare_operators && old_elem.has("right_type")) {
name += " " + String(old_elem["right_type"]);
}