mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Merge pull request #82940 from Calinou/editor-tooltip-metadata
Tweak metadata property tooltip to avoid being misleading
This commit is contained in:
commit
a7fcde4dab
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user