summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-09-06 15:20:07 +0200
committerYuri Sizov <yuris@humnom.net>2023-09-06 15:20:07 +0200
commit21c5f86d5d941907c097243e4fb17eced5cae9f3 (patch)
tree5fc9861047d3631b1b1e20b29e4ee80170d0c427
parent2282fc5de992a278e6a4e9c279f4bf8086203b48 (diff)
downloadredot-engine-21c5f86d5d941907c097243e4fb17eced5cae9f3.tar.gz
Check the native base of scripts when resolving icons
-rw-r--r--editor/editor_node.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 81ca218ac0..1f59b74a95 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4208,10 +4208,10 @@ Ref<Texture2D> EditorNode::_get_class_or_script_icon(const String &p_class, cons
}
if (p_fallback_script_to_theme) {
- // Look for the base type in the editor theme.
- // This is only relevant for built-in classes.
- String base_type;
- p_script->get_language()->get_global_class_name(p_script->get_path(), &base_type);
+ // Look for the native base type in the editor theme. This is relevant for
+ // scripts extending other scripts and for built-in classes.
+ String script_class_name = p_script->get_language()->get_global_class_name(p_script->get_path());
+ String base_type = ScriptServer::get_global_class_native_base(script_class_name);
if (gui_base && gui_base->has_theme_icon(base_type, EditorStringName(EditorIcons))) {
return gui_base->get_editor_theme_icon(base_type);
}