diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 40a6e20c374..9c59547cbab 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -142,7 +142,7 @@ void Tabs::_notification(int p_what) { Ref icon; if (tabs[i].icon.is_valid()) { - Ref icon = tabs[i].icon; + icon = tabs[i].icon; if (icon.is_valid()) { lsize+=icon->get_width(); if (s!="") diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index c4808d0cadd..87983d387c4 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -507,6 +507,14 @@ uint64_t EditorData::get_scene_version(int p_idx) const{ return edited_scene[p_idx].version; } +String EditorData::get_scene_type(int p_idx) const { + + ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),String()); + if (!edited_scene[p_idx].root) + return ""; + return edited_scene[p_idx].root->get_type(); + +} String EditorData::get_scene_title(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),String()); if (!edited_scene[p_idx].root) diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index e3fdd52d015..52e86639f90 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -177,6 +177,7 @@ public: int get_edited_scene_count() const; String get_scene_title(int p_idx) const; String get_scene_path(int p_idx) const; + String get_scene_type(int p_idx) const; void set_edited_scene_version(uint64_t version); uint64_t get_edited_scene_version() const; uint64_t get_scene_version(int p_idx) const; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 7b44f2cad91..ae2eac29cc6 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -110,9 +110,23 @@ void EditorNode::_update_scene_tabs() { scene_tabs->clear_tabs(); for(int i=0;i icon; + if (type!=String()) { + + if (!gui_base->has_icon(type,"EditorIcons")) { + type="Node"; + } + + icon=gui_base->get_icon(type,"EditorIcons"); + + } + int current = editor_data.get_edited_scene(); bool unsaved = (i==current)?saved_version!=editor_data.get_undo_redo().get_version():editor_data.get_scene_version(i)!=0; - scene_tabs->add_tab(editor_data.get_scene_title(i)+(unsaved?"(*)":"")); + scene_tabs->add_tab(editor_data.get_scene_title(i)+(unsaved?"(*)":""),icon); + } scene_tabs->set_current_tab(editor_data.get_edited_scene());