From 4f721788681533d4c53736bb873fb4e468fcfea9 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Fri, 19 Jul 2019 22:21:30 +0300 Subject: Make custom types more subtle and more useful Implements #6067 (aaronfranke's idea) Fixes #26980 --- editor/animation_track_editor.cpp | 11 +---- editor/editor_data.cpp | 3 -- editor/editor_node.cpp | 92 +++++++++++++++++++++++++++++++++------ editor/editor_node.h | 2 + editor/scene_tree_dock.cpp | 11 +++-- editor/scene_tree_editor.cpp | 18 ++++++-- 6 files changed, 105 insertions(+), 32 deletions(-) (limited to 'editor') diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index f5b5cfa848..d1ac69c8d8 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1274,12 +1274,7 @@ void AnimationTrackEdit::_notification(int p_what) { } text_color.a *= 0.7; } else if (node) { - Ref icon; - if (has_icon(node->get_class(), "EditorIcons")) { - icon = get_icon(node->get_class(), "EditorIcons"); - } else { - icon = get_icon("Node", "EditorIcons"); - } + Ref icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); draw_texture(icon, Point2(ofs, int(get_size().height - icon->get_height()) / 2)); icon_cache = icon; @@ -3500,9 +3495,7 @@ void AnimationTrackEditor::_update_tracks() { if (root && root->has_node(base_path)) { Node *n = root->get_node(base_path); if (n) { - if (has_icon(n->get_class(), "EditorIcons")) { - icon = get_icon(n->get_class(), "EditorIcons"); - } + icon = EditorNode::get_singleton()->get_object_icon(n, "Node"); name = n->get_name(); tooltip = root->get_path_to(n); } diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 38f30df169..f5846c10f6 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -499,7 +499,6 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i for (int i = 0; i < get_custom_types()[p_inherits].size(); i++) { if (get_custom_types()[p_inherits][i].name == p_type) { - Ref icon = get_custom_types()[p_inherits][i].icon; Ref