diff options
author | Juan Linietsky <red@kyoko> | 2015-07-24 14:18:02 -0300 |
---|---|---|
committer | Juan Linietsky <red@kyoko> | 2015-07-24 14:18:02 -0300 |
commit | d50ebbb441cd6e1d2227d26cc168e76c7bff2b62 (patch) | |
tree | 2e8b6276834b84835baa0984327964179f7179e9 /tools | |
parent | 257dba9a4a545a3e2ff7da3dab348899245fd998 (diff) |
-added icons for root node types on tabs
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_data.cpp | 8 | ||||
-rw-r--r-- | tools/editor/editor_data.h | 1 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 16 |
3 files changed, 24 insertions, 1 deletions
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index c4808d0cad..87983d387c 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 e3fdd52d01..52e86639f9 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 7b44f2cad9..ae2eac29cc 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<editor_data.get_edited_scene_count();i++) { + + String type=editor_data.get_scene_type(i); + Ref<Texture> 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()); |