Merge pull request #82940 from Calinou/editor-tooltip-metadata

Tweak metadata property tooltip to avoid being misleading
This commit is contained in:
Rémi Verschelde 2023-10-09 15:34:45 +02:00
commit a7fcde4dab
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -2875,7 +2875,11 @@ void EditorHelpTooltip::parse_tooltip(const String &p_text) {
if (type == "property") {
description = get_property_description(class_name, property_name);
formatted_text = TTR("Property:");
if (property_name.begins_with("metadata/")) {
formatted_text = TTR("Metadata:");
} else {
formatted_text = TTR("Property:");
}
} else if (type == "method") {
description = get_method_description(class_name, property_name);
formatted_text = TTR("Method:");
@ -2890,7 +2894,8 @@ void EditorHelpTooltip::parse_tooltip(const String &p_text) {
}
}
formatted_text += " [u][b]" + title + "[/b][/u]" + property_args + "\n";
// Metadata special handling replaces "Property:" with "Metadata": above.
formatted_text += " [u][b]" + title.trim_prefix("metadata/") + "[/b][/u]" + property_args + "\n";
formatted_text += description.is_empty() ? "[i]" + TTR("No description available.") + "[/i]" : description;
set_text(formatted_text);
}