summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-29 08:10:47 +0200
committerGitHub <noreply@github.com>2022-04-29 08:10:47 +0200
commit916f4c3b6349ac4d637eb17854422233d850a32b (patch)
tree1ee21460315e1d3c48ce42c2ca89d96105f0d797
parentce01bf22be45e8f01639d12c8e23235e3412c0f5 (diff)
parentba90778f1cb670db34e3d51923456e90b29fa1c4 (diff)
Merge pull request #60608 from timothyqiu/fallback-icon
Load fallback icon for custom class when no icon available
-rw-r--r--editor/editor_node.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 113f01caae..3d52686378 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4128,7 +4128,10 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
// 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_theme_icon(base_type, "EditorIcons");
+ if (gui_base->has_theme_icon(base_type, "EditorIcons")) {
+ return gui_base->get_theme_icon(base_type, "EditorIcons");
+ }
+ return gui_base->get_theme_icon(p_fallback, "EditorIcons");
}
script = base_script;
class_name = EditorNode::get_editor_data().script_class_get_name(script->get_path());