|
@@ -337,7 +337,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"));
|
|
@@ -2670,7 +2676,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);
|