summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 71728250a1..0252358a27 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -338,7 +338,13 @@ void EditorNode::_notification(int p_what) {
//_update_icons
for (int i = 0; i < singleton->main_editor_buttons.size(); i++) {
- main_editor_buttons[i]->set_icon(gui_base->get_icon(singleton->main_editor_buttons[i]->get_name(), "EditorIcons"));
+ Ref<Texture> icon = singleton->main_editor_buttons[i]->get_icon();
+
+ if (icon.is_valid()) {
+ main_editor_buttons[i]->set_icon(icon);
+ } else if (singleton->gui_base->has_icon(singleton->main_editor_buttons[i]->get_name(), "EditorIcons")) {
+ main_editor_buttons[i]->set_icon(gui_base->get_icon(singleton->main_editor_buttons[i]->get_name(), "EditorIcons"));
+ }
}
play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons"));
play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons"));
@@ -2673,7 +2679,14 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor) {
tb->set_toggle_mode(true);
tb->connect("pressed", singleton, "_editor_select", varray(singleton->main_editor_buttons.size()));
tb->set_text(p_editor->get_name());
- tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons"));
+ Ref<Texture> icon = p_editor->get_icon();
+
+ if (icon.is_valid()) {
+ tb->set_icon(icon);
+ } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) {
+ tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons"));
+ }
+
tb->set_name(p_editor->get_name());
singleton->main_editor_buttons.push_back(tb);
singleton->main_editor_button_vb->add_child(tb);
@@ -3351,6 +3364,8 @@ void EditorNode::register_editor_types() {
ClassDB::register_virtual_class<EditorInterface>();
ClassDB::register_class<EditorExportPlugin>();
ClassDB::register_class<EditorResourceConversionPlugin>();
+ ClassDB::register_class<EditorSceneImporter>();
+
// FIXME: Is this stuff obsolete, or should it be ported to new APIs?
ClassDB::register_class<EditorScenePostImport>();