diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/SCsub | 2 | ||||
-rw-r--r-- | editor/editor_audio_buses.cpp | 52 | ||||
-rw-r--r-- | editor/editor_audio_buses.h | 4 | ||||
-rw-r--r-- | editor/editor_export.cpp | 2 | ||||
-rw-r--r-- | editor/editor_fonts.cpp | 10 | ||||
-rw-r--r-- | editor/editor_log.cpp | 15 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 348 | ||||
-rw-r--r-- | editor/editor_settings.h | 8 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 3 | ||||
-rw-r--r-- | editor/icons/icon_status_error.svg | 7 | ||||
-rw-r--r-- | editor/icons/icon_status_success.svg | 7 | ||||
-rw-r--r-- | editor/icons/icon_status_warning.svg | 7 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_manager.cpp | 343 | ||||
-rw-r--r-- | editor/project_manager.h | 4 | ||||
-rw-r--r-- | editor/property_editor.cpp | 2 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | editor/settings_config_dialog.cpp | 1 |
18 files changed, 507 insertions, 312 deletions
diff --git a/editor/SCsub b/editor/SCsub index 315865ad32..bf88ebb1b5 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -395,8 +395,8 @@ def _make_doc_data_class_path(to_path): g.write("{NULL,NULL}\n") g.write("};\n") -if (env["tools"] == "yes"): +if env['tools']: # Register exporters reg_exporters_inc = '#include "register_exporters.h"\n' reg_exporters = 'void register_exporters() {\n' diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b74bd3ab43..bdd297b56c 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -64,6 +64,8 @@ void EditorAudioBus::_notification(int p_what) { if (has_focus()) { draw_style_box(get_stylebox("focus", "Button"), Rect2(Vector2(), get_size())); + } else if (is_master) { + draw_style_box(get_stylebox("disabled", "Button"), Rect2(Vector2(), get_size())); } } @@ -123,7 +125,7 @@ void EditorAudioBus::_notification(int p_what) { void EditorAudioBus::update_send() { send->clear(); - if (get_index() == 0) { + if (is_master) { send->set_disabled(true); send->set_text(TTR("Speakers")); } else { @@ -154,7 +156,7 @@ void EditorAudioBus::update_bus() { slider->set_value(AudioServer::get_singleton()->get_bus_volume_db(index)); track_name->set_text(AudioServer::get_singleton()->get_bus_name(index)); - if (get_index() == 0) + if (is_master) track_name->set_editable(false); solo->set_pressed(AudioServer::get_singleton()->is_bus_solo(index)); @@ -237,6 +239,8 @@ void EditorAudioBus::_name_changed(const String &p_new_name) { ur->commit_action(); updating_bus = false; + + track_name->release_focus(); } void EditorAudioBus::_volume_db_changed(float p_db) { @@ -619,10 +623,11 @@ void EditorAudioBus::_bind_methods() { ADD_SIGNAL(MethodInfo("dropped")); } -EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { +EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { buses = p_buses; updating_bus = false; + is_master = p_is_master; set_tooltip(TTR("Audio Bus, Drag and Drop to rearrange.")); @@ -630,24 +635,15 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { add_child(vb); set_v_size_flags(SIZE_EXPAND_FILL); + set_custom_minimum_size(Size2(100, 0) * EDSCALE); - HBoxContainer *head = memnew(HBoxContainer); track_name = memnew(LineEdit); - head->add_child(track_name); track_name->connect("text_entered", this, "_name_changed"); track_name->connect("focus_exited", this, "_name_focus_exit"); - track_name->set_h_size_flags(SIZE_EXPAND_FILL); - - bus_options = memnew(MenuButton); - bus_options->set_h_size_flags(SIZE_SHRINK_END); - bus_options->set_tooltip(TTR("Bus options")); - head->add_child(bus_options); - - vb->add_child(head); + vb->add_child(track_name); HBoxContainer *hbc = memnew(HBoxContainer); vb->add_child(hbc); - hbc->add_spacer(); solo = memnew(ToolButton); solo->set_toggle_mode(true); solo->set_tooltip(TTR("Solo")); @@ -668,6 +664,23 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { hbc->add_child(bypass); hbc->add_spacer(); + bus_options = memnew(MenuButton); + bus_options->set_h_size_flags(SIZE_SHRINK_END); + bus_options->set_anchor(MARGIN_RIGHT, 0.0); + bus_options->set_tooltip(TTR("Bus options")); + hbc->add_child(bus_options); + + Ref<StyleBoxEmpty> sbempty = memnew(StyleBoxEmpty); + for (int i = 0; i < hbc->get_child_count(); i++) { + Control *child = Object::cast_to<Control>(hbc->get_child(i)); + child->add_style_override("normal", sbempty); + child->add_style_override("hover", sbempty); + child->add_style_override("focus", sbempty); + child->add_style_override("pressed", sbempty); + } + + vb->add_child(memnew(HSeparator)); + HBoxContainer *hb = memnew(HBoxContainer); vb->add_child(hb); slider = memnew(VSlider); @@ -699,8 +712,6 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { scale = memnew(TextureRect); hb->add_child(scale); - //add_child(hb); - effects = memnew(Tree); effects->set_hide_root(true); effects->set_custom_minimum_size(Size2(0, 100) * EDSCALE); @@ -744,7 +755,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { bus_popup = bus_options->get_popup(); bus_popup->add_item(TTR("Duplicate")); - bus_popup->add_item(TTR("Delete")); + if (!is_master) + bus_popup->add_item(TTR("Delete")); bus_popup->add_item(TTR("Reset Volume")); bus_popup->connect("index_pressed", this, "_bus_popup_pressed"); @@ -787,10 +799,8 @@ void EditorAudioBuses::_update_buses() { for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - EditorAudioBus *audio_bus = memnew(EditorAudioBus(this)); - if (i == 0) { - audio_bus->set_self_modulate(Color(1, 0.9, 0.9)); - } + bool is_master = i == 0 ? true : false; + EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master)); bus_hb->add_child(audio_bus); audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED); audio_bus->connect("duplicate_request", this, "_duplicate_bus", varray(), CONNECT_DEFERRED); diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index dba1b73295..995def468c 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -84,6 +84,8 @@ class EditorAudioBus : public PanelContainer { bool updating_bus; + bool is_master; + void _gui_input(const Ref<InputEvent> &p_event); void _bus_popup_pressed(int p_option); @@ -120,7 +122,7 @@ public: void update_bus(); void update_send(); - EditorAudioBus(EditorAudioBuses *p_buses = NULL); + EditorAudioBus(EditorAudioBuses *p_buses = NULL, bool p_is_master = false); }; class EditorAudioBusDrop : public Panel { diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 4caf2641fc..db12998dd2 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -273,6 +273,8 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) } Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { + if (p_path.ends_with(".so") || p_path.ends_with(".dylib") || p_path.ends_with(".dll")) + return OK; PackData *pd = (PackData *)p_userdata; diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 6e5726a16d..110b2a6a8c 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -158,6 +158,16 @@ void editor_register_fonts(Ref<Theme> p_theme) { p_theme->set_font("doc_source", "EditorFonts", df_doc_code); + Ref<DynamicFont> df_output_code; + df_output_code.instance(); + df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE); + df_output_code->set_spacing(DynamicFont::SPACING_TOP, -EDSCALE); + df_output_code->set_spacing(DynamicFont::SPACING_BOTTOM, -EDSCALE); + df_output_code->set_font_data(dfmono); + MAKE_FALLBACKS(df_output_code); + + p_theme->set_font("output_source", "EditorFonts", df_output_code); + //replace default theme Ref<Texture> di; Ref<StyleBox> ds; diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 481f2aaecf..3b20660013 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -31,6 +31,7 @@ #include "editor_node.h" #include "scene/gui/center_container.h" +#include "scene/resources/dynamic_font.h" #include "version.h" void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) { @@ -51,7 +52,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f self->emit_signal("show_request"); */ - err_str = " " + err_str; self->add_message(err_str, true); } @@ -60,6 +60,13 @@ void EditorLog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { //button->set_icon(get_icon("Console","EditorIcons")); + log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + } else if (p_what == NOTIFICATION_THEME_CHANGED) { + Ref<DynamicFont> df_output_code = get_font("output_source", "EditorFonts"); + if (df_output_code.is_valid()) { + df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE); + log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + } } /*if (p_what==NOTIFICATION_DRAW) { @@ -85,15 +92,13 @@ void EditorLog::clear() { void EditorLog::add_message(const String &p_msg, bool p_error) { - Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts"); - log->push_font(doc_code_font); - log->add_newline(); if (p_error) { log->push_color(get_color("error_color", "Editor")); Ref<Texture> icon = get_icon("Error", "EditorIcons"); log->add_image(icon); + log->add_text(" "); //button->set_icon(icon); } else { //button->set_icon(Ref<Texture>()); @@ -104,8 +109,6 @@ void EditorLog::add_message(const String &p_msg, bool p_error) { if (p_error) log->pop(); - - log->pop(); // pop font; } /* diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index cec3bc7f2d..1b1306e303 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -131,6 +131,11 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { return true; } +void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_value) { + set(p_name, p_value); + props[p_name].initial = p_value; +} + struct _EVCSort { String name; @@ -214,6 +219,8 @@ Variant _EDITOR_DEF(const String &p_var, const Variant &p_default) { if (EditorSettings::get_singleton()->has(p_var)) return EditorSettings::get_singleton()->get(p_var); EditorSettings::get_singleton()->set(p_var, p_default); + EditorSettings::get_singleton()->set_initial_value(p_var, p_default); + return p_default; } @@ -546,235 +553,235 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { best = "en"; } - set("interface/editor_language", best); + _initial_set("interface/editor_language", best); hints["interface/editor_language"] = PropertyInfo(Variant::STRING, "interface/editor_language", PROPERTY_HINT_ENUM, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); } - set("interface/hidpi_mode", 0); + _initial_set("interface/hidpi_mode", 0); hints["interface/hidpi_mode"] = PropertyInfo(Variant::INT, "interface/hidpi_mode", PROPERTY_HINT_ENUM, "Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/show_script_in_scene_tabs", false); - set("interface/font_size", 14); + _initial_set("interface/show_script_in_scene_tabs", false); + _initial_set("interface/font_size", 14); hints["interface/font_size"] = PropertyInfo(Variant::INT, "interface/font_size", PROPERTY_HINT_RANGE, "10,40,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/source_font_size", 14); + _initial_set("interface/source_font_size", 14); hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/custom_font", ""); + _initial_set("interface/custom_font", ""); hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/dim_editor_on_dialog_popup", true); - set("interface/dim_amount", 0.6f); + _initial_set("interface/dim_editor_on_dialog_popup", true); + _initial_set("interface/dim_amount", 0.6f); hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); - set("interface/dim_transition_time", 0.08f); + _initial_set("interface/dim_transition_time", 0.08f); hints["interface/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); - set("interface/separate_distraction_mode", false); + _initial_set("interface/separate_distraction_mode", false); - set("interface/save_each_scene_on_quit", true); // Regression - set("interface/quit_confirmation", true); + _initial_set("interface/save_each_scene_on_quit", true); // Regression + _initial_set("interface/quit_confirmation", true); - set("interface/theme/preset", 0); + _initial_set("interface/theme/preset", 0); hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Light,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/icon_and_font_color", 0); + _initial_set("interface/theme/icon_and_font_color", 0); hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/base_color", Color::html("#323b4f")); + _initial_set("interface/theme/base_color", Color::html("#323b4f")); hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/accent_color", Color::html("#699ce8")); + _initial_set("interface/theme/accent_color", Color::html("#699ce8")); hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/contrast", 0.25); + _initial_set("interface/theme/contrast", 0.25); hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); - set("interface/theme/highlight_tabs", false); - set("interface/theme/border_size", 1); - set("interface/theme/use_graph_node_headers", false); + _initial_set("interface/theme/highlight_tabs", false); + _initial_set("interface/theme/border_size", 1); + _initial_set("interface/theme/use_graph_node_headers", false); hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/additional_spacing", 0); + _initial_set("interface/theme/additional_spacing", 0); hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/custom_theme", ""); + _initial_set("interface/theme/custom_theme", ""); hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/scene_tabs/show_extension", false); - set("interface/scene_tabs/show_thumbnail_on_hover", true); - set("interface/scene_tabs/resize_if_many_tabs", true); - set("interface/scene_tabs/minimum_width", 50); + _initial_set("interface/scene_tabs/show_extension", false); + _initial_set("interface/scene_tabs/show_thumbnail_on_hover", true); + _initial_set("interface/scene_tabs/resize_if_many_tabs", true); + _initial_set("interface/scene_tabs/minimum_width", 50); hints["interface/scene_tabs/minimum_width"] = PropertyInfo(Variant::INT, "interface/scene_tabs/minimum_width", PROPERTY_HINT_RANGE, "50,500,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("filesystem/directories/autoscan_project_path", ""); + _initial_set("filesystem/directories/autoscan_project_path", ""); hints["filesystem/directories/autoscan_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/autoscan_project_path", PROPERTY_HINT_GLOBAL_DIR); - set("filesystem/directories/default_project_path", OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS)); + _initial_set("filesystem/directories/default_project_path", OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS)); hints["filesystem/directories/default_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/default_project_path", PROPERTY_HINT_GLOBAL_DIR); - set("filesystem/directories/default_project_export_path", ""); + _initial_set("filesystem/directories/default_project_export_path", ""); hints["global/default_project_export_path"] = PropertyInfo(Variant::STRING, "global/default_project_export_path", PROPERTY_HINT_GLOBAL_DIR); - set("interface/show_script_in_scene_tabs", false); + _initial_set("interface/show_script_in_scene_tabs", false); - set("text_editor/theme/color_theme", "Adaptive"); + _initial_set("text_editor/theme/color_theme", "Adaptive"); hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default"); - set("text_editor/theme/line_spacing", 4); + _initial_set("text_editor/theme/line_spacing", 4); _load_default_text_editor_theme(); - set("text_editor/highlighting/syntax_highlighting", true); + _initial_set("text_editor/highlighting/syntax_highlighting", true); - set("text_editor/highlighting/highlight_all_occurrences", true); - set("text_editor/cursor/scroll_past_end_of_file", false); + _initial_set("text_editor/highlighting/highlight_all_occurrences", true); + _initial_set("text_editor/cursor/scroll_past_end_of_file", false); - set("text_editor/indent/type", 0); + _initial_set("text_editor/indent/type", 0); hints["text_editor/indent/type"] = PropertyInfo(Variant::INT, "text_editor/indent/type", PROPERTY_HINT_ENUM, "Tabs,Spaces"); - set("text_editor/indent/size", 4); + _initial_set("text_editor/indent/size", 4); hints["text_editor/indent/size"] = PropertyInfo(Variant::INT, "text_editor/indent/size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes. - set("text_editor/indent/auto_indent", true); - set("text_editor/indent/convert_indent_on_save", false); - set("text_editor/indent/draw_tabs", true); - - set("text_editor/line_numbers/show_line_numbers", true); - set("text_editor/line_numbers/line_numbers_zero_padded", false); - set("text_editor/line_numbers/show_breakpoint_gutter", true); - set("text_editor/line_numbers/show_line_length_guideline", false); - set("text_editor/line_numbers/line_length_guideline_column", 80); + _initial_set("text_editor/indent/auto_indent", true); + _initial_set("text_editor/indent/convert_indent_on_save", false); + _initial_set("text_editor/indent/draw_tabs", true); + + _initial_set("text_editor/line_numbers/show_line_numbers", true); + _initial_set("text_editor/line_numbers/line_numbers_zero_padded", false); + _initial_set("text_editor/line_numbers/show_breakpoint_gutter", true); + _initial_set("text_editor/line_numbers/show_line_length_guideline", false); + _initial_set("text_editor/line_numbers/line_length_guideline_column", 80); hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 10"); - set("text_editor/open_scripts/smooth_scrolling", true); - set("text_editor/open_scripts/v_scroll_speed", 80); - set("text_editor/open_scripts/show_members_overview", true); + _initial_set("text_editor/open_scripts/smooth_scrolling", true); + _initial_set("text_editor/open_scripts/v_scroll_speed", 80); + _initial_set("text_editor/open_scripts/show_members_overview", true); - set("text_editor/files/trim_trailing_whitespace_on_save", false); - set("text_editor/completion/idle_parse_delay", 2); - set("text_editor/tools/create_signal_callbacks", true); - set("text_editor/files/autosave_interval_secs", 0); + _initial_set("text_editor/files/trim_trailing_whitespace_on_save", false); + _initial_set("text_editor/completion/idle_parse_delay", 2); + _initial_set("text_editor/tools/create_signal_callbacks", true); + _initial_set("text_editor/files/autosave_interval_secs", 0); - set("text_editor/cursor/block_caret", false); - set("text_editor/cursor/caret_blink", false); - set("text_editor/cursor/caret_blink_speed", 0.65); + _initial_set("text_editor/cursor/block_caret", false); + _initial_set("text_editor/cursor/caret_blink", false); + _initial_set("text_editor/cursor/caret_blink_speed", 0.65); hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.1"); - set("text_editor/theme/font", ""); + _initial_set("text_editor/theme/font", ""); hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res"); - set("text_editor/completion/auto_brace_complete", false); - set("text_editor/files/restore_scripts_on_load", true); - set("text_editor/completion/complete_file_paths", true); - set("text_editor/files/maximum_recent_files", 20); + _initial_set("text_editor/completion/auto_brace_complete", false); + _initial_set("text_editor/files/restore_scripts_on_load", true); + _initial_set("text_editor/completion/complete_file_paths", true); + _initial_set("text_editor/files/maximum_recent_files", 20); hints["text_editor/files/maximum_recent_files"] = PropertyInfo(Variant::INT, "text_editor/files/maximum_recent_files", PROPERTY_HINT_RANGE, "1, 200, 0"); - set("docks/scene_tree/start_create_dialog_fully_expanded", false); - set("docks/scene_tree/draw_relationship_lines", false); - set("docks/scene_tree/relationship_line_color", Color::html("464646")); + _initial_set("docks/scene_tree/start_create_dialog_fully_expanded", false); + _initial_set("docks/scene_tree/draw_relationship_lines", false); + _initial_set("docks/scene_tree/relationship_line_color", Color::html("464646")); - set("editors/grid_map/pick_distance", 5000.0); + _initial_set("editors/grid_map/pick_distance", 5000.0); - set("editors/3d/grid_color", Color(1, 1, 1, 0.2)); + _initial_set("editors/3d/grid_color", Color(1, 1, 1, 0.2)); hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("editors/3d/default_fov", 55.0); - set("editors/3d/default_z_near", 0.1); - set("editors/3d/default_z_far", 500.0); + _initial_set("editors/3d/default_fov", 55.0); + _initial_set("editors/3d/default_z_near", 0.1); + _initial_set("editors/3d/default_z_far", 500.0); // navigation - set("editors/3d/navigation/navigation_scheme", 0); + _initial_set("editors/3d/navigation/navigation_scheme", 0); hints["editors/3d/navigation/navigation_scheme"] = PropertyInfo(Variant::INT, "editors/3d/navigation/navigation_scheme", PROPERTY_HINT_ENUM, "Godot,Maya,Modo"); - set("editors/3d/navigation/zoom_style", 0); + _initial_set("editors/3d/navigation/zoom_style", 0); hints["editors/3d/navigation/zoom_style"] = PropertyInfo(Variant::INT, "editors/3d/navigation/zoom_style", PROPERTY_HINT_ENUM, "Vertical, Horizontal"); - set("editors/3d/navigation/emulate_3_button_mouse", false); - set("editors/3d/navigation/orbit_modifier", 0); + _initial_set("editors/3d/navigation/emulate_3_button_mouse", false); + _initial_set("editors/3d/navigation/orbit_modifier", 0); hints["editors/3d/navigation/orbit_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/orbit_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/navigation/pan_modifier", 1); + _initial_set("editors/3d/navigation/pan_modifier", 1); hints["editors/3d/navigation/pan_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/pan_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/navigation/zoom_modifier", 4); + _initial_set("editors/3d/navigation/zoom_modifier", 4); hints["editors/3d/navigation/zoom_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/zoom_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - // set("editors/3d/navigation/emulate_numpad", false); not used at the moment - set("editors/3d/navigation/warped_mouse_panning", true); + // _initial_set("editors/3d/navigation/emulate_numpad", false); not used at the moment + _initial_set("editors/3d/navigation/warped_mouse_panning", true); // navigation feel - set("editors/3d/navigation_feel/orbit_sensitivity", 0.4); + _initial_set("editors/3d/navigation_feel/orbit_sensitivity", 0.4); hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01"); - set("editors/3d/navigation_feel/orbit_inertia", 0.15); + _initial_set("editors/3d/navigation_feel/orbit_inertia", 0.15); hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/translation_inertia", 0.15); + _initial_set("editors/3d/navigation_feel/translation_inertia", 0.15); hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/zoom_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/zoom_inertia", 0.075); hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // freelook - set("editors/3d/freelook/freelook_inertia", 0.1); + _initial_set("editors/3d/freelook/freelook_inertia", 0.1); hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/freelook/freelook_base_speed", 0.1); + _initial_set("editors/3d/freelook/freelook_base_speed", 0.1); hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01"); - set("editors/3d/freelook/freelook_activation_modifier", 0); + _initial_set("editors/3d/freelook/freelook_activation_modifier", 0); hints["editors/3d/freelook/freelook_activation_modifier"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_activation_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/freelook/freelook_modifier_speed_factor", 3.0); + _initial_set("editors/3d/freelook/freelook_modifier_speed_factor", 3.0); hints["editors/3d/freelook/freelook_modifier_speed_factor"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_modifier_speed_factor", PROPERTY_HINT_RANGE, "0.0, 10.0, 0.1"); - set("editors/2d/bone_width", 5); - set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9)); - set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9)); - set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9)); - set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9)); - set("editors/2d/keep_margins_when_changing_anchors", false); - set("editors/2d/warped_mouse_panning", true); - set("editors/2d/scroll_to_pan", false); - set("editors/2d/pan_speed", 20); + _initial_set("editors/2d/bone_width", 5); + _initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9)); + _initial_set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9)); + _initial_set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9)); + _initial_set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9)); + _initial_set("editors/2d/keep_margins_when_changing_anchors", false); + _initial_set("editors/2d/warped_mouse_panning", true); + _initial_set("editors/2d/scroll_to_pan", false); + _initial_set("editors/2d/pan_speed", 20); - set("editors/poly_editor/point_grab_radius", 8); - set("editors/poly_editor/show_previous_outline", true); + _initial_set("editors/poly_editor/point_grab_radius", 8); + _initial_set("editors/poly_editor/show_previous_outline", true); - set("run/window_placement/rect", 1); + _initial_set("run/window_placement/rect", 1); hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen"); String screen_hints = TTR("Default (Same as Editor)"); for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) { screen_hints += ",Monitor " + itos(i + 1); } - set("run/window_placement/rect_custom_position", Vector2()); - set("run/window_placement/screen", 0); + _initial_set("run/window_placement/rect_custom_position", Vector2()); + _initial_set("run/window_placement/screen", 0); hints["run/window_placement/screen"] = PropertyInfo(Variant::INT, "run/window_placement/screen", PROPERTY_HINT_ENUM, screen_hints); - set("filesystem/on_save/compress_binary_resources", true); - set("filesystem/on_save/save_modified_external_resources", true); + _initial_set("filesystem/on_save/compress_binary_resources", true); + _initial_set("filesystem/on_save/save_modified_external_resources", true); - set("text_editor/tools/create_signal_callbacks", true); + _initial_set("text_editor/tools/create_signal_callbacks", true); - set("filesystem/file_dialog/show_hidden_files", false); - set("filesystem/file_dialog/display_mode", 0); + _initial_set("filesystem/file_dialog/show_hidden_files", false); + _initial_set("filesystem/file_dialog/display_mode", 0); hints["filesystem/file_dialog/display_mode"] = PropertyInfo(Variant::INT, "filesystem/file_dialog/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("filesystem/file_dialog/thumbnail_size", 64); + _initial_set("filesystem/file_dialog/thumbnail_size", 64); hints["filesystem/file_dialog/thumbnail_size"] = PropertyInfo(Variant::INT, "filesystem/file_dialog/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16"); - set("docks/filesystem/display_mode", 0); + _initial_set("docks/filesystem/display_mode", 0); hints["docks/filesystem/display_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("docks/filesystem/thumbnail_size", 64); + _initial_set("docks/filesystem/thumbnail_size", 64); hints["docks/filesystem/thumbnail_size"] = PropertyInfo(Variant::INT, "docks/filesystem/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16"); - set("docks/filesystem/display_mode", 0); + _initial_set("docks/filesystem/display_mode", 0); hints["docks/filesystem/display_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("docks/filesystem/always_show_folders", true); + _initial_set("docks/filesystem/always_show_folders", true); - set("editors/animation/autorename_animation_tracks", true); - set("editors/animation/confirm_insert_track", true); + _initial_set("editors/animation/autorename_animation_tracks", true); + _initial_set("editors/animation/confirm_insert_track", true); - set("docks/property_editor/texture_preview_width", 48); - set("docks/property_editor/auto_refresh_interval", 0.3); - set("text_editor/help/doc_path", ""); - set("text_editor/help/show_help_index", true); + _initial_set("docks/property_editor/texture_preview_width", 48); + _initial_set("docks/property_editor/auto_refresh_interval", 0.3); + _initial_set("text_editor/help/doc_path", ""); + _initial_set("text_editor/help/show_help_index", true); - set("filesystem/import/ask_save_before_reimport", false); + _initial_set("filesystem/import/ask_save_before_reimport", false); - set("filesystem/import/pvrtc_texture_tool", ""); + _initial_set("filesystem/import/pvrtc_texture_tool", ""); #ifdef WINDOWS_ENABLED hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, "*.exe"); #else hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, ""); #endif - set("filesystem/import/pvrtc_fast_conversion", false); + _initial_set("filesystem/import/pvrtc_fast_conversion", false); - set("run/auto_save/save_before_running", true); - set("run/output/always_clear_output_on_play", true); - set("run/output/always_open_output_on_play", true); - set("run/output/always_close_output_on_stop", false); - set("filesystem/resources/save_compressed_resources", true); - set("filesystem/resources/auto_reload_modified_images", true); + _initial_set("run/auto_save/save_before_running", true); + _initial_set("run/output/always_clear_output_on_play", true); + _initial_set("run/output/always_open_output_on_play", true); + _initial_set("run/output/always_close_output_on_stop", false); + _initial_set("filesystem/resources/save_compressed_resources", true); + _initial_set("filesystem/resources/auto_reload_modified_images", true); - set("filesystem/import/automatic_reimport_on_sources_changed", true); + _initial_set("filesystem/import/automatic_reimport_on_sources_changed", true); if (p_extra_config.is_valid()) { @@ -804,35 +811,35 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { } void EditorSettings::_load_default_text_editor_theme() { - set("text_editor/highlighting/background_color", Color::html("3b000000")); - set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); - set("text_editor/highlighting/completion_selected_color", Color::html("434244")); - set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); - set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); - set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); - set("text_editor/highlighting/caret_color", Color::html("aaaaaa")); - set("text_editor/highlighting/caret_background_color", Color::html("000000")); - set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); - set("text_editor/highlighting/text_color", Color::html("aaaaaa")); - set("text_editor/highlighting/text_selected_color", Color::html("000000")); - set("text_editor/highlighting/keyword_color", Color::html("ffffb3")); - set("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); - set("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); - set("text_editor/highlighting/function_color", Color::html("66a2ce")); - set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); - set("text_editor/highlighting/comment_color", Color::html("676767")); - set("text_editor/highlighting/string_color", Color::html("ef6ebe")); - set("text_editor/highlighting/number_color", Color::html("EB9532")); - set("text_editor/highlighting/symbol_color", Color::html("badfff")); - set("text_editor/highlighting/selection_color", Color::html("6ca9c2")); - set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); - set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); - set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); - set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); - set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); - set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); - set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); - set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); + _initial_set("text_editor/highlighting/background_color", Color::html("3b000000")); + _initial_set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); + _initial_set("text_editor/highlighting/completion_selected_color", Color::html("434244")); + _initial_set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); + _initial_set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); + _initial_set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/caret_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/caret_background_color", Color::html("000000")); + _initial_set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); + _initial_set("text_editor/highlighting/text_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/text_selected_color", Color::html("000000")); + _initial_set("text_editor/highlighting/keyword_color", Color::html("ffffb3")); + _initial_set("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); + _initial_set("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); + _initial_set("text_editor/highlighting/function_color", Color::html("66a2ce")); + _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); + _initial_set("text_editor/highlighting/comment_color", Color::html("676767")); + _initial_set("text_editor/highlighting/string_color", Color::html("ef6ebe")); + _initial_set("text_editor/highlighting/number_color", Color::html("EB9532")); + _initial_set("text_editor/highlighting/symbol_color", Color::html("badfff")); + _initial_set("text_editor/highlighting/selection_color", Color::html("6ca9c2")); + _initial_set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); + _initial_set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); + _initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); + _initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); + _initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); + _initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); + _initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); + _initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); } void EditorSettings::notify_changes() { @@ -1037,7 +1044,7 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) { String theme_name = p_file.substr(0, p_file.length() - 4).get_file(); if (p_file.get_base_dir() == get_settings_path() + "/text_editor_themes") { - set("text_editor/theme/color_theme", theme_name); + _initial_set("text_editor/theme/color_theme", theme_name); load_text_editor_theme(); } return true; @@ -1161,6 +1168,28 @@ void EditorSettings::set_project_metadata(const String &p_section, const String cf->save(path); } +bool EditorSettings::property_can_revert(const String &p_name) { + + if (!props.has(p_name)) + return false; + + return props[p_name].initial != props[p_name].variant; +} + +Variant EditorSettings::property_get_revert(const String &p_name) { + + if (!props.has(p_name)) + return Variant(); + + return props[p_name].initial; +} + +void EditorSettings::set_initial_value(const StringName &p_name, const Variant &p_value) { + + ERR_FAIL_COND(!props.has(p_name)); + props[p_name].initial = p_value; +} + void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("erase", "property"), &EditorSettings::erase); @@ -1175,6 +1204,11 @@ void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("set_recent_dirs", "dirs"), &EditorSettings::set_recent_dirs); ClassDB::bind_method(D_METHOD("get_recent_dirs"), &EditorSettings::get_recent_dirs); + ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &EditorSettings::property_can_revert); + ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &EditorSettings::property_get_revert); + + ClassDB::bind_method(D_METHOD("set_initial_value", "name", "value"), &EditorSettings::set_initial_value); + ADD_SIGNAL(MethodInfo("settings_changed")); } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 177ec4760d..6a814c41a5 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -65,6 +65,7 @@ private: struct VariantContainer { int order; Variant variant; + Variant initial; bool hide_from_editor; bool save; VariantContainer() { @@ -88,6 +89,8 @@ private: bool _get(const StringName &p_name, Variant &r_ret) const; void _get_property_list(List<PropertyInfo> *p_list) const; + void _initial_set(const StringName &p_name, const Variant &p_value); + static Ref<EditorSettings> singleton; String config_file_path; @@ -171,6 +174,11 @@ public: Variant get_project_metadata(const String &p_section, const String &p_key, Variant p_default); void set_project_metadata(const String &p_section, const String &p_key, Variant p_data); + bool property_can_revert(const String &p_name); + Variant property_get_revert(const String &p_name); + + void set_initial_value(const StringName &p_name, const Variant &p_value); + EditorSettings(); ~EditorSettings(); }; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 51fdef37cf..ca337551eb 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -802,7 +802,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_tooltip->set_bg_color(Color(mono_color.r, mono_color.g, mono_color.b, 0.9)); style_tooltip->set_border_width_all(border_width); style_tooltip->set_border_color_all(mono_color); - theme->set_color("font_color", "TooltipPanel", font_color); + theme->set_color("font_color", "TooltipLabel", font_color.inverted()); + theme->set_color("font_color_shadow", "TooltipLabel", mono_color.inverted() * Color(1, 1, 1, 0.1)); theme->set_stylebox("panel", "TooltipPanel", style_tooltip); // PopupPanel diff --git a/editor/icons/icon_status_error.svg b/editor/icons/icon_status_error.svg new file mode 100644 index 0000000000..4da9471835 --- /dev/null +++ b/editor/icons/icon_status_error.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm-2.8281 2.7578l2.8281 2.8281 2.8281-2.8281 1.4141 1.4141-2.8281 2.8281 2.8281 2.8281-1.4141 1.4141-2.8281-2.8281-2.8281 2.8281-1.4141-1.4141 2.8281-2.8281-2.8281-2.8281 1.4141-1.4141z" fill="#ff5d5d"/> +</g> +</g> +</svg> diff --git a/editor/icons/icon_status_success.svg b/editor/icons/icon_status_success.svg new file mode 100644 index 0000000000..6a6e2d6d30 --- /dev/null +++ b/editor/icons/icon_status_success.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm3.293 3.877 1.4141 1.4141-5.707 5.709-3.707-3.709 1.4141-1.4141 2.293 2.293z" fill="#45ff8b"/> +</g> +</g> +</svg> diff --git a/editor/icons/icon_status_warning.svg b/editor/icons/icon_status_warning.svg new file mode 100644 index 0000000000..f92021379d --- /dev/null +++ b/editor/icons/icon_status_warning.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7 -7 7 7 0 0 0 -7 -7zm-1 2h2v7h-2v-7zm0 8h2v2h-2v-2z" fill="#ffdd65"/> +</g> +</g> +</svg> diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index c591bc733b..d3a0685777 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3823,7 +3823,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_config_menu = memnew(MenuButton); hb->add_child(snap_config_menu); - snap_config_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); snap_config_menu->set_h_size_flags(SIZE_SHRINK_END); snap_config_menu->set_tooltip(TTR("Snapping options")); @@ -3877,7 +3876,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p = skeleton_menu->get_popup(); p->set_hide_on_checkable_item_selection(false); - p->connect("id_pressed", this, "_popup_callback"); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bones"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Bones")), SKELETON_CLEAR_BONES); p->add_separator(); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index f8f222ac2e..5ab0253d6d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -51,9 +51,9 @@ #include "version.h" #include "version_hash.gen.h" -class NewProjectDialog : public ConfirmationDialog { +class ProjectDialog : public ConfirmationDialog { - GDCLASS(NewProjectDialog, ConfirmationDialog); + GDCLASS(ProjectDialog, ConfirmationDialog); public: enum Mode { @@ -64,20 +64,56 @@ public: }; private: + enum MessageType { + MESSAGE_ERROR, + MESSAGE_WARNING, + MESSAGE_SUCCESS + }; + Mode mode; Button *browse; - Label *pp, *pn; - Label *error; + Button *create_dir; + Container *name_container; + Container *path_container; + Label *msg; LineEdit *project_path; LineEdit *project_name; + ToolButton *status_btn; FileDialog *fdialog; String zip_path; String zip_title; AcceptDialog *dialog_error; + String fav_dir; + + String created_folder_path; + + void set_message(const String &p_msg, MessageType p_type = MESSAGE_SUCCESS) { + msg->set_text(p_msg); + if (p_msg == "") { + status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons")); + return; + } + msg->hide(); + switch (p_type) { + case MESSAGE_ERROR: + msg->add_color_override("font_color", get_color("error_color", "Editor")); + status_btn->set_icon(get_icon("StatusError", "EditorIcons")); + msg->show(); + break; + case MESSAGE_WARNING: + msg->add_color_override("font_color", get_color("warning_color", "Editor")); + status_btn->set_icon(get_icon("StatusWarning", "EditorIcons")); + break; + case MESSAGE_SUCCESS: + msg->add_color_override("font_color", get_color("success_color", "Editor")); + status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons")); + break; + } + } String _test_path() { - error->set_text(""); + set_message(" "); get_ok()->set_disabled(true); DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); String valid_path; @@ -88,7 +124,7 @@ private: } if (valid_path == "") { - error->set_text(TTR("Invalid project path, the path must exist!")); + set_message(TTR("The path does not exists."), MESSAGE_ERROR); memdelete(d); return ""; } @@ -97,16 +133,35 @@ private: if (valid_path != "" && !d->file_exists("project.godot")) { - error->set_text(TTR("Invalid project path, project.godot must exist.")); + set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR); memdelete(d); return ""; } + } else if (mode == MODE_NEW) { + + // check if the specified folder is empty, even though this is not an error, it is good to check here + d->list_dir_begin(); + bool is_empty = true; + String n = d->get_next(); + while (n != String()) { + if (!n.begins_with(".")) { // i dont know if this is enough to guarantee an empty dir + is_empty = false; + break; + } + n = d->get_next(); + } + d->list_dir_end(); + + if (!is_empty) { + set_message(TTR("Your project will be created in a non empty folder (you might want to create a new folder)."), MESSAGE_WARNING); + } + } else { if (d->file_exists("project.godot")) { - error->set_text(TTR("Invalid project path, project.godot must not exist.")); + set_message(TTR("Please choose a folder that does not contain a 'project.godot' file."), MESSAGE_ERROR); memdelete(d); return ""; } @@ -122,16 +177,23 @@ private: String sp = _test_path(); if (sp != "") { - sp = sp.replace("\\", "/"); - int lidx = sp.find_last("/"); + // set the project name to the select folder name + if (project_name->get_text() == "") { + sp = sp.replace("\\", "/"); + int lidx = sp.find_last("/"); - if (lidx != -1) { - sp = sp.substr(lidx + 1, sp.length()); + if (lidx != -1) { + sp = sp.substr(lidx + 1, sp.length()); + } + if (sp == "" && mode == MODE_IMPORT) + sp = TTR("Imported Project"); + + project_name->set_text(sp); } - if (sp == "" && mode == MODE_IMPORT) - sp = TTR("Imported Project"); + } - project_name->set_text(sp); + if (created_folder_path != "" && created_folder_path != p_path) { + _remove_created_folder(); } } @@ -140,13 +202,17 @@ private: String p = p_path; if (mode == MODE_IMPORT) { if (p.ends_with("project.godot")) { - p = p.get_base_dir(); + get_ok()->set_disabled(false); + } else { + set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR); + get_ok()->set_disabled(true); + return; } } String sp = p.simplify_path(); project_path->set_text(sp); - _path_text_changed(sp); + set_message(TTR(" ")); // just so it does not disappear get_ok()->call_deferred("grab_focus"); } @@ -155,12 +221,13 @@ private: String p = p_path; String sp = p.simplify_path(); project_path->set_text(sp); - _path_text_changed(sp); get_ok()->call_deferred("grab_focus"); } void _browse_path() { + fdialog->set_current_dir(project_path->get_text()); + if (mode == MODE_IMPORT) { fdialog->set_mode(FileDialog::MODE_OPEN_FILE); @@ -172,34 +239,46 @@ private: fdialog->popup_centered_ratio(); } - void _text_changed(const String &p_text) { - _test_path(); - error->set_text(""); - if (p_text == "") { + void _create_folder() { - error->set_text(TTR("Name cannot be empty")); - get_ok()->set_disabled(true); + if (project_name->get_text() == "" || created_folder_path != "") { return; } - get_ok()->set_disabled(false); + + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + if (d->change_dir(project_path->get_text()) == OK) { + if (!d->dir_exists(project_name->get_text())) { + if (d->make_dir(project_name->get_text()) == OK) { + d->change_dir(project_name->get_text()); + project_path->set_text(d->get_current_dir()); + created_folder_path = d->get_current_dir(); + create_dir->set_disabled(true); + } + } + } + memdelete(d); } - void _name_changed(const String &p_text) { + void _text_changed(const String &p_text) { + + if (mode != MODE_NEW) + return; + + _test_path(); + + if (p_text == "") + set_message(TTR("It would be a good idea to name your project."), MESSAGE_WARNING); } void ok_pressed() { - String dir = _test_path(); - if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); - return; - } + String dir = project_path->get_text(); if (mode == MODE_RENAME) { String dir = _test_path(); if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); + set_message(TTR("Invalid project path (changed anything?)."), MESSAGE_ERROR); return; } @@ -207,13 +286,13 @@ private: current->add_singleton(ProjectSettings::Singleton("Current")); if (current->setup(dir, "")) { - error->set_text(TTR("Couldn't get project.godot in project path.")); + set_message(TTR("Couldn't get project.godot in project path."), MESSAGE_ERROR); } else { ProjectSettings::CustomMap edited_settings; edited_settings["application/config/name"] = project_name->get_text(); if (current->save_custom(dir.plus_file("/project.godot"), edited_settings, Vector<String>(), true)) { - error->set_text(TTR("Couldn't edit project.godot in project path.")); + set_message(TTR("Couldn't edit project.godot in project path."), MESSAGE_ERROR); } } @@ -232,13 +311,13 @@ private: initial_settings["rendering/environment/default_environment"] = "res://default_env.tres"; if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("/project.godot"), initial_settings, Vector<String>(), false)) { - error->set_text(TTR("Couldn't create project.godot in project path.")); + set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { ResourceSaver::save(dir.plus_file("/icon.png"), get_icon("DefaultProjectIcon", "EditorIcons")); FileAccess *f = FileAccess::open(dir.plus_file("/default_env.tres"), FileAccess::WRITE); if (!f) { - error->set_text(TTR("Couldn't create project.godot in project path.")); + set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]"); f->store_line("[sub_resource type=\"ProceduralSky\" id=1]"); @@ -356,14 +435,40 @@ private: } } + void _remove_created_folder() { + + if (created_folder_path != "") { + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + d->remove(created_folder_path); + memdelete(d); + + create_dir->set_disabled(false); + created_folder_path = ""; + } + } + + void _toggle_message() { + msg->set_visible(!msg->is_visible()); + } + + void cancel_pressed() { + + _remove_created_folder(); + + project_path->clear(); + project_name->clear(); + } + protected: static void _bind_methods() { - ClassDB::bind_method("_browse_path", &NewProjectDialog::_browse_path); - ClassDB::bind_method("_text_changed", &NewProjectDialog::_text_changed); - ClassDB::bind_method("_path_text_changed", &NewProjectDialog::_path_text_changed); - ClassDB::bind_method("_path_selected", &NewProjectDialog::_path_selected); - ClassDB::bind_method("_file_selected", &NewProjectDialog::_file_selected); + ClassDB::bind_method("_browse_path", &ProjectDialog::_browse_path); + ClassDB::bind_method("_create_folder", &ProjectDialog::_create_folder); + ClassDB::bind_method("_text_changed", &ProjectDialog::_text_changed); + ClassDB::bind_method("_path_text_changed", &ProjectDialog::_path_text_changed); + ClassDB::bind_method("_path_selected", &ProjectDialog::_path_selected); + ClassDB::bind_method("_file_selected", &ProjectDialog::_file_selected); + ClassDB::bind_method("_toggle_message", &ProjectDialog::_toggle_message); ADD_SIGNAL(MethodInfo("project_created")); ADD_SIGNAL(MethodInfo("project_renamed")); } @@ -390,129 +495,129 @@ public: if (mode == MODE_RENAME) { project_path->set_editable(false); - browse->set_disabled(true); + browse->hide(); set_title(TTR("Rename Project")); get_ok()->set_text(TTR("Rename")); - pp->set_text(TTR("Project Path:")); - pn->set_text(TTR("Project Name:")); - pn->show(); - project_name->show(); + name_container->show(); - String dir = _test_path(); - if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); - return; - } ProjectSettings *current = memnew(ProjectSettings); current->add_singleton(ProjectSettings::Singleton("Current")); - if (current->setup(dir, "")) { - error->set_text(TTR("Couldn't get project.godot in project path.")); - } else { - if (current->has("application/config/name")) { - String appname = current->get("application/config/name"); - project_name->set_text(appname); - } + if (current->setup(project_path->get_text(), "")) { + set_message(TTR("Couldn't get project.godot in the project path."), MESSAGE_ERROR); + } else if (current->has("application/config/name")) { + project_name->set_text(current->get("application/config/name")); } - - popup_centered(Size2(500, 125) * EDSCALE); project_name->grab_focus(); + create_dir->hide(); + status_btn->hide(); + } else { - project_path->clear(); - project_name->clear(); + fav_dir = EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"); + if (fav_dir != "") { + project_path->set_text(fav_dir); + fdialog->set_current_dir(fav_dir); + } else { + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + project_path->set_text(d->get_current_dir()); + fdialog->set_current_dir(d->get_current_dir()); + memdelete(d); + } + project_name->set_text(TTR("New Game Project")); + project_path->set_editable(true); browse->set_disabled(false); + browse->show(); + create_dir->show(); + status_btn->show(); if (mode == MODE_IMPORT) { set_title(TTR("Import Existing Project")); get_ok()->set_text(TTR("Import")); - pp->set_text(TTR("Project Path (Must Exist):")); - pn->set_text(TTR("Project Name:")); - pn->hide(); - project_name->hide(); - - popup_centered(Size2(500, 125) * EDSCALE); + name_container->hide(); + project_path->grab_focus(); } else if (mode == MODE_NEW) { set_title(TTR("Create New Project")); get_ok()->set_text(TTR("Create")); - pp->set_text(TTR("Project Path:")); - pn->set_text(TTR("Project Name:")); - pn->show(); - project_name->show(); + name_container->show(); + project_name->grab_focus(); - popup_centered(Size2(500, 145) * EDSCALE); } else if (mode == MODE_INSTALL) { set_title(TTR("Install Project:") + " " + zip_title); get_ok()->set_text(TTR("Install")); - pp->set_text(TTR("Project Path:")); - pn->hide(); - project_name->hide(); - - popup_centered(Size2(500, 125) * EDSCALE); + name_container->hide(); + project_path->grab_focus(); } - project_path->grab_focus(); _test_path(); } + + popup_centered(Size2(500, 125) * EDSCALE); } - NewProjectDialog() { + ProjectDialog() { VBoxContainer *vb = memnew(VBoxContainer); add_child(vb); - //set_child_rect(vb); + + name_container = memnew(VBoxContainer); + vb->add_child(name_container); Label *l = memnew(Label); + l->set_text(TTR("Project Name:")); + name_container->add_child(l); + + HBoxContainer *pnhb = memnew(HBoxContainer); + name_container->add_child(pnhb); + + project_name = memnew(LineEdit); + project_name->set_h_size_flags(SIZE_EXPAND_FILL); + pnhb->add_child(project_name); + + create_dir = memnew(Button); + pnhb->add_child(create_dir); + create_dir->set_text(TTR("Create folder")); + create_dir->connect("pressed", this, "_create_folder"); + + path_container = memnew(VBoxContainer); + vb->add_child(path_container); + + l = memnew(Label); l->set_text(TTR("Project Path:")); - vb->add_child(l); - pp = l; + path_container->add_child(l); - project_path = memnew(LineEdit); - MarginContainer *mc = memnew(MarginContainer); - vb->add_child(mc); HBoxContainer *pphb = memnew(HBoxContainer); - mc->add_child(pphb); - pphb->add_child(project_path); + path_container->add_child(pphb); + + project_path = memnew(LineEdit); project_path->set_h_size_flags(SIZE_EXPAND_FILL); + pphb->add_child(project_path); + + // status button + status_btn = memnew(ToolButton); + status_btn->connect("pressed", this, "_toggle_message"); + pphb->add_child(status_btn); browse = memnew(Button); - pphb->add_child(browse); browse->set_text(TTR("Browse")); browse->connect("pressed", this, "_browse_path"); + pphb->add_child(browse); - l = memnew(Label); - l->set_text(TTR("Project Name:")); - l->set_position(Point2(5, 50)); - vb->add_child(l); - pn = l; - - project_name = memnew(LineEdit); - mc = memnew(MarginContainer); - vb->add_child(mc); - mc->add_child(project_name); - project_name->set_text(TTR("New Game Project")); - - l = memnew(Label); - l->set_text(TTR("That's a BINGO!")); - vb->add_child(l); - error = l; - l->add_color_override("font_color", Color(1, 0.4, 0.3, 0.8)); - l->set_align(Label::ALIGN_CENTER); - - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - project_path->set_text(d->get_current_dir()); - memdelete(d); + msg = memnew(Label); + msg->set_text(TTR("That's a BINGO!")); + msg->set_align(Label::ALIGN_CENTER); + msg->hide(); + vb->add_child(msg); fdialog = memnew(FileDialog); - add_child(fdialog); fdialog->set_access(FileDialog::ACCESS_FILESYSTEM); - fdialog->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path")); + add_child(fdialog); project_name->connect("text_changed", this, "_text_changed"); project_path->connect("text_changed", this, "_path_text_changed"); fdialog->connect("dir_selected", this, "_path_selected"); @@ -564,7 +669,7 @@ void ProjectManager::_panel_draw(Node *p_hb) { hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree")); if (selected_list.has(hb->get_meta("name"))) { - hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0))); + hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); } } @@ -1168,13 +1273,13 @@ void ProjectManager::_scan_projects() { void ProjectManager::_new_project() { - npdialog->set_mode(NewProjectDialog::MODE_NEW); + npdialog->set_mode(ProjectDialog::MODE_NEW); npdialog->show_dialog(); } void ProjectManager::_import_project() { - npdialog->set_mode(NewProjectDialog::MODE_IMPORT); + npdialog->set_mode(ProjectDialog::MODE_IMPORT); npdialog->show_dialog(); } @@ -1188,7 +1293,7 @@ void ProjectManager::_rename_project() { const String &selected = E->key(); String path = EditorSettings::get_singleton()->get("projects/" + selected); npdialog->set_project_path(path); - npdialog->set_mode(NewProjectDialog::MODE_RENAME); + npdialog->set_mode(ProjectDialog::MODE_RENAME); npdialog->show_dialog(); } } @@ -1224,7 +1329,7 @@ void ProjectManager::_exit_dialog() { void ProjectManager::_install_project(const String &p_zip_path, const String &p_title) { - npdialog->set_mode(NewProjectDialog::MODE_INSTALL); + npdialog->set_mode(ProjectDialog::MODE_INSTALL); npdialog->set_zip_path(p_zip_path); npdialog->set_zip_title(p_title); npdialog->show_dialog(); @@ -1511,7 +1616,7 @@ ProjectManager::ProjectManager() { OS::get_singleton()->set_low_processor_usage_mode(true); - npdialog = memnew(NewProjectDialog); + npdialog = memnew(ProjectDialog); gui_base->add_child(npdialog); npdialog->connect("project_renamed", this, "_on_project_renamed"); diff --git a/editor/project_manager.h b/editor/project_manager.h index 8a3e7c0457..bfae0b2297 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -37,7 +37,7 @@ #include "scene/gui/tool_button.h" #include "scene/gui/tree.h" -class NewProjectDialog; +class ProjectDialog; class ProjectListFilter; class ProjectManager : public Control { @@ -60,7 +60,7 @@ class ProjectManager : public Control { ConfirmationDialog *multi_scan_ask; AcceptDialog *run_error_diag; AcceptDialog *dialog_error; - NewProjectDialog *npdialog; + ProjectDialog *npdialog; ScrollContainer *scroll; VBoxContainer *scroll_childs; Map<String, String> selected_list; // name -> main_scene diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 19f674c395..81bd450484 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2958,7 +2958,7 @@ void PropertyEditor::update_tree() { item->set_metadata(1, p.name); if (draw_red) - item->set_custom_color(0, Color(0.8, 0.4, 0.20)); + item->set_custom_color(0, get_color("error_color", "Editor")); if (p.name == selected_property) { diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 76e75cff0a..d71bc1838b 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1065,7 +1065,7 @@ void ScriptEditorDebugger::start() { int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); if (server->listen(remote_port) != OK) { - EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **")); + EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), true); return; } set_process(true); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 05e3feedb5..7d7fb9fc21 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -334,6 +334,7 @@ EditorSettingsDialog::EditorSettingsDialog() { property_editor->get_property_editor()->set_use_filter(true); property_editor->register_search_box(search_box); property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); + property_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo()); vbc->add_child(property_editor); property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited"); |