From 957fcb67b1351b1cd0dc913f1702d92426d6db45 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 29 Apr 2022 09:40:20 +0800 Subject: [PATCH] Load fallback icon for custom class when no icon available (cherry picked from commit ba90778f1cb670db34e3d51923456e90b29fa1c4) --- editor/editor_node.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8b3f43291..31985481c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3958,7 +3958,10 @@ Ref EditorNode::get_class_icon(const String &p_class, const String &p_f // We've reached a native class, use its icon. String base_type; script->get_language()->get_global_class_name(script->get_path(), &base_type); - return gui_base->get_icon(base_type, "EditorIcons"); + if (gui_base->has_icon(base_type, "EditorIcons")) { + return gui_base->get_icon(base_type, "EditorIcons"); + } + return gui_base->get_icon(p_fallback, "EditorIcons"); } script = base_script; class_name = EditorNode::get_editor_data().script_class_get_name(script->get_path());