1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Refactor editor icon retrieval

This commit is contained in:
willnationsdev
2018-09-02 16:40:51 -05:00
committed by Will Nations
parent 06c8b5a4ff
commit 5436abefe4
29 changed files with 192 additions and 252 deletions

View File

@@ -186,11 +186,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
item->set_collapsed(true);
}
Ref<Texture> icon;
if (p_node->has_meta("_editor_icon"))
icon = p_node->get_meta("_editor_icon");
else
icon = get_icon((has_icon(p_node->get_class(), "EditorIcons") ? p_node->get_class() : String("Object")), "EditorIcons");
Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(p_node, "Node");
item->set_icon(0, icon);
item->set_metadata(0, p_node->get_path());