diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a4779cb919..824e861a0a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -90,6 +90,7 @@ #include "editor/editor_paths.h" #include "editor/editor_plugin.h" #include "editor/editor_properties.h" +#include "editor/editor_property_name_processor.h" #include "editor/editor_resource_picker.h" #include "editor/editor_resource_preview.h" #include "editor/editor_run.h" @@ -145,6 +146,7 @@ #include "editor/plugins/editor_debugger_plugin.h" #include "editor/plugins/editor_preview_plugins.h" #include "editor/plugins/font_editor_plugin.h" +#include "editor/plugins/gdextension_export_plugin.h" #include "editor/plugins/gpu_particles_2d_editor_plugin.h" #include "editor/plugins/gpu_particles_3d_editor_plugin.h" #include "editor/plugins/gpu_particles_collision_sdf_editor_plugin.h" @@ -701,7 +703,7 @@ void EditorNode::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? TabBar::CLOSE_BUTTON_SHOW_ALWAYS : TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); + scene_tabs->set_tab_close_display_policy((TabBar::CloseButtonDisplayPolicy)EDITOR_GET("interface/scene_tabs/display_close_button").operator int()); bool theme_changed = EditorSettings::get_singleton()->check_changed_settings_in_group("interface/theme") || @@ -3859,18 +3861,18 @@ void EditorNode::register_editor_types() { GDREGISTER_CLASS(EditorScript); GDREGISTER_CLASS(EditorSelection); GDREGISTER_CLASS(EditorFileDialog); - GDREGISTER_VIRTUAL_CLASS(EditorSettings); + GDREGISTER_ABSTRACT_CLASS(EditorSettings); GDREGISTER_CLASS(EditorNode3DGizmo); GDREGISTER_CLASS(EditorNode3DGizmoPlugin); - GDREGISTER_VIRTUAL_CLASS(EditorResourcePreview); + GDREGISTER_ABSTRACT_CLASS(EditorResourcePreview); GDREGISTER_CLASS(EditorResourcePreviewGenerator); - GDREGISTER_VIRTUAL_CLASS(EditorFileSystem); + GDREGISTER_ABSTRACT_CLASS(EditorFileSystem); GDREGISTER_CLASS(EditorFileSystemDirectory); GDREGISTER_CLASS(EditorVCSInterface); - GDREGISTER_VIRTUAL_CLASS(ScriptEditor); - GDREGISTER_VIRTUAL_CLASS(ScriptEditorBase); + GDREGISTER_ABSTRACT_CLASS(ScriptEditor); + GDREGISTER_ABSTRACT_CLASS(ScriptEditorBase); GDREGISTER_CLASS(EditorSyntaxHighlighter); - GDREGISTER_VIRTUAL_CLASS(EditorInterface); + GDREGISTER_ABSTRACT_CLASS(EditorInterface); GDREGISTER_CLASS(EditorExportPlugin); GDREGISTER_CLASS(EditorResourceConversionPlugin); GDREGISTER_CLASS(EditorSceneFormatImporter); @@ -3885,7 +3887,7 @@ void EditorNode::register_editor_types() { GDREGISTER_CLASS(EditorResourcePicker); GDREGISTER_CLASS(EditorScriptPicker); - GDREGISTER_VIRTUAL_CLASS(FileSystemDock); + GDREGISTER_ABSTRACT_CLASS(FileSystemDock); // FIXME: Is this stuff obsolete, or should it be ported to new APIs? GDREGISTER_CLASS(EditorScenePostImport); @@ -5804,6 +5806,9 @@ void EditorNode::notify_settings_changed() { } EditorNode::EditorNode() { + EditorPropertyNameProcessor *epnp = memnew(EditorPropertyNameProcessor); + add_child(epnp); + Input::get_singleton()->set_use_accumulated_input(true); Resource::_get_local_scene_func = _resource_get_edited_scene; @@ -5838,16 +5843,7 @@ EditorNode::EditorNode() { } singleton = this; - exiting = false; - dimmed = false; last_checked_version = 0; - changing_scene = false; - _initializing_addons = false; - docks_visible = true; - restoring_scenes = false; - cmdline_export_mode = false; - scene_distraction = false; - script_distraction = false; TranslationServer::get_singleton()->set_enabled(false); // load settings @@ -6022,10 +6018,10 @@ EditorNode::EditorNode() { ClassDB::set_class_enabled("RootMotionView", true); // defs here, use EDITOR_GET in logic - EDITOR_DEF_RST("interface/scene_tabs/always_show_close_button", false); EDITOR_DEF("interface/editor/save_on_focus_loss", false); EDITOR_DEF("interface/editor/show_update_spinner", false); EDITOR_DEF("interface/editor/update_continuously", false); + EDITOR_DEF("interface/editor/translate_properties", true); EDITOR_DEF_RST("interface/scene_tabs/restore_scenes_on_load", true); EDITOR_DEF_RST("interface/inspector/capitalize_properties", true); EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001); @@ -6247,7 +6243,7 @@ EditorNode::EditorNode() { scene_tabs->set_select_with_rmb(true); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); - scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? TabBar::CLOSE_BUTTON_SHOW_ALWAYS : TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); + scene_tabs->set_tab_close_display_policy((TabBar::CloseButtonDisplayPolicy)EDITOR_GET("interface/scene_tabs/display_close_button").operator int()); scene_tabs->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE); scene_tabs->set_drag_to_rearrange_enabled(true); scene_tabs->connect("tab_changed", callable_mp(this, &EditorNode::_scene_tab_changed)); @@ -6297,7 +6293,7 @@ EditorNode::EditorNode() { scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); scene_root = memnew(SubViewport); - scene_root->set_embed_subwindows_hint(true); + scene_root->set_embedding_subwindows(true); scene_root->set_disable_3d(true); scene_root->set_disable_input(true); @@ -6512,7 +6508,7 @@ EditorNode::EditorNode() { ED_SHORTCUT_OVERRIDE("editor/take_screenshot", "macos", KeyModifierMask::CMD | Key::F12); p->add_shortcut(ED_GET_SHORTCUT("editor/take_screenshot"), EDITOR_SCREENSHOT); - p->set_item_tooltip(p->get_item_count() - 1, TTR("Screenshots are stored in the Editor Data/Settings Folder.")); + p->set_item_tooltip(-1, TTR("Screenshots are stored in the Editor Data/Settings Folder.")); ED_SHORTCUT_AND_COMMAND("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KeyModifierMask::SHIFT | Key::F11); ED_SHORTCUT_OVERRIDE("editor/fullscreen_mode", "macos", KeyModifierMask::CMD | KeyModifierMask::CTRL | Key::F); @@ -7101,6 +7097,11 @@ EditorNode::EditorNode() { EditorExport::get_singleton()->add_export_plugin(export_text_to_binary_plugin); + Ref<GDExtensionExportPlugin> gdextension_export_plugin; + gdextension_export_plugin.instantiate(); + + EditorExport::get_singleton()->add_export_plugin(gdextension_export_plugin); + Ref<PackedSceneEditorTranslationParserPlugin> packed_scene_translation_parser_plugin; packed_scene_translation_parser_plugin.instantiate(); EditorTranslationParser::get_singleton()->add_parser(packed_scene_translation_parser_plugin, EditorTranslationParser::STANDARD); @@ -7109,9 +7110,6 @@ EditorNode::EditorNode() { current = nullptr; saving_resource = Ref<Resource>(); - reference_resource_mem = true; - save_external_resources_mem = true; - set_process(true); open_imported = memnew(ConfirmationDialog); @@ -7122,7 +7120,6 @@ EditorNode::EditorNode() { gui_base->add_child(open_imported); saved_version = 1; - unsaved_cache = true; _last_instantiated_scene = nullptr; quick_open = memnew(EditorQuickOpen); @@ -7136,10 +7133,7 @@ EditorNode::EditorNode() { _update_recent_scenes(); editor_data.restore_editor_global_states(); - convert_old = false; - opening_prev = false; set_process_unhandled_input(true); - _playing_edited = false; load_errors = memnew(RichTextLabel); load_error_dialog = memnew(AcceptDialog); @@ -7180,8 +7174,6 @@ EditorNode::EditorNode() { FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify); - waiting_for_first_scan = true; - print_handler.printfunc = _print_handler; print_handler.userdata = this; add_print_handler(&print_handler); |