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.cpp72
1 files changed, 21 insertions, 51 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ef744d8ece..5fe2172771 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"
@@ -725,14 +726,10 @@ void EditorNode::_notification(int p_what) {
help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
}
- if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) {
- scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE);
- } else {
- scene_tabs->set_min_width(0);
- }
+ scene_tabs->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE);
_update_scene_tabs();
- recent_scenes->set_as_minsize();
+ recent_scenes->reset_size();
// debugger area
if (EditorDebuggerNode::get_singleton()->is_visible()) {
@@ -807,10 +804,6 @@ void EditorNode::_notification(int p_what) {
_update_update_spinner();
} break;
-
- case Control::NOTIFICATION_RESIZED: {
- _update_scene_tabs();
- } break;
}
}
@@ -3791,7 +3784,7 @@ void EditorNode::_update_recent_scenes() {
recent_scenes->add_separator();
recent_scenes->add_shortcut(ED_SHORTCUT("editor/clear_recent", TTR("Clear Recent Scenes")));
- recent_scenes->set_as_minsize();
+ recent_scenes->reset_size();
}
void EditorNode::_quick_opened() {
@@ -3866,18 +3859,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);
@@ -3892,7 +3885,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);
@@ -5432,7 +5425,7 @@ void EditorNode::remove_tool_menu_item(const String &p_name) {
memdelete(n);
}
tool_menu->remove_item(i);
- tool_menu->set_as_minsize();
+ tool_menu->reset_size();
return;
}
}
@@ -5496,7 +5489,7 @@ void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, Str
}
void EditorNode::_file_access_close_error_notify(const String &p_str) {
- add_io_error("Unable to write to file '" + p_str + "', file in use, locked or lacking permissions.");
+ add_io_error(vformat(TTR("Unable to write to file '%s', file in use, locked or lacking permissions."), p_str));
}
void EditorNode::reload_scene(const String &p_path) {
@@ -5811,6 +5804,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;
@@ -5845,16 +5841,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
@@ -6030,18 +6017,11 @@ EditorNode::EditorNode() {
// defs here, use EDITOR_GET in logic
EDITOR_DEF_RST("interface/scene_tabs/always_show_close_button", false);
- EDITOR_DEF_RST("interface/scene_tabs/resize_if_many_tabs", true);
- EDITOR_DEF_RST("interface/scene_tabs/minimum_width", 50);
- EDITOR_DEF("run/output/always_clear_output_on_play", true);
- EDITOR_DEF("run/output/always_open_output_on_play", true);
- EDITOR_DEF("run/output/always_close_output_on_stop", true);
- EDITOR_DEF("run/auto_save/save_before_running", true);
EDITOR_DEF("interface/editor/save_on_focus_loss", false);
- EDITOR_DEF_RST("interface/editor/save_each_scene_on_quit", true);
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/scene_tabs/show_thumbnail_on_hover", true);
EDITOR_DEF_RST("interface/inspector/capitalize_properties", true);
EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "interface/inspector/default_float_step", PROPERTY_HINT_RANGE, "0,1,0"));
@@ -6055,7 +6035,6 @@ EditorNode::EditorNode() {
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW", PROPERTY_USAGE_DEFAULT));
EDITOR_DEF("interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_VHS_CIRCLE);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_shape", PROPERTY_HINT_ENUM, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle", PROPERTY_USAGE_DEFAULT));
- EDITOR_DEF("run/auto_save/save_before_running", true);
ED_SHORTCUT("canvas_item_editor/pan_view", TTR("Pan View"), Key::SPACE);
@@ -6211,7 +6190,7 @@ EditorNode::EditorNode() {
dock_vb->add_child(dock_float);
- dock_select_popup->set_as_minsize();
+ dock_select_popup->reset_size();
dock_select_rect_over = -1;
dock_popup_selected = -1;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
@@ -6263,8 +6242,8 @@ 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_DEF("interface/scene_tabs/always_show_close_button", false)) ? TabBar::CLOSE_BUTTON_SHOW_ALWAYS : TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY));
- scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE);
+ 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_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));
scene_tabs->connect("tab_button_pressed", callable_mp(this, &EditorNode::_scene_tab_script_edited));
@@ -6528,7 +6507,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);
@@ -7124,9 +7103,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);
@@ -7137,7 +7113,6 @@ EditorNode::EditorNode() {
gui_base->add_child(open_imported);
saved_version = 1;
- unsaved_cache = true;
_last_instantiated_scene = nullptr;
quick_open = memnew(EditorQuickOpen);
@@ -7151,10 +7126,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);
@@ -7195,8 +7167,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);