From c0453a544d10858672b635de0a75e385c532e333 Mon Sep 17 00:00:00 2001 From: MewPurPur Date: Wed, 21 Jun 2023 19:18:08 +0200 Subject: [PATCH] Fix enum tooltip with no description --- editor/editor_inspector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e3514b4691b..367373dc176 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3184,10 +3184,11 @@ void EditorInspector::update_tree() { if (val.enumeration == enum_name && !val.name.ends_with("_MAX")) { const String enum_value = EditorPropertyNameProcessor::get_singleton()->process_name(val.name, EditorPropertyNameProcessor::STYLE_CAPITALIZED); // Prettify the enum value display, so that "_" becomes "Value". + String desc = DTR(val.description).trim_prefix("\n"); doc_info.description += vformat( "\n[b]%s:[/b] %s", enum_value.trim_prefix(EditorPropertyNameProcessor::get_singleton()->process_name(enum_name, EditorPropertyNameProcessor::STYLE_CAPITALIZED) + " "), - DTR(val.description).trim_prefix("\n")); + desc.is_empty() ? ("[i]" + TTR("No description.") + "[/i]") : desc); } } }