diff --git a/.mailmap b/.mailmap index 1ff1ffb0eed..4b427a8a5ec 100644 --- a/.mailmap +++ b/.mailmap @@ -72,6 +72,7 @@ Leon Krause Manuel Strey Marcelo Fernandez Marcin Zawiejski +Marcus Elg Mariano Javier Suligoy Mario Schlack marxin diff --git a/AUTHORS.md b/AUTHORS.md index e8bb91d4bbf..f1803c672c6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -110,10 +110,13 @@ name is available. Leon Krause (eska014) Lucien Menassol (Kanabenki) m4nu3lf + Maganty Rushyendra (mrushyendra) Marcel Admiraal (madmiraal) Marcelo Fernandez (marcelofg55) Marc Gilleron (Zylann) Marcin Zawiejski (dragmz) + Marcus Brummer (mbrlabs) + Marcus (MCrafterzz) Mariano Javier Suligoy (MarianoGnu) Mario Schlack (hurikhan) Martin Capitanio (capnm) diff --git a/DONORS.md b/DONORS.md index 2988cc94f49..16a30b9489b 100644 --- a/DONORS.md +++ b/DONORS.md @@ -25,13 +25,14 @@ generous deed immortalized in the next stable release of Godot Engine. AD Ford Alan Beauchamp albinaask + Alejandro Saucedo Andrew Dunai Brandon Lamb Christian Baune Christopher Montesano - Darius Pranskus Darkhan Baimyrza Darrin Massena + Digital Grows Dov Zimring Edward Flick Gamechuck @@ -42,9 +43,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jasper Brooks Javary Co. Jeffery Chiu - John Benard (Linuxydable) Justin Arnold - Justo Delgado Baudí Kyle Szklenski Marcel Kräml Matthieu Huvé @@ -52,7 +51,6 @@ generous deed immortalized in the next stable release of Godot Engine. Mike King Nathan Warden Neal Gompa (Conan Kudo) - Péter Magyar Ronnie Cheng Slobodan Milnovic Stephan Lanfermann @@ -64,46 +62,51 @@ generous deed immortalized in the next stable release of Godot Engine. Bjarke David Gehrig - David Graham David Snopek Ed Morley Florian Rämisch Jakub Grzesik - HardRound Manuele Finocchiaro Officine Pixel S.n.c. + Rami Ronan Zeegers Sofox + Spicylewd Taylor Ritenour Zaven Muradyan + Andreas Schüle + Andres Hernandez Asher Glick Austen McRae Bernhard Werner beVR Carlo Cabanilla + Christopher Case Daniel James David Giardi Default Name eggs Florian Breisch + Forge Gamejunkey Javier Roman Jon Woodward Karl Werf - Keinan Powers Klavdij Voncina Lex Steers Luke Maciej Pendolski Matthew Hillier Mohamed Ikbel Boulabiar + Monster Vial Rene Retro Village Rob Messick Roland Fredenhagen Ryan Badour Sandro Jenny + Sarksus Scott Wadden Sergey thechris @@ -114,6 +117,7 @@ generous deed immortalized in the next stable release of Godot Engine. Alex Khayrullin alice gambrell + Andrew Harris Barugon Chris Goddard Chris Serino @@ -121,28 +125,31 @@ generous deed immortalized in the next stable release of Godot Engine. Conrad Curry Craig Smith Darrian Little + dragonage13 + GiulianoB Hoai Nam Tran Horváth Péter - Jamal Aboudrar + Jeff Nyte Joan Fons Joshua Flores Leo Fidel R Liban + Michael Dürwald + Péter Magyar Petr Malac - Rami Rob Robert Willes Ronnie Ashlock SKison Thomas Bjarnelöf - Unseen Domains Valryia Vincent Henderson + Vojtěch Wojciech Chojnacki Xavier PATRICELLI + Zoran Kukulj Adam Nakonieczny Adam Neumann - Adrian Demetrescu Alexander J Maynard Alexey Dyadchenko Andreas Funke @@ -152,20 +159,21 @@ generous deed immortalized in the next stable release of Godot Engine. Carlos de Sousa Marques Charlie Whitfield Chase Taranto + Chelsea Hash Chris Petrich Christian Alexander Bjørklund Bøhler Christian Leth Jeppesen - Christoph Schröder - Codee Leaf Cody Parker Craig Ostrin curtis Kramer D + Dev To be curious + Digital Denizen Easypete Edgar Sun - Eric Monson Eugenio Hugo Salgüero Jáñez flesk + F S Gary Hulst gavlig GGGames.org @@ -174,24 +182,27 @@ generous deed immortalized in the next stable release of Godot Engine. Hu Hund Isaac Clausman Jared White - Jeff Nyte Joe Flood John G Gentzel Jose Malheiro + Joseph Crane Joshua Lesperance Juan Velandia Julian Todd Juraj Móza + Justo Delgado Baudí Kelteseth kickmaniac kinfox Lain Ballard + luca duran Marcelo Dornbusch Lopes Marcelo Henrique Gonçalves Markus Fehr Markus Wiesner Martin Eigel Matt Eunson + Mikado069 m kaersten MuffinManKen Nick Abousselam @@ -201,6 +212,7 @@ generous deed immortalized in the next stable release of Godot Engine. Paul Hocker Paul Von Zimmerman Pete Goodwin + PhaineOfCatz pl Ranoller Rob McInroy @@ -208,6 +220,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ryan Samuel Judd Scott Pilet + Scott Ryan-Taylor Sean Morgan Sean Robertson Sébastien @@ -215,6 +228,7 @@ generous deed immortalized in the next stable release of Godot Engine. SleepCircle spilldata Stoned Xander + Tahiti Bos TheLevelOfDetail . Thomas Kurz Tobias Bocanegra @@ -228,7 +242,9 @@ generous deed immortalized in the next stable release of Godot Engine. ## Silver donors 1D_Inc + Aaron Aaron Winter + Abel Crunk Abraham Haskins Acheron Adam @@ -244,18 +260,15 @@ generous deed immortalized in the next stable release of Godot Engine. Agustinus Arya Aidan O'Flannagain Aki Mimoto - Alan Stice Albin Jonasson Svärdsby Alder Stefano AleMax Alessandro Senese Alexander Erlemann alex clavelle - Alfred Reinold Baudisch Allan Davis Allen Schade Andreas Krampitz - Andres Hernandez André Simões andrew james morris Andrew Mansuetti @@ -267,12 +280,12 @@ generous deed immortalized in the next stable release of Godot Engine. Armin Preiml Arseniy M Arthur S. Muszynski - Asger Ashley Claymore Ashton Scott Snapp Aubrey Falconer B A Balázs Batári + Balázs Hasprai Bartosz Bielecki Benedikt Ben Vercammen @@ -299,21 +312,24 @@ generous deed immortalized in the next stable release of Godot Engine. Christoph Woinke Clay Heaton Cole Johnson + Cuauhtemoc Moreno Curt King - Daniel Johnson Daniel Kimblad + Daniel Johnson + DanielMaximiano Daniel Tebbutt + Dave Walker David May David Woodard Dimitri Stanojevic - Dominic Cooney + Dmytro Korchynskyi Dominik Wetzel Donn Eddy Dragontrapper Dr Ewan Murray + Dr.Raccoon Duobix Duodecimal - Dylan Todd Eduardo Teixeira Edward Herbert Edward Swartz @@ -331,11 +347,11 @@ generous deed immortalized in the next stable release of Godot Engine. Fancy Ants Studios Fekinox Felix Bohmann - Felix Kollmann Flaredown + Florian Richer Forty Doubleu - FuDiggity Frank + FuDiggity Gadzhi Kharkharov gamedev by Celio Gary Thomas @@ -347,6 +363,7 @@ generous deed immortalized in the next stable release of Godot Engine. Guillaume Audirac Guillaume Pham Ngoc Guldoman + Gustavo Loureiro dos Reis Hal A Heribert Hirth Hunter Jones @@ -357,12 +374,14 @@ generous deed immortalized in the next stable release of Godot Engine. Ivan Nikolaev Jackson Harmer Jacob + Jaguar Jaiden Gerig Jaime Ruiz-Borau Vizárraga Jako Danar James A F Manley + Jamiee H + Jamie Massey Janders - Jannik Gröger JARKKO PARVIAINEN Jean-Baptiste LEPESME Jeff Hungerford @@ -372,6 +391,7 @@ generous deed immortalized in the next stable release of Godot Engine. Joel Fivat Joel Höglund Joel Setterberg + Johannes Goslar John Gabriel John Walker Jomei Jackson @@ -385,7 +405,6 @@ generous deed immortalized in the next stable release of Godot Engine. Jon Sully Jordy Goodridge Jorge Antunes - Jorge Caballero Jose Aleman Jose C. Rubio Joseph Catrambone @@ -396,6 +415,7 @@ generous deed immortalized in the next stable release of Godot Engine. Julian Murgia June Little JungleRobba + Justin Calleja Justin Hamilton Justin Spedding KaDokta @@ -405,6 +425,7 @@ generous deed immortalized in the next stable release of Godot Engine. Keith Bradner Kent Jofur Kevin McPhillips + Kevin Velasco Kiri Jolly Kjetil Haugland Klagsam @@ -412,10 +433,9 @@ generous deed immortalized in the next stable release of Godot Engine. Kuan Cheang kycho Kyle Appelgate + Kyuppin Laurent Tréguier - Leonard Meagher Leonardo Dimano - Levi Lindsey Lin Chear Linus Lind Lundgren Lionel Gaillard @@ -425,9 +445,14 @@ generous deed immortalized in the next stable release of Godot Engine. Major Haul Malcolm Marco Lardelli + Mark Jad + Mark Krenz Markus Michael Egger + Martin FIbik Martin Holas + Martin Linklater Martin Liška + Martin Trbola Marvin Mathieu Matt Edwards @@ -438,10 +463,7 @@ generous deed immortalized in the next stable release of Godot Engine. Megasploot Melissa Mears mewin - mhilbrunner - Michael Dürwald Michael Haney - Michael Labbe Michał Skwarek Mikael Olsson Mikayla @@ -470,6 +492,8 @@ generous deed immortalized in the next stable release of Godot Engine. Omar Delarosa Oscar Norlander Pan Ip + Parinya Teerakasemsuk + Patrick Dully Patrick Nafarrete Paul Gieske Paul Mason @@ -478,17 +502,20 @@ generous deed immortalized in the next stable release of Godot Engine. Penguin Peter Philip Cohoe + Piotr Góral Point08 pwab Rad Cat Rafa Laguna + Ram Remi Rampin Rémi Verschelde + Reneator Ricardo Alcantara Richard Diss Richard Ivánek Robert Farr (Larington) - Robert Hernandez + Robert Larnach Roger Smith Roland Rząsa Roman Tinkov @@ -496,7 +523,6 @@ generous deed immortalized in the next stable release of Godot Engine. Ronan Ronny Mühle Ryan Groom - Ryan Hentz Sam Edson Samuele Zolfanelli Scott D. Yelich @@ -534,6 +560,7 @@ generous deed immortalized in the next stable release of Godot Engine. Timothy B. MacDonald Title Plinsut Tobbun + Tobias Bradtke Tom Glenn Toni Duran Torgeir Lilleskog @@ -551,13 +578,15 @@ generous deed immortalized in the next stable release of Godot Engine. Victor Vigilant Watch Vincent Cloutier + Vladimir Savin waka nya Wayne Haak werner mendizabal Wiley Thompson Will Wyatt Goodin - Yegor + Yegor Smirnov + YiYin Gu Yuri LaPointe Yuri Sizov Zgegnesh Hemomancer diff --git a/core/hash_map.h b/core/hash_map.h index c9d3a690e72..9e51292f47e 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -294,14 +294,14 @@ public: const TData &get(const TKey &p_key) const { const TData *res = getptr(p_key); - ERR_FAIL_COND_V(!res, *res); + CRASH_COND_MSG(!res, "Map key not found."); return *res; } TData &get(const TKey &p_key) { TData *res = getptr(p_key); - ERR_FAIL_COND_V(!res, *res); + CRASH_COND_MSG(!res, "Map key not found."); return *res; } diff --git a/core/image.cpp b/core/image.cpp index b22d6b8e01a..10b678d6903 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -30,6 +30,7 @@ #include "image.h" +#include "core/error_macros.h" #include "core/hash_map.h" #include "core/io/image_loader.h" #include "core/io/resource_loader.h" @@ -1581,9 +1582,10 @@ PoolVector Image::get_data() const { } void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format) { - - ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH); - ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT); + ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0."); + ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0."); + ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + "."); + ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + "."); int mm = 0; int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0); @@ -1600,9 +1602,10 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma } void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const PoolVector &p_data) { - - ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH); - ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT); + ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0."); + ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0."); + ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + "."); + ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + "."); int mm; int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0); @@ -2330,6 +2333,7 @@ void Image::fill(const Color &c) { ImageMemLoadFunc Image::_png_mem_loader_func = NULL; ImageMemLoadFunc Image::_jpg_mem_loader_func = NULL; ImageMemLoadFunc Image::_webp_mem_loader_func = NULL; +ImageMemLoadFunc Image::_tga_mem_loader_func = NULL; void (*Image::_image_compress_bc_func)(Image *, float, Image::CompressSource) = NULL; void (*Image::_image_compress_bptc_func)(Image *, float, Image::CompressSource) = NULL; @@ -2778,6 +2782,7 @@ void Image::_bind_methods() { ClassDB::bind_method(D_METHOD("load_png_from_buffer", "buffer"), &Image::load_png_from_buffer); ClassDB::bind_method(D_METHOD("load_jpg_from_buffer", "buffer"), &Image::load_jpg_from_buffer); ClassDB::bind_method(D_METHOD("load_webp_from_buffer", "buffer"), &Image::load_webp_from_buffer); + ClassDB::bind_method(D_METHOD("load_tga_from_buffer", "buffer"), &Image::load_tga_from_buffer); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "_set_data", "_get_data"); @@ -3093,6 +3098,11 @@ Error Image::load_webp_from_buffer(const PoolVector &p_array) { return _load_from_buffer(p_array, _webp_mem_loader_func); } +Error Image::load_tga_from_buffer(const PoolVector &p_array) { + ERR_FAIL_NULL_V_MSG(_tga_mem_loader_func, ERR_UNAVAILABLE, "TGA module was not installed."); + return _load_from_buffer(p_array, _tga_mem_loader_func); +} + Error Image::_load_from_buffer(const PoolVector &p_array, ImageMemLoadFunc p_loader) { int buffer_size = p_array.size(); diff --git a/core/image.h b/core/image.h index dfb0bce2701..ace8e473066 100644 --- a/core/image.h +++ b/core/image.h @@ -131,6 +131,7 @@ public: static ImageMemLoadFunc _png_mem_loader_func; static ImageMemLoadFunc _jpg_mem_loader_func; static ImageMemLoadFunc _webp_mem_loader_func; + static ImageMemLoadFunc _tga_mem_loader_func; static void (*_image_compress_bc_func)(Image *, float, CompressSource p_source); static void (*_image_compress_bptc_func)(Image *, float p_lossy_quality, CompressSource p_source); @@ -331,6 +332,7 @@ public: Error load_png_from_buffer(const PoolVector &p_array); Error load_jpg_from_buffer(const PoolVector &p_array); Error load_webp_from_buffer(const PoolVector &p_array); + Error load_tga_from_buffer(const PoolVector &p_array); Image(const uint8_t *p_mem_png_jpg, int p_len = -1); Image(const char **p_xpm); diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml index 48a831e9460..af6fe913b6b 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry.xml @@ -302,6 +302,13 @@ Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType]. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. + [b]Note:[/b] To translate the polygon's vertices specifically, use the [method Transform2D.xform] method: + [codeblock] + var polygon = PoolVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) + var offset = Vector2(50, 50) + polygon = Transform2D(0, offset).xform(polygon) + print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)] + [/codeblock] diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index dcba728c5ed..3afc594feb0 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -48,6 +48,7 @@ + Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code]. @@ -334,6 +335,7 @@ Perform selection, from line/column to line/column. + If [member selecting_enabled] is [code]false[/code], no selection will occur. @@ -341,6 +343,7 @@ Select all the text. + If [member selecting_enabled] is [code]false[/code], no selection will occur. @@ -456,8 +459,11 @@ The current vertical scroll value. + If [code]true[/code], text can be selected. + If [code]false[/code], text can not be selected by the user or by the [method select] or [method select_all] methods. + If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled. If [code]true[/code], line numbers are displayed to the left of the text. diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index feb468b4a41..d67a72e2de2 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -34,7 +34,7 @@ Returns the vector's angle in radians with respect to the X axis, or [code](1, 0)[/code] vector. - Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member x] and [member y] as parameters: [code]atan2(x, y)[/code]. + Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code]. diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index af2760e82bc..b7c9afad888 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -31,6 +31,7 @@ #include "animation_bezier_editor.h" #include "editor/editor_node.h" +#include "editor_scale.h" float AnimationBezierTrackEdit::_bezier_h_to_pixel(float p_h) { float h = p_h; @@ -541,7 +542,7 @@ void AnimationBezierTrackEdit::_play_position_draw() { if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { Color color = get_color("accent_color", "Editor"); - play_position->draw_line(Point2(px, 0), Point2(px, h), color); + play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); } } @@ -560,6 +561,7 @@ void AnimationBezierTrackEdit::set_root(Node *p_root) { } void AnimationBezierTrackEdit::_zoom_changed() { update(); + play_position->update(); } String AnimationBezierTrackEdit::get_tooltip(const Point2 &p_pos) const { diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 700d9b692bb..06ae7a19439 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -344,16 +344,12 @@ bool EditorHelpSearch::Runner::_phase_match_classes() { if (search_flags & SEARCH_METHODS) for (int i = 0; i < class_doc.methods.size(); i++) { String method_name = (search_flags & SEARCH_CASE_SENSITIVE) ? class_doc.methods[i].name : class_doc.methods[i].name.to_lower(); - String aux_term = (search_flags & SEARCH_CASE_SENSITIVE) ? term : term.to_lower(); - - if (aux_term.begins_with(".")) - aux_term = aux_term.right(1); - - if (aux_term.ends_with("(")) - aux_term = aux_term.left(aux_term.length() - 1).strip_edges(); - - if (aux_term.is_subsequence_of(method_name)) + if (method_name.find(term) > -1 || + (term.begins_with(".") && method_name.begins_with(term.right(1))) || + (term.ends_with("(") && method_name.ends_with(term.left(term.length() - 1).strip_edges())) || + (term.begins_with(".") && term.ends_with("(") && method_name == term.substr(1, term.length() - 2).strip_edges())) { match.methods.push_back(const_cast(&class_doc.methods[i])); + } } if (search_flags & SEARCH_SIGNALS) for (int i = 0; i < class_doc.signals.size(); i++) @@ -440,11 +436,11 @@ bool EditorHelpSearch::Runner::_phase_select_match() { } bool EditorHelpSearch::Runner::_match_string(const String &p_term, const String &p_string) const { - - if (search_flags & SEARCH_CASE_SENSITIVE) - return p_term.is_subsequence_of(p_string); - else - return p_term.is_subsequence_ofi(p_string); + if (search_flags & SEARCH_CASE_SENSITIVE) { + return p_string.find(p_term) > -1; + } else { + return p_string.findn(p_term) > -1; + } } void EditorHelpSearch::Runner::_match_item(TreeItem *p_item, const String &p_text) { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c3ccaf22a4c..36d602284ae 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2812,8 +2812,16 @@ bool EditorPropertyResource::_is_drop_valid(const Dictionary &p_drag_data) const String allowed_type = base_type; Dictionary drag_data = p_drag_data; - if (drag_data.has("type") && String(drag_data["type"]) == "resource") { - Ref res = drag_data["resource"]; + + Ref res; + if (drag_data.has("type") && String(drag_data["type"]) == "script_list_element") { + ScriptEditorBase *se = Object::cast_to(drag_data["script_list_element"]); + res = se->get_edited_resource(); + } else if (drag_data.has("type") && String(drag_data["type"]) == "resource") { + res = drag_data["resource"]; + } + + if (res.is_valid()) { for (int i = 0; i < allowed_type.get_slice_count(","); i++) { String at = allowed_type.get_slice(",", i).strip_edges(); if (res.is_valid() && ClassDB::is_parent_class(res->get_class(), at)) { @@ -2854,13 +2862,19 @@ void EditorPropertyResource::drop_data_fw(const Point2 &p_point, const Variant & ERR_FAIL_COND(!_is_drop_valid(p_data)); Dictionary drag_data = p_data; - if (drag_data.has("type") && String(drag_data["type"]) == "resource") { - Ref res = drag_data["resource"]; - if (res.is_valid()) { - emit_changed(get_edited_property(), res); - update_property(); - return; - } + + Ref res; + if (drag_data.has("type") && String(drag_data["type"]) == "script_list_element") { + ScriptEditorBase *se = Object::cast_to(drag_data["script_list_element"]); + res = se->get_edited_resource(); + } else if (drag_data.has("type") && String(drag_data["type"]) == "resource") { + res = drag_data["resource"]; + } + + if (res.is_valid()) { + emit_changed(get_edited_property(), res); + update_property(); + return; } if (drag_data.has("type") && String(drag_data["type"]) == "files") { @@ -2869,9 +2883,9 @@ void EditorPropertyResource::drop_data_fw(const Point2 &p_point, const Variant & if (files.size() == 1) { String file = files[0]; - RES res = ResourceLoader::load(file); - if (res.is_valid()) { - emit_changed(get_edited_property(), res); + RES file_res = ResourceLoader::load(file); + if (file_res.is_valid()) { + emit_changed(get_edited_property(), file_res); update_property(); return; } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index d763f367ae2..40e0c357140 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -973,10 +973,9 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String ERR_CONTINUE(anim.is_null()); if (!p_animations.has(anim)) { - - // We are making external files so they are modifiable + // Tracks from source file should be set as imported, anything else is a custom track. for (int i = 0; i < anim->get_track_count(); i++) { - anim->track_set_imported(i, false); + anim->track_set_imported(i, true); } String ext_name; @@ -988,10 +987,9 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String } if (FileAccess::exists(ext_name) && p_keep_animations) { - //try to keep custom animation tracks + // Copy custom animation tracks from previously imported files. Ref old_anim = ResourceLoader::load(ext_name, "Animation", true); if (old_anim.is_valid()) { - //meergeee for (int i = 0; i < old_anim->get_track_count(); i++) { if (!old_anim->track_is_imported(i)) { old_anim->copy_track(i, anim); @@ -1001,7 +999,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String } } - anim->set_path(ext_name, true); //if not set, then its never saved externally + anim->set_path(ext_name, true); // Set path to save externally. ResourceSaver::save(ext_name, anim, ResourceSaver::FLAG_CHANGE_PATH); p_animations[anim] = anim; } diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 8dc7e4638db..edada73d911 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -244,7 +244,7 @@ AnimationTreeEditor::AnimationTreeEditor() { current_root = 0; singleton = this; - editor_base = memnew(PanelContainer); + editor_base = memnew(MarginContainer); editor_base->set_v_size_flags(SIZE_EXPAND_FILL); add_child(editor_base); diff --git a/editor/plugins/animation_tree_editor_plugin.h b/editor/plugins/animation_tree_editor_plugin.h index 0b93b0fd8e1..2146dfee455 100644 --- a/editor/plugins/animation_tree_editor_plugin.h +++ b/editor/plugins/animation_tree_editor_plugin.h @@ -56,7 +56,7 @@ class AnimationTreeEditor : public VBoxContainer { HBoxContainer *path_hb; AnimationTree *tree; - PanelContainer *editor_base; + MarginContainer *editor_base; Vector button_path; Vector edited_path; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index a6f9cf0e6d1..53642a30893 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -583,7 +583,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { ScriptEditorBase *current = Object::cast_to(tab_container->get_child(selected)); if (current) { if (p_save) { - apply_scripts(); + _menu_option(FILE_SAVE); } Ref