diff options
Diffstat (limited to 'editor/editor_help.cpp')
| -rw-r--r-- | editor/editor_help.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 6004591bb2..6e3b5b7b9e 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2264,7 +2264,12 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, Control p_rt->push_strikethrough(); pos = brk_end + 1; tag_stack.push_front(tag); - + } else if (tag == "lb") { + p_rt->add_text("["); + pos = brk_end + 1; + } else if (tag == "rb") { + p_rt->add_text("]"); + pos = brk_end + 1; } else if (tag == "url") { int end = bbcode.find("[", brk_end); if (end == -1) { @@ -2850,7 +2855,7 @@ void EditorHelpTooltip::_notification(int p_what) { // `p_text` is expected to be something like these: // - `class|Control||`; // - `property|Control|size|`; -// - `signal|Control|gui_input|(event: InputEvent)` +// - `signal|Control|gui_input|(event: InputEvent)`. void EditorHelpTooltip::parse_tooltip(const String &p_text) { tooltip_text = p_text; @@ -2875,7 +2880,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 +2899,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.replace("[", "[lb]") + "\n"; formatted_text += description.is_empty() ? "[i]" + TTR("No description available.") + "[/i]" : description; set_text(formatted_text); } |
