diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 4 | ||||
-rw-r--r-- | editor/import/audio_stream_import_settings.cpp | 38 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/audio_stream_randomizer_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 55 | ||||
-rw-r--r-- | editor/plugins/version_control_editor_plugin.h | 3 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 2 |
7 files changed, 70 insertions, 58 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 2df14aef6c..5bf45687ab 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3867,6 +3867,10 @@ void EditorInspector::_notification(int p_what) { _update_inspector_bg(); } break; + case NOTIFICATION_THEME_CHANGED: { + update_tree(); + } break; + case NOTIFICATION_ENTER_TREE: { if (!sub_inspector) { get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index 71d0d4b399..92d4397c68 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -465,12 +465,17 @@ void AudioStreamImportSettings::_settings_changed() { updating_settings = true; stream->call("set_loop", loop->is_pressed()); stream->call("set_loop_offset", loop_offset->get_value()); + if (loop->is_pressed()) { + loop_offset->set_editable(true); + } else { + loop_offset->set_editable(false); + } + if (bpm_enabled->is_pressed()) { stream->call("set_bpm", bpm_edit->get_value()); - beats_enabled->show(); - beats_edit->show(); - bar_beats_label->show(); - bar_beats_edit->show(); + beats_enabled->set_disabled(false); + beats_edit->set_editable(true); + bar_beats_edit->set_editable(true); double bpm = bpm_edit->get_value(); if (bpm > 0) { float beat_size = 60 / float(bpm); @@ -486,10 +491,9 @@ void AudioStreamImportSettings::_settings_changed() { } else { stream->call("set_bpm", 0); stream->call("set_bar_beats", 4); - beats_enabled->hide(); - beats_edit->hide(); - bar_beats_label->hide(); - bar_beats_edit->hide(); + beats_enabled->set_disabled(true); + beats_edit->set_editable(false); + bar_beats_edit->set_editable(false); } if (bpm_enabled->is_pressed() && beats_enabled->is_pressed()) { stream->call("set_beat_count", beats_edit->get_value()); @@ -552,15 +556,6 @@ AudioStreamImportSettings::AudioStreamImportSettings() { bpm_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); interactive_hb->add_child(bpm_edit); interactive_hb->add_spacer(); - bar_beats_label = memnew(Label(TTR("Bar Beats:"))); - interactive_hb->add_child(bar_beats_label); - bar_beats_edit = memnew(SpinBox); - bar_beats_edit->set_tooltip_text(TTR("Configure the Beats Per Bar. This used for music-aware transitions between AudioStreams.")); - bar_beats_edit->set_min(2); - bar_beats_edit->set_max(32); - bar_beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); - interactive_hb->add_child(bar_beats_edit); - interactive_hb->add_spacer(); beats_enabled = memnew(CheckBox); beats_enabled->set_text(TTR("Beat Count:")); beats_enabled->connect("toggled", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); @@ -570,6 +565,15 @@ AudioStreamImportSettings::AudioStreamImportSettings() { beats_edit->set_max(99999); beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); interactive_hb->add_child(beats_edit); + bar_beats_label = memnew(Label(TTR("Bar Beats:"))); + interactive_hb->add_child(bar_beats_label); + bar_beats_edit = memnew(SpinBox); + bar_beats_edit->set_tooltip_text(TTR("Configure the Beats Per Bar. This used for music-aware transitions between AudioStreams.")); + bar_beats_edit->set_min(2); + bar_beats_edit->set_max(32); + bar_beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + interactive_hb->add_child(bar_beats_edit); + interactive_hb->add_spacer(); main_vbox->add_margin_child(TTR("Music Playback:"), interactive_hb); color_rect = memnew(ColorRect); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 7c3ecd5d4e..6483a18a4d 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -43,6 +43,11 @@ #include "editor/project_settings_editor.h" #include "scene/gui/menu_button.h" +#include "modules/modules_enabled.gen.h" // For svg. +#ifdef MODULE_SVG_ENABLED +#include "modules/svg/image_loader_svg.h" +#endif + static inline void setup_http_request(HTTPRequest *request) { request->set_use_threads(EDITOR_DEF("asset_library/use_threads", true)); @@ -751,13 +756,30 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB uint8_t png_signature[8] = { 137, 80, 78, 71, 13, 10, 26, 10 }; uint8_t jpg_signature[3] = { 255, 216, 255 }; + uint8_t webp_signature[4] = { 82, 73, 70, 70 }; + uint8_t bmp_signature[2] = { 66, 77 }; if (r) { if ((memcmp(&r[0], &png_signature[0], 8) == 0) && Image::_png_mem_loader_func) { image->copy_internals_from(Image::_png_mem_loader_func(r, len)); } else if ((memcmp(&r[0], &jpg_signature[0], 3) == 0) && Image::_jpg_mem_loader_func) { image->copy_internals_from(Image::_jpg_mem_loader_func(r, len)); + } else if ((memcmp(&r[0], &webp_signature[0], 4) == 0) && Image::_webp_mem_loader_func) { + image->copy_internals_from(Image::_webp_mem_loader_func(r, len)); + } else if ((memcmp(&r[0], &bmp_signature[0], 2) == 0) && Image::_bmp_mem_loader_func) { + image->copy_internals_from(Image::_bmp_mem_loader_func(r, len)); } +#ifdef MODULE_SVG_ENABLED + else { + ImageLoaderSVG svg_loader; + Ref<Image> img = Ref<Image>(memnew(Image)); + Error err = svg_loader.create_image_from_utf8_buffer(img, image_data, 1.0, false); + + if (err == OK) { + image->copy_internals_from(img); + } + } +#endif } if (!image->is_empty()) { diff --git a/editor/plugins/audio_stream_randomizer_editor_plugin.cpp b/editor/plugins/audio_stream_randomizer_editor_plugin.cpp index e21a50a434..61b7683a05 100644 --- a/editor/plugins/audio_stream_randomizer_editor_plugin.cpp +++ b/editor/plugins/audio_stream_randomizer_editor_plugin.cpp @@ -81,7 +81,7 @@ void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_und if (p_from_index < 0) { undo_redo_man->add_undo_method(randomizer, "remove_stream", p_to_pos < 0 ? randomizer->get_streams_count() : p_to_pos); } else if (p_to_pos < 0) { - undo_redo_man->add_undo_method(randomizer, "add_stream", p_from_index); + undo_redo_man->add_undo_method(randomizer, "add_stream", p_from_index, Ref<AudioStream>()); } List<PropertyInfo> properties; @@ -107,7 +107,7 @@ void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_und #undef ADD_UNDO if (p_from_index < 0) { - undo_redo_man->add_do_method(randomizer, "add_stream", p_to_pos); + undo_redo_man->add_do_method(randomizer, "add_stream", p_to_pos, Ref<AudioStream>()); } else if (p_to_pos < 0) { undo_redo_man->add_do_method(randomizer, "remove_stream", p_from_index); } else { diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 369a59c443..f7fb211014 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -47,43 +47,7 @@ VersionControlEditorPlugin *VersionControlEditorPlugin::singleton = nullptr; void VersionControlEditorPlugin::_bind_methods() { - ClassDB::bind_method(D_METHOD("_initialize_vcs"), &VersionControlEditorPlugin::_initialize_vcs); - ClassDB::bind_method(D_METHOD("_set_credentials"), &VersionControlEditorPlugin::_set_credentials); - ClassDB::bind_method(D_METHOD("_update_set_up_warning"), &VersionControlEditorPlugin::_update_set_up_warning); - ClassDB::bind_method(D_METHOD("_commit"), &VersionControlEditorPlugin::_commit); - ClassDB::bind_method(D_METHOD("_refresh_stage_area"), &VersionControlEditorPlugin::_refresh_stage_area); - ClassDB::bind_method(D_METHOD("_move_all"), &VersionControlEditorPlugin::_move_all); - ClassDB::bind_method(D_METHOD("_load_diff"), &VersionControlEditorPlugin::_load_diff); - ClassDB::bind_method(D_METHOD("_display_diff"), &VersionControlEditorPlugin::_display_diff); - ClassDB::bind_method(D_METHOD("_item_activated"), &VersionControlEditorPlugin::_item_activated); - ClassDB::bind_method(D_METHOD("_update_branch_create_button"), &VersionControlEditorPlugin::_update_branch_create_button); - ClassDB::bind_method(D_METHOD("_update_remote_create_button"), &VersionControlEditorPlugin::_update_remote_create_button); - ClassDB::bind_method(D_METHOD("_update_commit_button"), &VersionControlEditorPlugin::_update_commit_button); - ClassDB::bind_method(D_METHOD("_refresh_branch_list"), &VersionControlEditorPlugin::_refresh_branch_list); - ClassDB::bind_method(D_METHOD("_set_commit_list_size"), &VersionControlEditorPlugin::_set_commit_list_size); - ClassDB::bind_method(D_METHOD("_refresh_commit_list"), &VersionControlEditorPlugin::_refresh_commit_list); - ClassDB::bind_method(D_METHOD("_refresh_remote_list"), &VersionControlEditorPlugin::_refresh_remote_list); - ClassDB::bind_method(D_METHOD("_ssh_public_key_selected"), &VersionControlEditorPlugin::_ssh_public_key_selected); - ClassDB::bind_method(D_METHOD("_ssh_private_key_selected"), &VersionControlEditorPlugin::_ssh_private_key_selected); - ClassDB::bind_method(D_METHOD("_commit_message_gui_input"), &VersionControlEditorPlugin::_commit_message_gui_input); - ClassDB::bind_method(D_METHOD("_cell_button_pressed"), &VersionControlEditorPlugin::_cell_button_pressed); - ClassDB::bind_method(D_METHOD("_discard_all"), &VersionControlEditorPlugin::_discard_all); - ClassDB::bind_method(D_METHOD("_create_branch"), &VersionControlEditorPlugin::_create_branch); - ClassDB::bind_method(D_METHOD("_create_remote"), &VersionControlEditorPlugin::_create_remote); - ClassDB::bind_method(D_METHOD("_remove_branch"), &VersionControlEditorPlugin::_remove_branch); - ClassDB::bind_method(D_METHOD("_remove_remote"), &VersionControlEditorPlugin::_remove_remote); - ClassDB::bind_method(D_METHOD("_branch_item_selected"), &VersionControlEditorPlugin::_branch_item_selected); - ClassDB::bind_method(D_METHOD("_remote_selected"), &VersionControlEditorPlugin::_remote_selected); - ClassDB::bind_method(D_METHOD("_fetch"), &VersionControlEditorPlugin::_fetch); - ClassDB::bind_method(D_METHOD("_pull"), &VersionControlEditorPlugin::_pull); - ClassDB::bind_method(D_METHOD("_push"), &VersionControlEditorPlugin::_push); - ClassDB::bind_method(D_METHOD("_extra_option_selected"), &VersionControlEditorPlugin::_extra_option_selected); - ClassDB::bind_method(D_METHOD("_update_extra_options"), &VersionControlEditorPlugin::_update_extra_options); - ClassDB::bind_method(D_METHOD("_popup_branch_remove_confirm"), &VersionControlEditorPlugin::_popup_branch_remove_confirm); - ClassDB::bind_method(D_METHOD("_popup_remote_remove_confirm"), &VersionControlEditorPlugin::_popup_remote_remove_confirm); - ClassDB::bind_method(D_METHOD("_popup_file_dialog"), &VersionControlEditorPlugin::_popup_file_dialog); - - ClassDB::bind_method(D_METHOD("popup_vcs_set_up_dialog"), &VersionControlEditorPlugin::popup_vcs_set_up_dialog); + // No binds required so far. } void VersionControlEditorPlugin::_create_vcs_metadata_files() { @@ -435,6 +399,10 @@ void VersionControlEditorPlugin::_discard_file(String p_file_path, EditorVCSInte EditorFileSystem::get_singleton()->update_file(p_file_path); } +void VersionControlEditorPlugin::_confirm_discard_all() { + discard_all_confirm->popup_centered(); +} + void VersionControlEditorPlugin::_discard_all() { TreeItem *file_entry = unstaged_files->get_root()->get_first_child(); while (file_entry) { @@ -1240,10 +1208,21 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); unstage_title->add_child(refresh_button); + discard_all_confirm = memnew(AcceptDialog); + discard_all_confirm->set_title(TTR("Discard all changes")); + discard_all_confirm->set_min_size(Size2i(400, 50)); + discard_all_confirm->set_text(TTR("This operation is IRREVERSIBLE. Your changes will be deleted FOREVER.")); + discard_all_confirm->set_hide_on_ok(true); + discard_all_confirm->set_ok_button_text(TTR("Permanentally delete my changes")); + discard_all_confirm->add_cancel_button(); + version_commit_dock->add_child(discard_all_confirm); + + discard_all_confirm->get_ok_button()->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_discard_all)); + discard_all_button = memnew(Button); discard_all_button->set_tooltip_text(TTR("Discard all changes")); discard_all_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); - discard_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_discard_all)); + discard_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_confirm_discard_all)); discard_all_button->set_flat(true); unstage_title->add_child(discard_all_button); diff --git a/editor/plugins/version_control_editor_plugin.h b/editor/plugins/version_control_editor_plugin.h index 3340384a92..3cb18ba5b5 100644 --- a/editor/plugins/version_control_editor_plugin.h +++ b/editor/plugins/version_control_editor_plugin.h @@ -86,6 +86,8 @@ private: FileDialog *set_up_ssh_private_key_file_dialog = nullptr; Label *set_up_warning_text = nullptr; + AcceptDialog *discard_all_confirm = nullptr; + OptionButton *commit_list_size_button = nullptr; AcceptDialog *branch_create_confirm = nullptr; @@ -157,6 +159,7 @@ private: void _force_push(); void _fetch(); void _commit(); + void _confirm_discard_all(); void _discard_all(); void _refresh_stage_area(); void _refresh_branch_list(); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index cf811067c9..c93b0019dc 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1263,7 +1263,7 @@ Dictionary VisualShaderEditor::get_custom_node_data(Ref<VisualShaderNodeCustom> void VisualShaderEditor::update_custom_type(const Ref<Resource> &p_resource) { Ref<Script> scr = Ref<Script>(p_resource.ptr()); - if (scr.is_null() || scr->get_instance_base_type() != String("VisualShaderNodeCustom")) { + if (scr.is_null() || scr->get_instance_base_type() != "VisualShaderNodeCustom") { return; } |