diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c3e15f2840..21f1d05304 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -92,7 +92,6 @@ #include "editor/filesystem_dock.h" #include "editor/import/editor_import_collada.h" #include "editor/import/resource_importer_bitmask.h" -#include "editor/import/resource_importer_csv.h" #include "editor/import/resource_importer_csv_translation.h" #include "editor/import/resource_importer_image.h" #include "editor/import/resource_importer_layered_texture.h" @@ -102,6 +101,7 @@ #include "editor/import/resource_importer_texture.h" #include "editor/import/resource_importer_texture_atlas.h" #include "editor/import/resource_importer_wav.h" +#include "editor/import/scene_import_settings.h" #include "editor/import/scene_importer_mesh_node_3d.h" #include "editor/import_dock.h" #include "editor/multi_node_edit.h" @@ -592,6 +592,9 @@ void EditorNode::_notification(int p_what) { _editor_select(EDITOR_3D); } + // Save the project after opening to mark it as last modified. + ProjectSettings::get_singleton()->save(); + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ } break; @@ -1378,14 +1381,14 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { } else if (c3d < c2d) { Ref<ViewportTexture> viewport_texture = scene_root->get_texture(); if (viewport_texture->get_width() > 0 && viewport_texture->get_height() > 0) { - img = viewport_texture->get_data(); + img = viewport_texture->get_image(); } } else { // The 3D editor may be disabled as a feature, but scenes can still be opened. // This check prevents the preview from regenerating in case those scenes are then saved. Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile(); if (profile.is_valid() && !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) { - img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); + img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_image(); } } @@ -2832,7 +2835,7 @@ void EditorNode::_save_screenshot(NodePath p_path) { ERR_FAIL_COND_MSG(!viewport, "Cannot get editor main control viewport."); Ref<ViewportTexture> texture = viewport->get_texture(); ERR_FAIL_COND_MSG(texture.is_null(), "Cannot get editor main control viewport texture."); - Ref<Image> img = texture->get_data(); + Ref<Image> img = texture->get_image(); ERR_FAIL_COND_MSG(img.is_null(), "Cannot get editor main control viewport texture image."); Error error = img->save_png(p_path); ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'."); @@ -4835,15 +4838,15 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { if (mb.is_valid()) { if (scene_tabs->get_hovered_tab() >= 0) { - if (mb->get_button_index() == BUTTON_MIDDLE && mb->is_pressed()) { + if (mb->get_button_index() == MOUSE_BUTTON_MIDDLE && mb->is_pressed()) { _scene_tab_closed(scene_tabs->get_hovered_tab()); } } else { - if ((mb->get_button_index() == BUTTON_LEFT && mb->is_doubleclick()) || (mb->get_button_index() == BUTTON_MIDDLE && mb->is_pressed())) { + if ((mb->get_button_index() == MOUSE_BUTTON_LEFT && mb->is_doubleclick()) || (mb->get_button_index() == MOUSE_BUTTON_MIDDLE && mb->is_pressed())) { _menu_option_confirm(FILE_NEW_SCENE, true); } } - if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) { + if (mb->get_button_index() == MOUSE_BUTTON_RIGHT && mb->is_pressed()) { // context menu scene_tabs_context_menu->clear(); scene_tabs_context_menu->set_size(Size2(1, 1)); @@ -5105,8 +5108,8 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) { { //todo make proper previews - Ref<ImageTexture> pic = gui_base->get_theme_icon("FileBigThumb", "EditorIcons"); - Ref<Image> img = pic->get_data(); + Ref<ImageTexture> texture = gui_base->get_theme_icon("FileBigThumb", "EditorIcons"); + Ref<Image> img = texture->get_image(); img = img->duplicate(); img->resize(48, 48); //meh Ref<ImageTexture> resized_pic = Ref<ImageTexture>(memnew(ImageTexture)); @@ -5778,10 +5781,6 @@ EditorNode::EditorNode() { import_csv_translation.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_csv_translation); - Ref<ResourceImporterCSV> import_csv; - import_csv.instance(); - ResourceFormatImporter::get_singleton()->add_importer(import_csv); - Ref<ResourceImporterWAV> import_wav; import_wav.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_wav); @@ -6179,6 +6178,9 @@ EditorNode::EditorNode() { project_settings = memnew(ProjectSettingsEditor(&editor_data)); gui_base->add_child(project_settings); + scene_import_settings = memnew(SceneImportSettings); + gui_base->add_child(scene_import_settings); + export_template_manager = memnew(ExportTemplateManager); gui_base->add_child(export_template_manager); @@ -6467,8 +6469,8 @@ EditorNode::EditorNode() { video_driver->connect("item_selected", callable_mp(this, &EditorNode::_video_driver_selected)); video_driver->add_theme_font_override("font", gui_base->get_theme_font("bold", "EditorFonts")); video_driver->add_theme_font_size_override("font_size", gui_base->get_theme_font_size("bold_size", "EditorFonts")); - // TODO re-enable when GLES2 is ported - video_driver->set_disabled(true); + // TODO: Show again when OpenGL is ported. + video_driver->set_visible(false); right_menu_hb->add_child(video_driver); #ifndef _MSC_VER |