diff options
164 files changed, 673 insertions, 831 deletions
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index 6bd1382488..4b0858935d 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -166,7 +166,7 @@ <argument index="3" name="self_shape" type="int"> </argument> <description> - Emitted when another area enters, reporting which areas overlapped. + Emitted when another area enters, reporting which areas overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code]. </description> </signal> <signal name="area_shape_exited"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 9a5870c73d..be3acee9ef 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -155,7 +155,7 @@ <argument index="3" name="self_shape" type="int"> </argument> <description> - Emitted when another area enters, reporting which shapes overlapped. + Emitted when another area enters, reporting which shapes overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code]. </description> </signal> <signal name="area_shape_exited"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index e09c1f4b08..2d330fc935 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -93,7 +93,7 @@ <return type="Variant"> </return> <description> - Returns the last element of the array if the array is not empty. + Returns the last element of the array, or [code]null[/code] if the array is empty. </description> </method> <method name="bsearch"> @@ -186,7 +186,7 @@ <return type="Variant"> </return> <description> - Returns the first element of the array if the array is not empty. + Returns the first element of the array, or [code]null[/code] if the array is empty. </description> </method> <method name="has"> @@ -243,14 +243,14 @@ <return type="Variant"> </return> <description> - Removes the last element of the array. + Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="pop_front"> <return type="Variant"> </return> <description> - Removes the first element of the array. + Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="push_back"> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 16a28978d5..5b7c3def63 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BitmapFont" inherits="Font" category="Core" version="3.2"> <brief_description> - Renders text using [code]*.fnt[/code] fonts. + Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. + Handles files with the [code].fnt[/code] extension </brief_description> <description> Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont]. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 2fed423a32..748ed504c3 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -6,6 +6,27 @@ <description> A node with the ability to send HTTP requests. Uses [HTTPClient] internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. + [b]Example of contacting a REST API and printing one of its returned fields:[/b] + [codeblock] + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform the HTTP request. The URL below returns some JSON as of writing. + var error = http_request.request("https://httpbin.org/get") + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var response = parse_json(body.get_string_from_utf8()) + + # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). + print(response.headers["User-Agent"]) + [/codeblock] [b]Example of loading and displaying an image using HTTPRequest:[/b] [codeblock] func _ready(): diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml index e0807760f7..416128c9b1 100644 --- a/doc/classes/ImmediateGeometry.xml +++ b/doc/classes/ImmediateGeometry.xml @@ -30,7 +30,7 @@ <argument index="0" name="position" type="Vector3"> </argument> <description> - Adds a vertex with the currently set color/uv/etc. + Adds a vertex in local coordinate space with the currently set color/uv/etc. </description> </method> <method name="begin"> diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index 44447c8fc8..46e4176e9f 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -16,7 +16,7 @@ The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> - The colliding body's unique [RID]. + The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 51c2277fb2..4c9337f82d 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -16,7 +16,7 @@ The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> - The colliding body's unique [RID]. + The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 29c4680685..67e9597781 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Node2D" inherits="CanvasItem" category="Core" version="3.2"> <brief_description> - A 2D game object, parent of all 2D-related nodes. Has a position, rotation, scale and Z index. + A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. </brief_description> <description> - A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order. + A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 5a09fe39c0..1e5b8669fd 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -9,6 +9,12 @@ Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++. Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them. + Property membership can be tested directly in GDScript using [code]in[/code]: + [codeblock] + var n = Node2D.new() + print("position" in n) # Prints "True". + print("other_property" in n) # Prints "False". + [/codeblock] Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. </description> <tutorials> diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 07d7416905..a0628a24dd 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -4454,6 +4454,7 @@ void RasterizerStorageGLES3::multimesh_allocate(RID p_multimesh, int p_instances if (multimesh->buffer) { glDeleteBuffers(1, &multimesh->buffer); multimesh->data.resize(0); + multimesh->buffer = 0; } multimesh->size = p_instances; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 63b2938551..a330dbef77 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1260,7 +1260,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi float normalized_distance = light_length * omni_lights[idx].light_pos_inv_radius.w; float omni_attenuation; if (normalized_distance < 1.0) { - omni_attenuation = pow(normalized_distance, omni_lights[idx].light_direction_attenuation.w); + omni_attenuation = pow(1.0 - normalized_distance, omni_lights[idx].light_direction_attenuation.w); } else { omni_attenuation = 0.0; } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 4ec245eacf..a1eb36209a 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4579,7 +4579,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) { bool valid; subindices = _get_bezier_subindices_for_type(h.type, &valid); if (!valid) { - EditorNode::get_singleton()->show_warning("Invalid track for Bezier (no suitable sub-properties)"); + EditorNode::get_singleton()->show_warning(TTR("Invalid track for Bezier (no suitable sub-properties)")); return; } } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 44034fd127..235543d06d 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -32,6 +32,7 @@ #include "core/print_string.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "plugins/script_editor_plugin.h" #include "scene/gui/label.h" diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index fb7cf494cd..5f0168d0a6 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -33,8 +33,10 @@ #include "core/class_db.h" #include "core/os/keyboard.h" #include "core/print_string.h" +#include "editor_feature_profile.h" #include "editor_help.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "scene/gui/box_container.h" diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index c6046f7e19..2743aa8b0c 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -33,6 +33,7 @@ #include "core/io/resource_loader.h" #include "core/os/file_access.h" #include "editor_node.h" +#include "editor_scale.h" #include "scene/gui/margin_container.h" void DependencyEditor::_searched(const String &p_path) { diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 98e670f952..a5accf2ec7 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -34,6 +34,7 @@ #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "editor_node.h" +#include "progress_dialog.h" void EditorAssetInstaller::_update_subitems(TreeItem *p_item, bool p_check, bool p_first) { diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index acfdea28e2..f4f1dc58ba 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -34,6 +34,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "editor_node.h" +#include "editor_scale.h" #include "filesystem_dock.h" #include "scene/resources/font.h" #include "servers/audio_server.h" diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index f44e1b7b14..d26c77cf8c 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -33,6 +33,8 @@ #include "core/global_constants.h" #include "core/project_settings.h" #include "editor_node.h" +#include "editor_scale.h" +#include "project_settings_editor.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index bbbb50297f..2730e5cf89 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -35,6 +35,7 @@ #include "doc_data_compressed.gen.h" #include "editor/plugins/script_editor_plugin.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #define CONTRIBUTE_URL "https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html" diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 517a1c34d1..1c5f8fb7fc 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -31,7 +31,9 @@ #include "editor_help_search.h" #include "core/os/keyboard.h" +#include "editor_feature_profile.h" #include "editor_node.h" +#include "editor_scale.h" void EditorHelpSearch::_update_icons() { @@ -202,7 +204,7 @@ EditorHelpSearch::EditorHelpSearch() { vbox->add_child(hbox); search_box = memnew(LineEdit); - search_box->set_custom_minimum_size(Size2(200, 0)); + search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE); search_box->set_h_size_flags(SIZE_EXPAND_FILL); search_box->connect("gui_input", this, "_search_box_gui_input"); search_box->connect("text_changed", this, "_search_box_text_changed"); @@ -210,14 +212,14 @@ EditorHelpSearch::EditorHelpSearch() { hbox->add_child(search_box); case_sensitive_button = memnew(ToolButton); - case_sensitive_button->set_tooltip("Case Sensitive"); + case_sensitive_button->set_tooltip(TTR("Case Sensitive")); case_sensitive_button->connect("pressed", this, "_update_results"); case_sensitive_button->set_toggle_mode(true); case_sensitive_button->set_focus_mode(FOCUS_NONE); hbox->add_child(case_sensitive_button); hierarchy_button = memnew(ToolButton); - hierarchy_button->set_tooltip("Show Hierarchy"); + hierarchy_button->set_tooltip(TTR("Show Hierarchy")); hierarchy_button->connect("pressed", this, "_update_results"); hierarchy_button->set_toggle_mode(true); hierarchy_button->set_pressed(true); @@ -225,7 +227,7 @@ EditorHelpSearch::EditorHelpSearch() { hbox->add_child(hierarchy_button); filter_combo = memnew(OptionButton); - filter_combo->set_custom_minimum_size(Size2(200, 0)); + filter_combo->set_custom_minimum_size(Size2(200, 0) * EDSCALE); filter_combo->set_stretch_ratio(0); // Fixed width. filter_combo->add_item(TTR("Display All"), SEARCH_ALL); filter_combo->add_separator(); @@ -245,8 +247,8 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->set_column_title(0, TTR("Name")); results_tree->set_column_title(1, TTR("Member Type")); results_tree->set_column_expand(1, false); - results_tree->set_column_min_width(1, 150); - results_tree->set_custom_minimum_size(Size2(0, 100)); + results_tree->set_column_min_width(1, 150 * EDSCALE); + results_tree->set_custom_minimum_size(Size2(0, 100) * EDSCALE); results_tree->set_hide_root(true); results_tree->set_select_mode(Tree::SELECT_ROW); results_tree->connect("item_activated", this, "_confirmed"); @@ -517,7 +519,7 @@ TreeItem *EditorHelpSearch::Runner::_create_method_item(TreeItem *p_parent, cons tooltip += ", "; } tooltip += ")"; - return _create_member_item(p_parent, p_class_doc->name, "MemberMethod", p_doc->name, "Method", "method", tooltip); + return _create_member_item(p_parent, p_class_doc->name, "MemberMethod", p_doc->name, TTRC("Method"), "method", tooltip); } TreeItem *EditorHelpSearch::Runner::_create_signal_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::MethodDoc *p_doc) { @@ -532,13 +534,13 @@ TreeItem *EditorHelpSearch::Runner::_create_signal_item(TreeItem *p_parent, cons tooltip += ", "; } tooltip += ")"; - return _create_member_item(p_parent, p_class_doc->name, "MemberSignal", p_doc->name, "Signal", "signal", tooltip); + return _create_member_item(p_parent, p_class_doc->name, "MemberSignal", p_doc->name, TTRC("Signal"), "signal", tooltip); } TreeItem *EditorHelpSearch::Runner::_create_constant_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ConstantDoc *p_doc) { String tooltip = p_class_doc->name + "." + p_doc->name; - return _create_member_item(p_parent, p_class_doc->name, "MemberConstant", p_doc->name, "Constant", "constant", tooltip); + return _create_member_item(p_parent, p_class_doc->name, "MemberConstant", p_doc->name, TTRC("Constant"), "constant", tooltip); } TreeItem *EditorHelpSearch::Runner::_create_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc) { @@ -546,13 +548,13 @@ TreeItem *EditorHelpSearch::Runner::_create_property_item(TreeItem *p_parent, co String tooltip = p_doc->type + " " + p_class_doc->name + "." + p_doc->name; tooltip += "\n " + p_class_doc->name + "." + p_doc->setter + "(value) setter"; tooltip += "\n " + p_class_doc->name + "." + p_doc->getter + "() getter"; - return _create_member_item(p_parent, p_class_doc->name, "MemberProperty", p_doc->name, "Property", "property", tooltip); + return _create_member_item(p_parent, p_class_doc->name, "MemberProperty", p_doc->name, TTRC("Property"), "property", tooltip); } TreeItem *EditorHelpSearch::Runner::_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc) { String tooltip = p_doc->type + " " + p_class_doc->name + "." + p_doc->name; - return _create_member_item(p_parent, p_class_doc->name, "MemberTheme", p_doc->name, "Theme Property", "theme_item", tooltip); + return _create_member_item(p_parent, p_class_doc->name, "MemberTheme", p_doc->name, TTRC("Theme Property"), "theme_item", tooltip); } TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_type, const String &p_metatype, const String &p_tooltip) { @@ -575,7 +577,7 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons TreeItem *item = results_tree->create_item(p_parent); item->set_icon(0, icon); item->set_text(0, text); - item->set_text(1, TTR(p_type)); + item->set_text(1, TTRGET(p_type)); item->set_tooltip(0, p_tooltip); item->set_tooltip(1, p_tooltip); item->set_metadata(0, "class_" + p_metatype + ":" + p_class_name + ":" + p_name); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 96b6a32914..29a6f9365e 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -31,6 +31,7 @@ #include "editor_inspector.h" #include "array_property_edit.h" #include "dictionary_property_edit.h" +#include "editor_feature_profile.h" #include "editor_node.h" #include "editor_scale.h" #include "multi_node_edit.h" diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 5474f86c74..5b4c61ef8e 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -33,6 +33,7 @@ #include "core/os/keyboard.h" #include "core/version.h" #include "editor_node.h" +#include "editor_scale.h" #include "scene/gui/center_container.h" #include "scene/resources/dynamic_font.h" diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 1f7dfed06e..c8d87868ae 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -49,16 +49,44 @@ #include "core/version.h" #include "main/input_default.h" #include "main/main.h" +#include "scene/gui/center_container.h" +#include "scene/gui/control.h" +#include "scene/gui/dialogs.h" +#include "scene/gui/file_dialog.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/panel.h" +#include "scene/gui/panel_container.h" +#include "scene/gui/split_container.h" +#include "scene/gui/tab_container.h" +#include "scene/gui/tabs.h" +#include "scene/gui/texture_progress.h" +#include "scene/gui/tool_button.h" #include "scene/resources/packed_scene.h" #include "servers/physics_2d_server.h" +#include "editor/audio_stream_preview.h" +#include "editor/dependency_editor.h" +#include "editor/editor_about.h" #include "editor/editor_audio_buses.h" +#include "editor/editor_export.h" +#include "editor/editor_feature_profile.h" #include "editor/editor_file_system.h" #include "editor/editor_help.h" +#include "editor/editor_inspector.h" +#include "editor/editor_layouts_dialog.h" +#include "editor/editor_log.h" +#include "editor/editor_plugin.h" #include "editor/editor_properties.h" +#include "editor/editor_resource_preview.h" +#include "editor/editor_run_native.h" +#include "editor/editor_run_script.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_spin_slider.h" #include "editor/editor_themes.h" +#include "editor/export_template_manager.h" +#include "editor/fileserver/editor_file_server.h" +#include "editor/filesystem_dock.h" #include "editor/import/editor_import_collada.h" #include "editor/import/editor_scene_importer_gltf.h" #include "editor/import/resource_importer_bitmask.h" @@ -71,7 +99,11 @@ #include "editor/import/resource_importer_texture.h" #include "editor/import/resource_importer_texture_atlas.h" #include "editor/import/resource_importer_wav.h" +#include "editor/import_dock.h" #include "editor/multi_node_edit.h" +#include "editor/node_dock.h" +#include "editor/pane_drag.h" +#include "editor/plugin_config_dialog.h" #include "editor/plugins/animation_blend_space_1d_editor.h" #include "editor/plugins/animation_blend_space_2d_editor.h" #include "editor/plugins/animation_blend_tree_editor_plugin.h" @@ -128,9 +160,15 @@ #include "editor/plugins/tile_set_editor_plugin.h" #include "editor/plugins/version_control_editor_plugin.h" #include "editor/plugins/visual_shader_editor_plugin.h" +#include "editor/progress_dialog.h" +#include "editor/project_export.h" +#include "editor/project_settings_editor.h" #include "editor/pvrtc_compress.h" +#include "editor/quick_open.h" #include "editor/register_exporters.h" +#include "editor/run_settings_dialog.h" #include "editor/script_editor_debugger.h" +#include "editor/settings_config_dialog.h" #include <stdio.h> @@ -1021,71 +1059,75 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) { void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { EditorProgress save("save", TTR("Saving Scene"), 4); - save.step(TTR("Analyzing"), 0); - int c2d = 0; - int c3d = 0; - _find_node_types(editor_data.get_edited_scene_root(), c2d, c3d); + if (editor_data.get_edited_scene_root() != NULL) { + save.step(TTR("Analyzing"), 0); - bool is2d; - if (c3d < c2d) { - is2d = true; - } else { - is2d = false; - } - save.step(TTR("Creating Thumbnail"), 1); - //current view? + int c2d = 0; + int c3d = 0; - Ref<Image> img; - if (is2d) { - img = scene_root->get_texture()->get_data(); - } else { - img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); - } + _find_node_types(editor_data.get_edited_scene_root(), c2d, c3d); - if (img.is_valid()) { + bool is2d; + if (c3d < c2d) { + is2d = true; + } else { + is2d = false; + } + save.step(TTR("Creating Thumbnail"), 1); + //current view? - img = img->duplicate(); + Ref<Image> img; + if (is2d) { + img = scene_root->get_texture()->get_data(); + } else { + img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); + } - save.step(TTR("Creating Thumbnail"), 2); - save.step(TTR("Creating Thumbnail"), 3); + if (img.is_valid()) { - int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); - preview_size *= EDSCALE; + img = img->duplicate(); - // consider a square region - int vp_size = MIN(img->get_width(), img->get_height()); - int x = (img->get_width() - vp_size) / 2; - int y = (img->get_height() - vp_size) / 2; + save.step(TTR("Creating Thumbnail"), 2); + save.step(TTR("Creating Thumbnail"), 3); - if (vp_size < preview_size) { - // just square it. - img->crop_from_point(x, y, vp_size, vp_size); - } else { - int ratio = vp_size / preview_size; - int size = preview_size * MAX(1, ratio / 2); + int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + preview_size *= EDSCALE; - x = (img->get_width() - size) / 2; - y = (img->get_height() - size) / 2; + // consider a square region + int vp_size = MIN(img->get_width(), img->get_height()); + int x = (img->get_width() - vp_size) / 2; + int y = (img->get_height() - vp_size) / 2; - img->crop_from_point(x, y, size, size); - img->resize(preview_size, preview_size, Image::INTERPOLATE_LANCZOS); - } - img->convert(Image::FORMAT_RGB8); + if (vp_size < preview_size) { + // just square it. + img->crop_from_point(x, y, vp_size, vp_size); + } else { + int ratio = vp_size / preview_size; + int size = preview_size * MAX(1, ratio / 2); - img->flip_y(); + x = (img->get_width() - size) / 2; + y = (img->get_height() - size) / 2; - //save thumbnail directly, as thumbnailer may not update due to actual scene not changing md5 - String temp_path = EditorSettings::get_singleton()->get_cache_dir(); - String cache_base = ProjectSettings::get_singleton()->globalize_path(p_file).md5_text(); - cache_base = temp_path.plus_file("resthumb-" + cache_base); + img->crop_from_point(x, y, size, size); + img->resize(preview_size, preview_size, Image::INTERPOLATE_LANCZOS); + } + img->convert(Image::FORMAT_RGB8); + + img->flip_y(); - //does not have it, try to load a cached thumbnail + //save thumbnail directly, as thumbnailer may not update due to actual scene not changing md5 + String temp_path = EditorSettings::get_singleton()->get_cache_dir(); + String cache_base = ProjectSettings::get_singleton()->globalize_path(p_file).md5_text(); + cache_base = temp_path.plus_file("resthumb-" + cache_base); - String file = cache_base + ".png"; + //does not have it, try to load a cached thumbnail - post_process_preview(img); - img->save_png(file); + String file = cache_base + ".png"; + + post_process_preview(img); + img->save_png(file); + } } save.step(TTR("Saving Scene"), 4); diff --git a/editor/editor_node.h b/editor/editor_node.h index c9002c309e..38f529252f 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -31,66 +31,59 @@ #ifndef EDITOR_NODE_H #define EDITOR_NODE_H -#include "core/print_string.h" -#include "editor/audio_stream_preview.h" -#include "editor/connections_dialog.h" -#include "editor/create_dialog.h" -#include "editor/editor_about.h" #include "editor/editor_data.h" -#include "editor/editor_export.h" -#include "editor/editor_feature_profile.h" #include "editor/editor_folding.h" -#include "editor/editor_inspector.h" -#include "editor/editor_layouts_dialog.h" -#include "editor/editor_log.h" -#include "editor/editor_plugin.h" -#include "editor/editor_resource_preview.h" #include "editor/editor_run.h" -#include "editor/editor_run_native.h" -#include "editor/editor_run_script.h" -#include "editor/editor_scale.h" -#include "editor/editor_sub_scene.h" -#include "editor/export_template_manager.h" -#include "editor/fileserver/editor_file_server.h" -#include "editor/filesystem_dock.h" -#include "editor/groups_editor.h" -#include "editor/import_dock.h" #include "editor/inspector_dock.h" -#include "editor/node_dock.h" -#include "editor/pane_drag.h" -#include "editor/plugin_config_dialog.h" -#include "editor/progress_dialog.h" -#include "editor/project_export.h" -#include "editor/project_settings_editor.h" #include "editor/property_editor.h" -#include "editor/quick_open.h" -#include "editor/reparent_dialog.h" -#include "editor/run_settings_dialog.h" #include "editor/scene_tree_dock.h" -#include "editor/scene_tree_editor.h" -#include "editor/script_create_dialog.h" -#include "editor/settings_config_dialog.h" -#include "scene/gui/center_container.h" -#include "scene/gui/control.h" -#include "scene/gui/dialogs.h" -#include "scene/gui/file_dialog.h" -#include "scene/gui/menu_button.h" -#include "scene/gui/panel.h" -#include "scene/gui/panel_container.h" -#include "scene/gui/separator.h" -#include "scene/gui/split_container.h" -#include "scene/gui/tab_container.h" -#include "scene/gui/tabs.h" -#include "scene/gui/texture_progress.h" -#include "scene/gui/tool_button.h" -#include "scene/gui/tree.h" -#include "scene/gui/viewport_container.h" typedef void (*EditorNodeInitCallback)(); typedef void (*EditorPluginInitializeCallback)(); typedef bool (*EditorBuildCallback)(); +class AcceptDialog; +class AudioStreamPreviewGenerator; +class BackgroundProgress; +class CenterContainer; +class ConfirmationDialog; +class Control; +class DependencyEditor; +class DependencyErrorDialog; +class EditorAbout; +class EditorExport; +class EditorFeatureProfileManager; +class EditorFileServer; +class EditorInspector; +class EditorLayoutsDialog; +class EditorLog; +class EditorPlugin; class EditorPluginList; +class EditorQuickOpen; +class EditorResourcePreview; +class EditorRunNative; +class EditorSettingsDialog; +class ExportTemplateManager; +class FileSystemDock; +class HSplitContainer; +class ImportDock; +class MenuButton; +class NodeDock; +class OrphanResourcesDialog; +class PaneDrag; +class Panel; +class PanelContainer; +class PluginConfigDialog; +class ProgressDialog; +class ProjectExportDialog; +class ProjectSettingsEditor; +class RunSettingsDialog; +class ScriptCreateDialog; +class TabContainer; +class Tabs; +class TextureProgress; +class ToolButton; +class VSplitContainer; class EditorNode : public Node { diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 310a107ca9..b6ccacb03e 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -30,8 +30,11 @@ #include "editor_plugin.h" +#include "editor/editor_export.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/filesystem_dock.h" +#include "editor/project_settings_editor.h" #include "editor_resource_preview.h" #include "main/main.h" #include "plugins/canvas_item_editor_plugin.h" diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 514b3ff5d2..6de4030a30 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -35,6 +35,7 @@ #include "core/os/main_loop.h" #include "core/project_settings.h" #include "editor_node.h" +#include "editor_scale.h" #include "scene/gui/margin_container.h" void EditorPluginSettings::_notification(int p_what) { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 4bce6f34d3..4ed87c67dc 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -31,8 +31,10 @@ #include "editor_properties.h" #include "editor/editor_resource_preview.h" +#include "editor/filesystem_dock.h" #include "editor_node.h" #include "editor_properties_array_dict.h" +#include "editor_scale.h" #include "scene/main/viewport.h" ///////////////////// NULL ///////////////////////// diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 87e8a53e94..0bbc3424b5 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -34,6 +34,7 @@ #include "core/io/compression.h" #include "core/io/config_file.h" #include "core/io/file_access_memory.h" +#include "core/io/ip.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/translation_loader_po.h" diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 68ce709090..9b306c50d0 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -38,6 +38,8 @@ #include "core/version.h" #include "editor_node.h" #include "editor_scale.h" +#include "progress_dialog.h" +#include "scene/gui/link_button.h" void ExportTemplateManager::_update_template_list() { @@ -351,7 +353,7 @@ void ExportTemplateManager::ok_pressed() { void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) { if (p_status != HTTPRequest::RESULT_SUCCESS || p_code != 200) { - EditorNode::get_singleton()->show_warning("Error getting the list of mirrors."); + EditorNode::get_singleton()->show_warning(TTR("Error getting the list of mirrors.")); return; } @@ -369,7 +371,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_ int errline; Error err = JSON::parse(mirror_str, r, errs, errline); if (err != OK) { - EditorNode::get_singleton()->show_warning("Error parsing JSON of mirror list. Please report this issue!"); + EditorNode::get_singleton()->show_warning(TTR("Error parsing JSON of mirror list. Please report this issue!")); return; } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index eb3ae33065..5b08c3c567 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -36,8 +36,12 @@ #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/project_settings.h" +#include "editor_feature_profile.h" #include "editor_node.h" +#include "editor_resource_preview.h" +#include "editor_scale.h" #include "editor_settings.h" +#include "import_dock.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" @@ -1746,8 +1750,8 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected if (!fpath.ends_with("/")) { fpath = fpath.get_base_dir(); } - make_script_dialog_text->config("Node", fpath.plus_file("new_script.gd"), false); - make_script_dialog_text->popup_centered(Size2(300, 300) * EDSCALE); + make_script_dialog->config("Node", fpath.plus_file("new_script.gd"), false); + make_script_dialog->popup_centered(Size2(300, 300) * EDSCALE); } break; case FILE_COPY_PATH: { @@ -2682,9 +2686,9 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { make_scene_dialog->register_text_enter(make_scene_dialog_text); make_scene_dialog->connect("confirmed", this, "_make_scene_confirm"); - make_script_dialog_text = memnew(ScriptCreateDialog); - make_script_dialog_text->set_title(TTR("Create Script")); - add_child(make_script_dialog_text); + make_script_dialog = memnew(ScriptCreateDialog); + make_script_dialog->set_title(TTR("Create Script")); + add_child(make_script_dialog); new_resource_dialog = memnew(CreateDialog); add_child(new_resource_dialog); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index d81a5133f2..f8e0eb4d71 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -140,7 +140,7 @@ private: ConfirmationDialog *make_scene_dialog; LineEdit *make_scene_dialog_text; ConfirmationDialog *overwrite_dialog; - ScriptCreateDialog *make_script_dialog_text; + ScriptCreateDialog *make_script_dialog; CreateDialog *new_resource_dialog; bool always_show_folders; diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index b2db1f85dd..41878d18b0 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -31,6 +31,7 @@ #include "groups_editor.h" #include "editor/scene_tree_editor.h" #include "editor_node.h" +#include "editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/resources/packed_scene.h" diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index be066e15a5..796b950444 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -855,25 +855,24 @@ PoolVector<Color> EditorSceneImporterGLTF::_decode_accessor_as_color(GLTFState & const int type = state.accessors[p_accessor].type; ERR_FAIL_COND_V(!(type == TYPE_VEC3 || type == TYPE_VEC4), ret); - int components; - if (type == TYPE_VEC3) { - components = 3; - } else { // TYPE_VEC4 - components = 4; + int vec_len = 3; + if (type == TYPE_VEC4) { + vec_len = 4; } - ERR_FAIL_COND_V(attribs.size() % components != 0, ret); + ERR_FAIL_COND_V(attribs.size() % vec_len != 0, ret); const double *attribs_ptr = attribs.ptr(); - const int ret_size = attribs.size() / components; + const int ret_size = attribs.size() / vec_len; ret.resize(ret_size); { PoolVector<Color>::Write w = ret.write(); for (int i = 0; i < ret_size; i++) { - w[i] = Color(attribs_ptr[i * 4 + 0], attribs_ptr[i * 4 + 1], attribs_ptr[i * 4 + 2], components == 4 ? attribs_ptr[i * 4 + 3] : 1.0); + w[i] = Color(attribs_ptr[i * vec_len + 0], attribs_ptr[i * vec_len + 1], attribs_ptr[i * vec_len + 2], vec_len == 4 ? attribs_ptr[i * 4 + 3] : 1.0); } } return ret; } + Vector<Quat> EditorSceneImporterGLTF::_decode_accessor_as_quat(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) { const Vector<double> attribs = _decode_accessor(state, p_accessor, p_for_vertex); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 947e322075..7e9c9d958e 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -30,6 +30,7 @@ #include "import_dock.h" #include "editor_node.h" +#include "editor_resource_preview.h" class ImportDockParameters : public Object { GDCLASS(ImportDockParameters, Object); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 7ba1796600..e666135346 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -31,6 +31,7 @@ #include "node_dock.h" #include "editor_node.h" +#include "editor_scale.h" void NodeDock::show_groups() { diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 971e746509..0291a08118 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -33,6 +33,8 @@ #include "core/os/dir_access.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" +#include "editor/editor_scale.h" +#include "editor/project_settings_editor.h" #include "modules/gdscript/gdscript.h" #include "scene/gui/grid_container.h" diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 7f023af848..f84d383606 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -32,6 +32,7 @@ #include "canvas_item_editor_plugin.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" AbstractPolygon2DEditor::Vertex::Vertex() : polygon(-1), diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 475e4c8d67..f684745d1d 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -31,6 +31,7 @@ #include "animation_blend_space_1d_editor.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_blend_tree.h" StringName AnimationNodeBlendSpace1DEditor::get_blend_position_path() const { diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index b422e3e927..fe13bbdb99 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -35,6 +35,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index e147206ec4..d101dec642 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -35,9 +35,11 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_inspector.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" +#include "scene/gui/progress_bar.h" #include "scene/main/viewport.h" void AnimationNodeBlendTreeEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script) { diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h index 77b57a50d0..df3e681322 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.h +++ b/editor/plugins/animation_blend_tree_editor_plugin.h @@ -41,6 +41,8 @@ #include "scene/gui/popup.h" #include "scene/gui/tree.h" +class ProgressBar; + class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { GDCLASS(AnimationNodeBlendTreeEditor, AnimationTreeNodeEditorPlugin); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 1480cc6ac4..16be9f0781 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -36,6 +36,7 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/animation_track_editor.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" // For onion skinning. diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index f627cdf5d8..884e665494 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -35,6 +35,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" @@ -262,7 +263,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv if (connecting_to_node != StringName()) { if (state_machine->has_transition(connecting_from, connecting_to_node)) { - EditorNode::get_singleton()->show_warning("Transition exists!"); + EditorNode::get_singleton()->show_warning(TTR("Transition exists!")); } else { diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index ce31714e0c..a4d6071099 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -33,7 +33,9 @@ #include "core/io/json.h" #include "core/version.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/project_settings_editor.h" void EditorAssetLibraryItem::configure(const String &p_title, int p_asset_id, const String &p_category, int p_category_id, const String &p_author, int p_author_id, const String &p_cost) { diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 0ab3d26c85..c6a375d3aa 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -32,6 +32,7 @@ #include "core/io/resource_loader.h" #include "core/project_settings.h" +#include "editor/audio_stream_preview.h" #include "editor/editor_settings.h" void AudioStreamEditor::_notification(int p_what) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 17765c6454..4512a228ef 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "core/print_string.h" #include "core/project_settings.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" @@ -47,6 +48,7 @@ #include "scene/2d/touch_screen_button.h" #include "scene/gui/grid_container.h" #include "scene/gui/nine_patch_rect.h" +#include "scene/gui/viewport_container.h" #include "scene/main/canvas_layer.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 6e15bad9af..9b0ddab0ce 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -34,6 +34,7 @@ #include "core/core_string_names.h" #include "core/os/input.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" CurveEditor::CurveEditor() { _selected_point = -1; diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index 9071146863..bf655400db 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -33,6 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" +#include "editor/editor_resource_preview.h" #include "scene/resources/curve.h" // Edits a y(x) curve diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 204562ac38..75ae050612 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -40,6 +40,7 @@ #include "scene/resources/dynamic_font.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" +#include "servers/audio/audio_stream.h" void post_process_preview(Ref<Image> p_image) { diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index e85c475ad7..d4c6622674 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -31,6 +31,7 @@ #include "gradient_editor_plugin.h" #include "canvas_item_editor_plugin.h" +#include "editor/editor_scale.h" #include "spatial_editor_plugin.h" Size2 GradientEditor::get_minimum_size() const { diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index b3f3ccf501..2c1cb32143 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -31,6 +31,7 @@ #include "item_list_editor_plugin.h" #include "core/io/resource_loader.h" +#include "editor/editor_scale.h" bool ItemListPlugin::_set(const StringName &p_name, const Variant &p_value) { diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index e125c18ef1..840787dda1 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -30,6 +30,8 @@ #include "material_editor_plugin.h" +#include "editor/editor_scale.h" +#include "scene/gui/viewport_container.h" #include "scene/resources/particles_material.h" void MaterialEditor::_notification(int p_what) { diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 1405127ab3..c54c780c7e 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -41,6 +41,8 @@ #include "scene/3d/mesh_instance.h" #include "scene/resources/material.h" +class ViewportContainer; + class MaterialEditor : public Control { GDCLASS(MaterialEditor, Control); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 442110cc84..d3bdca14e7 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -30,6 +30,8 @@ #include "mesh_editor_plugin.h" +#include "editor/editor_scale.h" + void MeshEditor::_gui_input(Ref<InputEvent> p_event) { Ref<InputEventMouseMotion> mm = p_event; diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 4c2a81ed70..1a2741d00a 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -36,6 +36,7 @@ #include "scene/3d/camera.h" #include "scene/3d/light.h" #include "scene/3d/mesh_instance.h" +#include "scene/gui/viewport_container.h" #include "scene/resources/material.h" class MeshEditor : public ViewportContainer { diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 22df8fd8f4..1ead1b8062 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -30,6 +30,7 @@ #include "mesh_instance_editor_plugin.h" +#include "editor/editor_scale.h" #include "scene/3d/collision_shape.h" #include "scene/3d/navigation_mesh.h" #include "scene/3d/physics_body.h" @@ -456,7 +457,7 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(err_dialog); debug_uv_dialog = memnew(AcceptDialog); - debug_uv_dialog->set_title("UV Channel Debug"); + debug_uv_dialog->set_title(TTR("UV Channel Debug")); add_child(debug_uv_dialog); debug_uv = memnew(Control); debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE); diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index fc3ca38104..1e4dd9d6bf 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -241,7 +241,7 @@ void MeshLibraryEditor::_menu_cbk(int p_option) { } break; case MENU_OPTION_UPDATE_FROM_SCENE: { - cd->set_text("Update from existing scene?:\n" + String(mesh_library->get_meta("_editor_source_scene"))); + cd->set_text(vformat(TTR("Update from existing scene?:\n%s"), String(mesh_library->get_meta("_editor_source_scene")))); cd->popup_centered(Size2(500, 60)); } break; } diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index f02dc0bd6d..dcb32641e8 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "canvas_item_editor_plugin.h" #include "core/os/file_access.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" void Path2DEditor::_notification(int p_what) { diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 503e6ac135..5512366f4f 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -34,6 +34,7 @@ #include "core/os/file_access.h" #include "core/os/input.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "scene/2d/skeleton_2d.h" diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9e6201db2b..b809397b95 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -37,7 +37,10 @@ #include "core/os/os.h" #include "core/project_settings.h" #include "editor/editor_node.h" +#include "editor/editor_run_script.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/filesystem_dock.h" #include "editor/find_in_files.h" #include "editor/node_dock.h" #include "editor/plugins/shader_editor_plugin.h" diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index c57ffa8ee3..ef6f864a87 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -33,6 +33,7 @@ #include "core/math/expression.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/script_editor_debugger.h" @@ -1559,7 +1560,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data Node *sn = _find_script_node(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root(), script); if (!sn) { - EditorNode::get_singleton()->show_warning("Can't drop nodes because script '" + get_name() + "' is not used in this scene."); + EditorNode::get_singleton()->show_warning(vformat(TTR("Can't drop nodes because script '%s' is not used in this scene."), get_name())); return; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index b590fc5ed1..a7c1becabd 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -37,6 +37,7 @@ #include "core/project_settings.h" #include "core/sort_array.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" @@ -47,6 +48,7 @@ #include "scene/3d/mesh_instance.h" #include "scene/3d/physics_body.h" #include "scene/3d/visual_instance.h" +#include "scene/gui/viewport_container.h" #include "scene/resources/packed_scene.h" #include "scene/resources/surface_tool.h" diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 65e3c32ca8..ecb7363401 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -41,6 +41,7 @@ class Camera; class SpatialEditor; class EditorSpatialGizmoPlugin; +class ViewportContainer; class EditorSpatialGizmo : public SpatialGizmo { diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index 40734cffc4..7759fd2fa6 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -31,6 +31,7 @@ #include "sprite_editor_plugin.h" #include "canvas_item_editor_plugin.h" +#include "editor/editor_scale.h" #include "scene/2d/collision_polygon_2d.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/mesh_instance_2d.h" @@ -125,7 +126,7 @@ void SpriteEditor::_menu_option(int p_option) { case MENU_OPTION_CONVERT_TO_MESH_2D: { debug_uv_dialog->get_ok()->set_text(TTR("Create Mesh2D")); - debug_uv_dialog->set_title("Mesh2D Preview"); + debug_uv_dialog->set_title(TTR("Mesh2D Preview")); _update_mesh_data(); debug_uv_dialog->popup_centered(); @@ -135,7 +136,7 @@ void SpriteEditor::_menu_option(int p_option) { case MENU_OPTION_CONVERT_TO_POLYGON_2D: { debug_uv_dialog->get_ok()->set_text(TTR("Create Polygon2D")); - debug_uv_dialog->set_title("Polygon2D Preview"); + debug_uv_dialog->set_title(TTR("Polygon2D Preview")); _update_mesh_data(); debug_uv_dialog->popup_centered(); @@ -144,7 +145,7 @@ void SpriteEditor::_menu_option(int p_option) { case MENU_OPTION_CREATE_COLLISION_POLY_2D: { debug_uv_dialog->get_ok()->set_text(TTR("Create CollisionPolygon2D")); - debug_uv_dialog->set_title("CollisionPolygon2D Preview"); + debug_uv_dialog->set_title(TTR("CollisionPolygon2D Preview")); _update_mesh_data(); debug_uv_dialog->popup_centered(); @@ -154,7 +155,7 @@ void SpriteEditor::_menu_option(int p_option) { case MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D: { debug_uv_dialog->get_ok()->set_text(TTR("Create LightOccluder2D")); - debug_uv_dialog->set_title("LightOccluder2D Preview"); + debug_uv_dialog->set_title(TTR("LightOccluder2D Preview")); _update_mesh_data(); debug_uv_dialog->popup_centered(); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index a4c3ff5dcd..dd58ec23ce 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -32,8 +32,10 @@ #include "core/io/resource_loader.h" #include "core/project_settings.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "scene/3d/sprite_3d.h" +#include "scene/gui/center_container.h" void SpriteFramesEditor::_gui_input(Ref<InputEvent> p_event) { } @@ -202,7 +204,7 @@ void SpriteFramesEditor::_prepare_sprite_sheet(const String &p_file) { Ref<Resource> texture = ResourceLoader::load(p_file); if (!texture.is_valid()) { - EditorNode::get_singleton()->show_warning("Unable to load images"); + EditorNode::get_singleton()->show_warning(TTR("Unable to load images")); ERR_FAIL_COND(!texture.is_valid()); } if (texture != split_sheet_preview->get_texture()) { diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 7e5e278689..90a47999e0 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -30,6 +30,8 @@ #include "style_box_editor_plugin.h" +#include "editor/editor_scale.h" + bool EditorInspectorPluginStyleBox::can_handle(Object *p_object) { return Object::cast_to<StyleBox>(p_object) != NULL; diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8e49bba7b2..f576eb96c9 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "core/core_string_names.h" #include "core/os/input.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" #include "scene/gui/check_box.h" /** diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index e1aa83e9ab..52c28b84f6 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -32,6 +32,8 @@ #include "core/os/file_access.h" #include "core/version.h" +#include "editor/editor_scale.h" +#include "scene/gui/progress_bar.h" void ThemeEditor::edit(const Ref<Theme> &p_theme) { @@ -908,7 +910,7 @@ ThemeEditorPlugin::ThemeEditorPlugin(EditorNode *p_node) { editor = p_node; theme_editor = memnew(ThemeEditor); - theme_editor->set_custom_minimum_size(Size2(0, 200)); + theme_editor->set_custom_minimum_size(Size2(0, 200) * EDSCALE); button = editor->add_bottom_panel_item(TTR("Theme"), theme_editor); button->hide(); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 259a7c9132..6e0158670d 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -32,6 +32,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" +#include "editor/editor_scale.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "scene/2d/physics_body_2d.h" #include "scene/2d/sprite.h" @@ -2036,10 +2037,10 @@ void TileSetEditor::_update_toggle_shape_button() { tools[SHAPE_TOGGLE_TYPE]->hide(); } else if (concave.is_valid()) { tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConvexPolygonShape2D", "EditorIcons")); - tools[SHAPE_TOGGLE_TYPE]->set_text("Make Convex"); + tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Convex")); } else if (convex.is_valid()) { tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConcavePolygonShape2D", "EditorIcons")); - tools[SHAPE_TOGGLE_TYPE]->set_text("Make Concave"); + tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Concave")); } else { // Shouldn't happen separator_shape_toggle->hide(); diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index aa3bd74c49..d5dca9b61e 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "core/script_language.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" VersionControlEditorPlugin *VersionControlEditorPlugin::singleton = NULL; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 1a74779fb5..427b810672 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -35,7 +35,9 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/editor_log.h" #include "editor/editor_properties.h" +#include "editor/editor_scale.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 5e2e98a1d8..cca40054a4 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -40,6 +40,7 @@ #include "core/project_settings.h" #include "editor_data.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "scene/gui/box_container.h" #include "scene/gui/margin_container.h" diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 0428aafe7e..0dbc15fc78 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -35,7 +35,9 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" #include "core/translation.h" +#include "editor/editor_export.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "scene/gui/margin_container.h" #include "scene/gui/tab_container.h" diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ce82d44164..945eb4bfb7 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -47,7 +47,9 @@ #include "editor/editor_file_system.h" #include "editor/editor_help.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/filesystem_dock.h" #include "editor/multi_node_edit.h" #include "editor/property_selector.h" #include "scene/gui/label.h" diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index cc9e14975f..9f77f9d82a 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -32,6 +32,7 @@ #include "core/print_string.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "editor_themes.h" #include "modules/regex/regex.h" @@ -106,7 +107,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und // -- Feature Tabs - const int feature_min_height = 160; + const int feature_min_height = 160 * EDSCALE; Ref<Theme> collapse_theme = create_editor_theme(); collapse_theme->set_icon("checked", "CheckBox", collapse_theme->get_icon("GuiTreeArrowDown", "EditorIcons")); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 5c08482aa4..95e4b05586 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -35,7 +35,9 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/editor_feature_profile.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/multi_node_edit.h" #include "editor/plugins/animation_player_editor_plugin.h" diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index dc5eb4bbd0..433b1d91d4 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -32,9 +32,10 @@ #include "core/message_queue.h" #include "core/print_string.h" +#include "editor/editor_node.h" +#include "editor/node_dock.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h" -#include "editor_node.h" #include "scene/gui/label.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index fd34d8f5d6..c7ed612f29 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -35,9 +35,11 @@ #include "core/ustring.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/spatial_editor_plugin.h" +#include "editor_log.h" #include "editor_network_profiler.h" #include "editor_node.h" #include "editor_profiler.h" +#include "editor_scale.h" #include "editor_settings.h" #include "main/performance.h" #include "property_editor.h" diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index a780b117e1..5c3856ac27 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -33,7 +33,9 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor_file_system.h" +#include "editor_log.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "scene/gui/margin_container.h" #include "script_editor_debugger.h" diff --git a/main/main.cpp b/main/main.cpp index 3ac343a3c5..c1dc4e37ca 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -75,6 +75,7 @@ #include "editor/doc/doc_data_class_path.gen.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/progress_dialog.h" #include "editor/project_manager.h" #endif @@ -285,8 +286,8 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" -s, --script <script> Run a script.\n"); OS::get_singleton()->print(" --check-only Only parse for errors and quit (use with --script).\n"); #ifdef TOOLS_ENABLED - OS::get_singleton()->print(" --export <target> Export the project using the given export target. Export only main pack if path ends with .pck or .zip.\n"); - OS::get_singleton()->print(" --export-debug <target> Like --export, but use debug template.\n"); + OS::get_singleton()->print(" --export <target> <path> Export the project using the given export target. Export only main pack if path ends with .pck or .zip. <path> is relative to the project directory.\n"); + OS::get_singleton()->print(" --export-debug <target> <path> Like --export, but use debug template.\n"); OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n"); OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n"); OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects).\n"); diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 5c84222797..78d26dc827 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -32,6 +32,8 @@ #include "gdnative_library_editor_plugin.h" #include "gdnative.h" +#include "editor/editor_scale.h" + void GDNativeLibraryEditor::edit(Ref<GDNativeLibrary> p_library) { library = p_library; Ref<ConfigFile> config = p_library->get_config_file(); diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index fa59c704d5..818da65fb1 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -47,6 +47,7 @@ #include "core/project_settings.h" #ifdef TOOLS_ENABLED +#include "editor/editor_export.h" #include "editor/editor_node.h" #include "gdnative_library_editor_plugin.h" #include "gdnative_library_singleton_editor.h" diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp index 8d58b99e02..ee4de3e216 100644 --- a/modules/gdscript/language_server/gdscript_language_server.cpp +++ b/modules/gdscript/language_server/gdscript_language_server.cpp @@ -31,6 +31,7 @@ #include "gdscript_language_server.h" #include "core/os/file_access.h" #include "core/os/os.h" +#include "editor/editor_log.h" #include "editor/editor_node.h" GDScriptLanguageServer::GDScriptLanguageServer() { diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 1bd570c55f..63771f1583 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1256,7 +1256,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { options->get_popup()->add_item(TTR("Cursor Back Rotate Z"), MENU_OPTION_CURSOR_BACK_ROTATE_Z, KEY_MASK_SHIFT + KEY_D); options->get_popup()->add_item(TTR("Cursor Clear Rotation"), MENU_OPTION_CURSOR_CLEAR_ROTATION, KEY_W); options->get_popup()->add_separator(); - options->get_popup()->add_check_item("Paste Selects", MENU_OPTION_PASTE_SELECTS); + options->get_popup()->add_check_item(TTR("Paste Selects"), MENU_OPTION_PASTE_SELECTS); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Duplicate Selection"), MENU_OPTION_SELECTION_DUPLICATE, KEY_MASK_CTRL + KEY_C); options->get_popup()->add_item(TTR("Cut Selection"), MENU_OPTION_SELECTION_CUT, KEY_MASK_CTRL + KEY_X); diff --git a/modules/mono/SCsub b/modules/mono/SCsub index 457edfaeed..41be367f2f 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -8,14 +8,10 @@ Import('env_modules') env_mono = env_modules.Clone() -if env['tools']: +if env_mono['tools']: # NOTE: It is safe to generate this file here, since this is still executed serially - import build_scripts.make_cs_compressed_header as make_cs_compressed_header - make_cs_compressed_header.generate_header( - 'glue/Managed/Files', - 'glue/cs_compressed.gen.h', - 'glue/cs_glue_version.gen.h' - ) + import build_scripts.gen_cs_glue_version as gen_cs_glue_version + gen_cs_glue_version.generate_header('glue/GodotSharp', 'glue/cs_glue_version.gen.h') # Glue sources if env_mono['mono_glue']: @@ -38,24 +34,14 @@ env_mono = conf.Finish() mono_configure.configure(env, env_mono) -# Build Godot API solution - if env_mono['tools'] and env_mono['mono_glue']: + # Build Godot API solution import build_scripts.api_solution_build as api_solution_build api_sln_cmd = api_solution_build.build(env_mono) -# Build GodotTools - -if env_mono['tools']: + # Build GodotTools import build_scripts.godot_tools_build as godot_tools_build - if env_mono['mono_glue']: - godot_tools_build.build(env_mono, api_sln_cmd) - else: - # Building without the glue sources so the Godot API solution may be missing. - # GodotTools depends on the Godot API solution. As such, we will only build - # GodotTools.ProjectEditor which doesn't depend on the Godot API solution and - # is required by the bindings generator in order to be able to generated it. - godot_tools_build.build_project_editor_only(env_mono) + godot_tools_build.build(env_mono, api_sln_cmd) # Add sources diff --git a/modules/mono/build_scripts/api_solution_build.py b/modules/mono/build_scripts/api_solution_build.py index be54d0a679..639197c285 100644 --- a/modules/mono/build_scripts/api_solution_build.py +++ b/modules/mono/build_scripts/api_solution_build.py @@ -10,10 +10,7 @@ def build_api_solution(source, target, env): module_dir = env['module_dir'] - solution_path = os.path.join(module_dir, 'glue/Managed/Generated/GodotSharp.sln') - - if not os.path.isfile(solution_path): - raise RuntimeError("Godot API solution not found. Did you forget to run '--generate-mono-glue'?") + solution_path = os.path.join(module_dir, 'glue/GodotSharp/GodotSharp.sln') build_config = env['solution_build_config'] diff --git a/modules/mono/build_scripts/gen_cs_glue_version.py b/modules/mono/build_scripts/gen_cs_glue_version.py new file mode 100644 index 0000000000..5d1056c2fc --- /dev/null +++ b/modules/mono/build_scripts/gen_cs_glue_version.py @@ -0,0 +1,20 @@ + +def generate_header(solution_dir, version_header_dst): + import os + latest_mtime = 0 + for root, dirs, files in os.walk(solution_dir, topdown=True): + dirs[:] = [d for d in dirs if d not in ['Generated']] # Ignored generated files + files = [f for f in files if f.endswith('.cs')] + for file in files: + filepath = os.path.join(root, file) + mtime = os.path.getmtime(filepath) + latest_mtime = mtime if mtime > latest_mtime else latest_mtime + + glue_version = int(latest_mtime) # The latest modified time will do for now + + with open(version_header_dst, 'w') as version_header: + version_header.write('/* THIS FILE IS GENERATED DO NOT EDIT */\n') + version_header.write('#ifndef CS_GLUE_VERSION_H\n') + version_header.write('#define CS_GLUE_VERSION_H\n\n') + version_header.write('#define CS_GLUE_VERSION UINT32_C(' + str(glue_version) + ')\n') + version_header.write('\n#endif // CS_GLUE_VERSION_H\n') diff --git a/modules/mono/build_scripts/godot_tools_build.py b/modules/mono/build_scripts/godot_tools_build.py index 6e5273f5e0..99341c631e 100644 --- a/modules/mono/build_scripts/godot_tools_build.py +++ b/modules/mono/build_scripts/godot_tools_build.py @@ -13,65 +13,13 @@ def build_godot_tools(source, target, env): solution_path = os.path.join(module_dir, 'editor/GodotTools/GodotTools.sln') build_config = 'Debug' if env['target'] == 'debug' else 'Release' - from . solution_builder import build_solution, nuget_restore - nuget_restore(env, solution_path) - build_solution(env, solution_path, build_config) - - # Copy targets - - solution_dir = os.path.abspath(os.path.join(solution_path, os.pardir)) - - src_dir = os.path.join(solution_dir, 'GodotTools', 'bin', build_config) - dst_dir = os.path.abspath(os.path.join(str(target[0]), os.pardir)) - - if not os.path.isdir(dst_dir): - assert not os.path.isfile(dst_dir) - os.makedirs(dst_dir) - - def copy_target(target_path): - from shutil import copy - filename = os.path.basename(target_path) - copy(os.path.join(src_dir, filename), target_path) - - for scons_target in target: - copy_target(str(scons_target)) - - -def build_godot_tools_project_editor(source, target, env): - # source and target elements are of type SCons.Node.FS.File, hence why we convert them to str - - module_dir = env['module_dir'] - - project_name = 'GodotTools.ProjectEditor' - - csproj_dir = os.path.join(module_dir, 'editor/GodotTools', project_name) - csproj_path = os.path.join(csproj_dir, project_name + '.csproj') - build_config = 'Debug' if env['target'] == 'debug' else 'Release' + # Custom build target to make sure output is always copied to the data dir. + extra_build_args = ['/Target:Build;GodotTools:BuildAlwaysCopyToDataDir'] from . solution_builder import build_solution, nuget_restore - - # Make sure to restore NuGet packages in the project directory for the project to find it - nuget_restore(env, os.path.join(csproj_dir, 'packages.config'), '-PackagesDirectory', - os.path.join(csproj_dir, 'packages')) - - build_solution(env, csproj_path, build_config) - - # Copy targets - - src_dir = os.path.join(csproj_dir, 'bin', build_config) - dst_dir = os.path.abspath(os.path.join(str(target[0]), os.pardir)) - - if not os.path.isdir(dst_dir): - assert not os.path.isfile(dst_dir) - os.makedirs(dst_dir) - - def copy_target(target_path): - from shutil import copy - filename = os.path.basename(target_path) - copy(os.path.join(src_dir, filename), target_path) - - for scons_target in target: - copy_target(str(scons_target)) + nuget_restore(env, solution_path) + build_solution(env, solution_path, build_config, extra_build_args) + # No need to copy targets. The GodotTools csproj takes care of copying them. def build(env_mono, api_sln_cmd): @@ -80,36 +28,12 @@ def build(env_mono, api_sln_cmd): output_dir = Dir('#bin').abspath editor_tools_dir = os.path.join(output_dir, 'GodotSharp', 'Tools') - target_filenames = [ - 'GodotTools.dll', 'GodotTools.IdeConnection.dll', 'GodotTools.BuildLogger.dll', - 'GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll', - 'JetBrains.Annotations.dll', 'Newtonsoft.Json.dll' - ] + target_filenames = ['GodotTools.dll'] if env_mono['target'] == 'debug': - target_filenames += [ - 'GodotTools.pdb', 'GodotTools.IdeConnection.pdb', 'GodotTools.BuildLogger.pdb', - 'GodotTools.ProjectEditor.pdb', 'GodotTools.Core.pdb' - ] + target_filenames += ['GodotTools.pdb'] targets = [os.path.join(editor_tools_dir, filename) for filename in target_filenames] cmd = env_mono.CommandNoCache(targets, api_sln_cmd, build_godot_tools, module_dir=os.getcwd()) env_mono.AlwaysBuild(cmd) - - -def build_project_editor_only(env_mono): - assert env_mono['tools'] - - output_dir = Dir('#bin').abspath - editor_tools_dir = os.path.join(output_dir, 'GodotSharp', 'Tools') - - target_filenames = ['GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll'] - - if env_mono['target'] == 'debug': - target_filenames += ['GodotTools.ProjectEditor.pdb', 'GodotTools.Core.pdb'] - - targets = [os.path.join(editor_tools_dir, filename) for filename in target_filenames] - - cmd = env_mono.CommandNoCache(targets, [], build_godot_tools_project_editor, module_dir=os.getcwd()) - env_mono.AlwaysBuild(cmd) diff --git a/modules/mono/build_scripts/make_cs_compressed_header.py b/modules/mono/build_scripts/make_cs_compressed_header.py deleted file mode 100644 index ed49db5bb2..0000000000 --- a/modules/mono/build_scripts/make_cs_compressed_header.py +++ /dev/null @@ -1,62 +0,0 @@ - -def generate_header(src, dst, version_dst): - from compat import byte_to_str - - with open(dst, 'w') as header: - header.write('/* THIS FILE IS GENERATED DO NOT EDIT */\n') - header.write('#ifndef CS_COMPRESSED_H\n') - header.write('#define CS_COMPRESSED_H\n\n') - header.write('#ifdef TOOLS_ENABLED\n\n') - header.write('#include "core/map.h"\n') - header.write('#include "core/ustring.h"\n') - inserted_files = '' - import os - latest_mtime = 0 - cs_file_count = 0 - for root, _, files in os.walk(src): - files = [f for f in files if f.endswith('.cs')] - for file in files: - cs_file_count += 1 - filepath = os.path.join(root, file) - filepath_src_rel = os.path.relpath(filepath, src) - mtime = os.path.getmtime(filepath) - latest_mtime = mtime if mtime > latest_mtime else latest_mtime - with open(filepath, 'rb') as f: - buf = f.read() - decompr_size = len(buf) - import zlib - buf = zlib.compress(buf) - compr_size = len(buf) - name = str(cs_file_count) - header.write('\n') - header.write('// ' + filepath_src_rel + '\n') - header.write('static const int _cs_' + name + '_compressed_size = ' + str(compr_size) + ';\n') - header.write('static const int _cs_' + name + '_uncompressed_size = ' + str(decompr_size) + ';\n') - header.write('static const unsigned char _cs_' + name + '_compressed[] = { ') - for i, buf_idx in enumerate(range(compr_size)): - if i > 0: - header.write(', ') - header.write(byte_to_str(buf[buf_idx])) - header.write(' };\n') - inserted_files += '\tr_files.insert("' + filepath_src_rel.replace('\\', '\\\\') + '", ' \ - 'GodotCsCompressedFile(_cs_' + name + '_compressed_size, ' \ - '_cs_' + name + '_uncompressed_size, ' \ - '_cs_' + name + '_compressed));\n' - header.write('\nstruct GodotCsCompressedFile\n' '{\n' - '\tint compressed_size;\n' '\tint uncompressed_size;\n' '\tconst unsigned char* data;\n' - '\n\tGodotCsCompressedFile(int p_comp_size, int p_uncomp_size, const unsigned char* p_data)\n' - '\t{\n' '\t\tcompressed_size = p_comp_size;\n' '\t\tuncompressed_size = p_uncomp_size;\n' - '\t\tdata = p_data;\n' '\t}\n' '\n\tGodotCsCompressedFile() {}\n' '};\n' - '\nvoid get_compressed_files(Map<String, GodotCsCompressedFile>& r_files)\n' '{\n' + inserted_files + '}\n' - ) - header.write('\n#endif // TOOLS_ENABLED\n') - header.write('\n#endif // CS_COMPRESSED_H\n') - - glue_version = int(latest_mtime) # The latest modified time will do for now - - with open(version_dst, 'w') as version_header: - version_header.write('/* THIS FILE IS GENERATED DO NOT EDIT */\n') - version_header.write('#ifndef CS_GLUE_VERSION_H\n') - version_header.write('#define CS_GLUE_VERSION_H\n\n') - version_header.write('#define CS_GLUE_VERSION UINT32_C(' + str(glue_version) + ')\n') - version_header.write('\n#endif // CS_GLUE_VERSION_H\n') diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 4536614379..f68c583278 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -42,6 +42,7 @@ #include "editor/bindings_generator.h" #include "editor/csharp_project.h" #include "editor/editor_node.h" +#include "editor/node_dock.h" #endif #ifdef DEBUG_METHODS_ENABLED diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ApiSolutionGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ApiSolutionGenerator.cs deleted file mode 100644 index bfae2afc13..0000000000 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ApiSolutionGenerator.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.Generic; -using System.IO; - -namespace GodotTools.ProjectEditor -{ - public static class ApiSolutionGenerator - { - public static void GenerateApiSolution(string solutionDir, - string coreProjDir, IEnumerable<string> coreCompileItems, - string editorProjDir, IEnumerable<string> editorCompileItems) - { - var solution = new DotNetSolution(ApiAssemblyNames.SolutionName); - - solution.DirectoryPath = solutionDir; - - // GodotSharp project - - const string coreApiAssemblyName = ApiAssemblyNames.Core; - - string coreGuid = ProjectGenerator.GenCoreApiProject(coreProjDir, coreCompileItems); - - var coreProjInfo = new DotNetSolution.ProjectInfo - { - Guid = coreGuid, - PathRelativeToSolution = Path.Combine(coreApiAssemblyName, $"{coreApiAssemblyName}.csproj") - }; - coreProjInfo.Configs.Add("Debug"); - coreProjInfo.Configs.Add("Release"); - - solution.AddNewProject(coreApiAssemblyName, coreProjInfo); - - // GodotSharpEditor project - - const string editorApiAssemblyName = ApiAssemblyNames.Editor; - - string editorGuid = ProjectGenerator.GenEditorApiProject(editorProjDir, - $"../{coreApiAssemblyName}/{coreApiAssemblyName}.csproj", editorCompileItems); - - var editorProjInfo = new DotNetSolution.ProjectInfo(); - editorProjInfo.Guid = editorGuid; - editorProjInfo.PathRelativeToSolution = Path.Combine(editorApiAssemblyName, $"{editorApiAssemblyName}.csproj"); - editorProjInfo.Configs.Add("Debug"); - editorProjInfo.Configs.Add("Release"); - - solution.AddNewProject(editorApiAssemblyName, editorProjInfo); - - // Save solution - - solution.Save(); - } - } -} diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj index ab3a5d1aea..ae727e8789 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj @@ -32,18 +32,11 @@ <Reference Include="System" /> <Reference Include="Microsoft.Build" /> <Reference Include="DotNet.Glob, Version=2.1.1.0, Culture=neutral, PublicKeyToken=b68cc888b4f632d1, processorArchitecture=MSIL"> - <!-- - When building Godot with 'mono_glue=no' SCons will build this project alone instead of the - entire solution. $(SolutionDir) is not defined in that case, so we need to workaround that. - We make SCons restore the NuGet packages in the project directory instead in this case. - --> - <HintPath Condition=" '$(SolutionDir)' != '' And Exists('$(SolutionDir)\packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll') ">$(SolutionDir)\packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll</HintPath> - <HintPath Condition=" '$(SolutionDir)' == '' Or !Exists('$(SolutionDir)\packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll') ">$(ProjectDir)\packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll</HintPath> + <HintPath>packages\DotNet.Glob.2.1.1\lib\net45\DotNet.Glob.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Compile Include="ApiAssembliesInfo.cs" /> - <Compile Include="ApiSolutionGenerator.cs" /> <Compile Include="DotNetSolution.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="IdentifierUtils.cs" /> diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs index b40d985d51..22a0074580 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs @@ -10,68 +10,13 @@ namespace GodotTools.ProjectEditor { private const string CoreApiProjectName = "GodotSharp"; private const string EditorApiProjectName = "GodotSharpEditor"; - private const string CoreApiProjectGuid = "{AEBF0036-DA76-4341-B651-A3F2856AB2FA}"; - private const string EditorApiProjectGuid = "{8FBEC238-D944-4074-8548-B3B524305905}"; - - public static string GenCoreApiProject(string dir, IEnumerable<string> compileItems) - { - string path = Path.Combine(dir, CoreApiProjectName + ".csproj"); - - ProjectPropertyGroupElement mainGroup; - var root = CreateLibraryProject(CoreApiProjectName, out mainGroup); - - mainGroup.AddProperty("DocumentationFile", Path.Combine("$(OutputPath)", "$(AssemblyName).xml")); - mainGroup.SetProperty("RootNamespace", "Godot"); - mainGroup.SetProperty("ProjectGuid", CoreApiProjectGuid); - mainGroup.SetProperty("BaseIntermediateOutputPath", "obj"); - - GenAssemblyInfoFile(root, dir, CoreApiProjectName, - new[] { "[assembly: InternalsVisibleTo(\"" + EditorApiProjectName + "\")]" }, - new[] { "System.Runtime.CompilerServices" }); - - foreach (var item in compileItems) - { - root.AddItem("Compile", item.RelativeToPath(dir).Replace("/", "\\")); - } - - root.Save(path); - - return CoreApiProjectGuid; - } - - public static string GenEditorApiProject(string dir, string coreApiProjPath, IEnumerable<string> compileItems) - { - string path = Path.Combine(dir, EditorApiProjectName + ".csproj"); - - ProjectPropertyGroupElement mainGroup; - var root = CreateLibraryProject(EditorApiProjectName, out mainGroup); - - mainGroup.AddProperty("DocumentationFile", Path.Combine("$(OutputPath)", "$(AssemblyName).xml")); - mainGroup.SetProperty("RootNamespace", "Godot"); - mainGroup.SetProperty("ProjectGuid", EditorApiProjectGuid); - mainGroup.SetProperty("BaseIntermediateOutputPath", "obj"); - - GenAssemblyInfoFile(root, dir, EditorApiProjectName); - - foreach (var item in compileItems) - { - root.AddItem("Compile", item.RelativeToPath(dir).Replace("/", "\\")); - } - - var coreApiRef = root.AddItem("ProjectReference", coreApiProjPath.Replace("/", "\\")); - coreApiRef.AddMetadata("Private", "False"); - - root.Save(path); - - return EditorApiProjectGuid; - } public static string GenGameProject(string dir, string name, IEnumerable<string> compileItems) { string path = Path.Combine(dir, name + ".csproj"); ProjectPropertyGroupElement mainGroup; - var root = CreateLibraryProject(name, out mainGroup); + var root = CreateLibraryProject(name, "Tools", out mainGroup); mainGroup.SetProperty("OutputPath", Path.Combine(".mono", "temp", "bin", "$(Configuration)")); mainGroup.SetProperty("BaseIntermediateOutputPath", Path.Combine(".mono", "temp", "obj")); @@ -110,7 +55,7 @@ namespace GodotTools.ProjectEditor return root.GetGuid().ToString().ToUpper(); } - public static void GenAssemblyInfoFile(ProjectRootElement root, string dir, string name, string[] assemblyLines = null, string[] usingDirectives = null) + private static void GenAssemblyInfoFile(ProjectRootElement root, string dir, string name, string[] assemblyLines = null, string[] usingDirectives = null) { string propertiesDir = Path.Combine(dir, "Properties"); if (!Directory.Exists(propertiesDir)) @@ -138,7 +83,7 @@ namespace GodotTools.ProjectEditor root.AddItem("Compile", assemblyInfoFile.RelativeToPath(dir).Replace("/", "\\")); } - public static ProjectRootElement CreateLibraryProject(string name, out ProjectPropertyGroupElement mainGroup) + public static ProjectRootElement CreateLibraryProject(string name, string defaultConfig, out ProjectPropertyGroupElement mainGroup) { if (string.IsNullOrEmpty(name)) throw new ArgumentException($"{nameof(name)} cannot be empty", nameof(name)); @@ -147,7 +92,7 @@ namespace GodotTools.ProjectEditor root.DefaultTargets = "Build"; mainGroup = root.AddPropertyGroup(); - mainGroup.AddProperty("Configuration", "Debug").Condition = " '$(Configuration)' == '' "; + mainGroup.AddProperty("Configuration", defaultConfig).Condition = " '$(Configuration)' == '' "; mainGroup.AddProperty("Platform", "AnyCPU").Condition = " '$(Platform)' == '' "; mainGroup.AddProperty("ProjectGuid", "{" + Guid.NewGuid().ToString().ToUpper() + "}"); mainGroup.AddProperty("OutputType", "Library"); @@ -184,16 +129,6 @@ namespace GodotTools.ProjectEditor return root; } - private static void AddItems(ProjectRootElement elem, string groupName, params string[] items) - { - var group = elem.AddItemGroup(); - - foreach (var item in items) - { - group.AddItem(groupName, item); - } - } - private const string AssemblyInfoTemplate = @"using System.Reflection;{0} diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj index 15b9e50a8d..618527f916 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj +++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj @@ -9,6 +9,7 @@ <AssemblyName>GodotTools</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <GodotSourceRootPath>$(SolutionDir)/../../../../</GodotSourceRootPath> + <DataDirToolsOutputPath>$(GodotSourceRootPath)/bin/GodotSharp/Tools</DataDirToolsOutputPath> <GodotApiConfiguration>Debug</GodotApiConfiguration> <LangVersion>7</LangVersion> </PropertyGroup> @@ -41,9 +42,11 @@ <Reference Include="System" /> <Reference Include="GodotSharp"> <HintPath>$(GodotSourceRootPath)/bin/GodotSharp/Api/$(GodotApiConfiguration)/GodotSharp.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="GodotSharpEditor"> <HintPath>$(GodotSourceRootPath)/bin/GodotSharp/Api/$(GodotApiConfiguration)/GodotSharpEditor.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> @@ -56,7 +59,6 @@ <Compile Include="Ides\MonoDevelop\Instance.cs" /> <Compile Include="Ides\Rider\RiderPathLocator.cs" /> <Compile Include="Ides\Rider\RiderPathManager.cs" /> - <Compile Include="Internals\BindingsGenerator.cs" /> <Compile Include="Internals\EditorProgress.cs" /> <Compile Include="Internals\GodotSharpDirs.cs" /> <Compile Include="Internals\Internal.cs" /> @@ -99,5 +101,21 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> + <Target Name="CopyToDataDir" AfterTargets="Build"> + <ItemGroup> + <GodotToolsCopy Include="$(OutputPath)\GodotTools*.dll" /> + <GodotToolsCopy Include="$(OutputPath)\Newtonsoft.Json.dll" /> + <GodotToolsCopy Include="$(OutputPath)\DotNet.Glob.dll" /> + </ItemGroup> + <ItemGroup Condition=" '$(Configuration)' == 'Debug' "> + <GodotToolsCopy Include="$(OutputPath)\GodotTools*.pdb" /> + </ItemGroup> + <Copy SourceFiles="@(GodotToolsCopy)" DestinationFolder="$(DataDirToolsOutputPath)" ContinueOnError="false" /> + </Target> + <Target Name="BuildAlwaysCopyToDataDir"> + <!-- Custom target run by SCons to make sure the CopyToDataDir target is always executed, without having to use DisableFastUpToDateCheck --> + <CallTarget Targets="Build" /> + <CallTarget Targets="CopyToDataDir" /> + </Target> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file +</Project> diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/BindingsGenerator.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/BindingsGenerator.cs deleted file mode 100644 index 1daa5e138e..0000000000 --- a/modules/mono/editor/GodotTools/GodotTools/Internals/BindingsGenerator.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace GodotTools.Internals -{ - public class BindingsGenerator : IDisposable - { - class BindingsGeneratorSafeHandle : SafeHandle - { - public BindingsGeneratorSafeHandle(IntPtr handle) : base(IntPtr.Zero, true) - { - this.handle = handle; - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - internal_Dtor(handle); - return true; - } - } - - private BindingsGeneratorSafeHandle safeHandle; - private bool disposed = false; - - public bool LogPrintEnabled - { - get => internal_LogPrintEnabled(GetPtr()); - set => internal_SetLogPrintEnabled(GetPtr(), value); - } - - public static uint Version => internal_Version(); - public static uint CsGlueVersion => internal_CsGlueVersion(); - - public Godot.Error GenerateCsApi(string outputDir) => internal_GenerateCsApi(GetPtr(), outputDir); - - internal IntPtr GetPtr() - { - if (disposed) - throw new ObjectDisposedException(GetType().FullName); - - return safeHandle.DangerousGetHandle(); - } - - public void Dispose() - { - if (disposed) - return; - - if (safeHandle != null && !safeHandle.IsInvalid) - { - safeHandle.Dispose(); - safeHandle = null; - } - - disposed = true; - } - - public BindingsGenerator() - { - safeHandle = new BindingsGeneratorSafeHandle(internal_Ctor()); - } - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern IntPtr internal_Ctor(); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void internal_Dtor(IntPtr handle); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool internal_LogPrintEnabled(IntPtr handle); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void internal_SetLogPrintEnabled(IntPtr handle, bool enabled); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern Godot.Error internal_GenerateCsApi(IntPtr handle, string outputDir); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern uint internal_Version(); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern uint internal_CsGlueVersion(); - } -} diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 2252f7676d..5b135e97e9 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -40,7 +40,6 @@ #include "core/os/os.h" #include "core/ucaps.h" -#include "../glue/cs_compressed.gen.h" #include "../glue/cs_glue_version.gen.h" #include "../godotsharp_defs.h" #include "../mono_gd/gd_mono_marshal.h" @@ -874,7 +873,7 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { p_output.append("\n#pragma warning restore CS1591\n"); } -Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vector<String> &r_compile_items) { +Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { ERR_FAIL_COND_V(!initialized, ERR_UNCONFIGURED); @@ -887,22 +886,24 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect } da->change_dir(p_proj_dir); - da->make_dir("Core"); - da->make_dir("ObjectType"); + da->make_dir("Generated"); + da->make_dir("Generated/GodotObjects"); - String core_dir = path::join(p_proj_dir, "Core"); - String obj_type_dir = path::join(p_proj_dir, "ObjectType"); + String base_gen_dir = path::join(p_proj_dir, "Generated"); + String godot_objects_gen_dir = path::join(base_gen_dir, "GodotObjects"); + + Vector<String> compile_items; // Generate source file for global scope constants and enums { StringBuilder constants_source; _generate_global_constants(constants_source); - String output_file = path::join(core_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_constants.cs"); + String output_file = path::join(base_gen_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_constants.cs"); Error save_err = _save_file(output_file, constants_source); if (save_err != OK) return save_err; - r_compile_items.push_back(output_file); + compile_items.push_back(output_file); } for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { @@ -911,7 +912,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect if (itype.api_type == ClassDB::API_EDITOR) continue; - String output_file = path::join(obj_type_dir, itype.proxy_name + ".cs"); + String output_file = path::join(godot_objects_gen_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); if (err == ERR_SKIP) @@ -920,39 +921,11 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect if (err != OK) return err; - r_compile_items.push_back(output_file); + compile_items.push_back(output_file); } // Generate sources from compressed files - Map<String, GodotCsCompressedFile> compressed_files; - get_compressed_files(compressed_files); - - for (Map<String, GodotCsCompressedFile>::Element *E = compressed_files.front(); E; E = E->next()) { - const String &file_name = E->key(); - const GodotCsCompressedFile &file_data = E->value(); - - String output_file = path::join(core_dir, file_name); - - Vector<uint8_t> data; - data.resize(file_data.uncompressed_size); - Compression::decompress(data.ptrw(), file_data.uncompressed_size, file_data.data, file_data.compressed_size, Compression::MODE_DEFLATE); - - String output_dir = output_file.get_base_dir(); - - if (!DirAccess::exists(output_dir)) { - Error err = da->make_dir_recursive(ProjectSettings::get_singleton()->globalize_path(output_dir)); - ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); - } - - FileAccessRef file = FileAccess::open(output_file, FileAccess::WRITE); - ERR_FAIL_COND_V(!file, ERR_FILE_CANT_WRITE); - file->store_buffer(data.ptr(), data.size()); - file->close(); - - r_compile_items.push_back(output_file); - } - StringBuilder cs_icalls_content; cs_icalls_content.append("using System;\n" @@ -986,18 +959,36 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect cs_icalls_content.append(INDENT1 CLOSE_BLOCK CLOSE_BLOCK); - String internal_methods_file = path::join(core_dir, BINDINGS_CLASS_NATIVECALLS ".cs"); + String internal_methods_file = path::join(base_gen_dir, BINDINGS_CLASS_NATIVECALLS ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); if (err != OK) return err; - r_compile_items.push_back(internal_methods_file); + compile_items.push_back(internal_methods_file); + + StringBuilder includes_props_content; + includes_props_content.append("<Project>\n" + " <ItemGroup>\n"); + + for (int i = 0; i < compile_items.size(); i++) { + String include = path::relative_to(compile_items[i], p_proj_dir).replace("/", "\\"); + includes_props_content.append(" <Compile Include=\"" + include + "\" />\n"); + } + + includes_props_content.append(" </ItemGroup>\n" + "</Project>\n"); + + String includes_props_file = path::join(base_gen_dir, "GeneratedIncludes.props"); + + err = _save_file(includes_props_file, includes_props_content); + if (err != OK) + return err; return OK; } -Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Vector<String> &r_compile_items) { +Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir) { ERR_FAIL_COND_V(!initialized, ERR_UNCONFIGURED); @@ -1010,11 +1001,13 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve } da->change_dir(p_proj_dir); - da->make_dir("Core"); - da->make_dir("ObjectType"); + da->make_dir("Generated"); + da->make_dir("Generated/GodotObjects"); + + String base_gen_dir = path::join(p_proj_dir, "Generated"); + String godot_objects_gen_dir = path::join(base_gen_dir, "GodotObjects"); - String core_dir = path::join(p_proj_dir, "Core"); - String obj_type_dir = path::join(p_proj_dir, "ObjectType"); + Vector<String> compile_items; for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { const TypeInterface &itype = E.get(); @@ -1022,7 +1015,7 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve if (itype.api_type != ClassDB::API_EDITOR) continue; - String output_file = path::join(obj_type_dir, itype.proxy_name + ".cs"); + String output_file = path::join(godot_objects_gen_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); if (err == ERR_SKIP) @@ -1031,7 +1024,7 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve if (err != OK) return err; - r_compile_items.push_back(output_file); + compile_items.push_back(output_file); } StringBuilder cs_icalls_content; @@ -1068,13 +1061,31 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve cs_icalls_content.append(INDENT1 CLOSE_BLOCK CLOSE_BLOCK); - String internal_methods_file = path::join(core_dir, BINDINGS_CLASS_NATIVECALLS_EDITOR ".cs"); + String internal_methods_file = path::join(base_gen_dir, BINDINGS_CLASS_NATIVECALLS_EDITOR ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); if (err != OK) return err; - r_compile_items.push_back(internal_methods_file); + compile_items.push_back(internal_methods_file); + + StringBuilder includes_props_content; + includes_props_content.append("<Project>\n" + " <ItemGroup>\n"); + + for (int i = 0; i < compile_items.size(); i++) { + String include = path::relative_to(compile_items[i], p_proj_dir).replace("/", "\\"); + includes_props_content.append(" <Compile Include=\"" + include + "\" />\n"); + } + + includes_props_content.append(" </ItemGroup>\n" + "</Project>\n"); + + String includes_props_file = path::join(base_gen_dir, "GeneratedIncludes.props"); + + err = _save_file(includes_props_file, includes_props_content); + if (err != OK) + return err; return OK; } @@ -1098,9 +1109,8 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { // Generate GodotSharp source files String core_proj_dir = output_dir.plus_file(CORE_API_ASSEMBLY_NAME); - Vector<String> core_compile_items; - proj_err = generate_cs_core_project(core_proj_dir, core_compile_items); + proj_err = generate_cs_core_project(core_proj_dir); if (proj_err != OK) { ERR_PRINT("Generation of the Core API C# project failed."); return proj_err; @@ -1109,22 +1119,14 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { // Generate GodotSharpEditor source files String editor_proj_dir = output_dir.plus_file(EDITOR_API_ASSEMBLY_NAME); - Vector<String> editor_compile_items; - proj_err = generate_cs_editor_project(editor_proj_dir, editor_compile_items); + proj_err = generate_cs_editor_project(editor_proj_dir); if (proj_err != OK) { ERR_PRINT("Generation of the Editor API C# project failed."); return proj_err; } - // Generate solution - - if (!CSharpProject::generate_api_solution(output_dir, - core_proj_dir, core_compile_items, editor_proj_dir, editor_compile_items)) { - return ERR_CANT_CREATE; - } - - _log("The solution for the Godot API was generated successfully\n"); + _log("The Godot API sources were successfully generated\n"); return OK; } @@ -3170,7 +3172,7 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) if (bindings_generator.generate_glue(glue_dir_path) != OK) ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C++ glue."); - if (bindings_generator.generate_cs_api(glue_dir_path.plus_file("Managed/Generated")) != OK) + if (bindings_generator.generate_cs_api(glue_dir_path.plus_file(API_SOLUTION_NAME)) != OK) ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C# API."); } diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 07918a2d03..7323e8f635 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -635,8 +635,8 @@ class BindingsGenerator { void _initialize(); public: - Error generate_cs_core_project(const String &p_proj_dir, Vector<String> &r_compile_files); - Error generate_cs_editor_project(const String &p_proj_dir, Vector<String> &r_compile_items); + Error generate_cs_core_project(const String &p_proj_dir); + Error generate_cs_editor_project(const String &p_proj_dir); Error generate_cs_api(const String &p_output_dir); Error generate_glue(const String &p_output_dir); diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index 748447005f..ef3644acfd 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -44,54 +44,6 @@ namespace CSharpProject { -bool generate_api_solution_impl(const String &p_solution_dir, const String &p_core_proj_dir, const Vector<String> &p_core_compile_items, - const String &p_editor_proj_dir, const Vector<String> &p_editor_compile_items, - GDMonoAssembly *p_tools_project_editor_assembly) { - - GDMonoClass *klass = p_tools_project_editor_assembly->get_class("GodotTools.ProjectEditor", "ApiSolutionGenerator"); - - Variant solution_dir = p_solution_dir; - Variant core_proj_dir = p_core_proj_dir; - Variant core_compile_items = p_core_compile_items; - Variant editor_proj_dir = p_editor_proj_dir; - Variant editor_compile_items = p_editor_compile_items; - const Variant *args[5] = { &solution_dir, &core_proj_dir, &core_compile_items, &editor_proj_dir, &editor_compile_items }; - MonoException *exc = NULL; - klass->get_method("GenerateApiSolution", 5)->invoke(NULL, args, &exc); - - if (exc) { - GDMonoUtils::debug_print_unhandled_exception(exc); - ERR_FAIL_V(false); - } - - return true; -} - -bool generate_api_solution(const String &p_solution_dir, const String &p_core_proj_dir, const Vector<String> &p_core_compile_items, - const String &p_editor_proj_dir, const Vector<String> &p_editor_compile_items) { - - if (GDMono::get_singleton()->get_tools_project_editor_assembly()) { - return generate_api_solution_impl(p_solution_dir, p_core_proj_dir, p_core_compile_items, - p_editor_proj_dir, p_editor_compile_items, - GDMono::get_singleton()->get_tools_project_editor_assembly()); - } else { - MonoDomain *temp_domain = GDMonoUtils::create_domain("GodotEngine.Domain.ApiSolutionGeneration"); - CRASH_COND(temp_domain == NULL); - _GDMONO_SCOPE_EXIT_DOMAIN_UNLOAD_(temp_domain); - - _GDMONO_SCOPE_DOMAIN_(temp_domain); - - GDMonoAssembly *tools_project_editor_asm = NULL; - - bool assembly_loaded = GDMono::get_singleton()->load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_asm); - ERR_FAIL_COND_V_MSG(!assembly_loaded, false, "Failed to load assembly: '" TOOLS_PROJECT_EDITOR_ASM_NAME "'."); - - return generate_api_solution_impl(p_solution_dir, p_core_proj_dir, p_core_compile_items, - p_editor_proj_dir, p_editor_compile_items, - tools_project_editor_asm); - } -} - void add_item(const String &p_project_path, const String &p_item_type, const String &p_include) { if (!GLOBAL_DEF("mono/project/auto_update_project", true)) diff --git a/modules/mono/editor/csharp_project.h b/modules/mono/editor/csharp_project.h index b42762cea2..cc1d68c3b5 100644 --- a/modules/mono/editor/csharp_project.h +++ b/modules/mono/editor/csharp_project.h @@ -35,9 +35,6 @@ namespace CSharpProject { -bool generate_api_solution(const String &p_solution_dir, const String &p_core_proj_dir, const Vector<String> &p_core_compile_items, - const String &p_editor_proj_dir, const Vector<String> &p_editor_compile_items); - void add_item(const String &p_project_path, const String &p_item_type, const String &p_include); } // namespace CSharpProject diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index 48a3259a90..be6aa35aa0 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -37,6 +37,7 @@ #include "core/os/os.h" #include "core/version.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/script_editor_debugger.h" #include "main/main.h" diff --git a/modules/mono/glue/GodotSharp/.gitignore b/modules/mono/glue/GodotSharp/.gitignore new file mode 100644 index 0000000000..aa9f614a9d --- /dev/null +++ b/modules/mono/glue/GodotSharp/.gitignore @@ -0,0 +1,3 @@ +# Generated Godot API sources directories +GodotSharp/Generated +GodotSharpEditor/Generated diff --git a/modules/mono/glue/GodotSharp/GodotSharp.sln b/modules/mono/glue/GodotSharp/GodotSharp.sln new file mode 100644 index 0000000000..a496e36da3 --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotSharp", "GodotSharp\GodotSharp.csproj", "{AEBF0036-DA76-4341-B651-A3F2856AB2FA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotSharpEditor", "GodotSharpEditor\GodotSharpEditor.csproj", "{8FBEC238-D944-4074-8548-B3B524305905}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Release|Any CPU.Build.0 = Release|Any CPU + {8FBEC238-D944-4074-8548-B3B524305905}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8FBEC238-D944-4074-8548-B3B524305905}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8FBEC238-D944-4074-8548-B3B524305905}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8FBEC238-D944-4074-8548-B3B524305905}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/modules/mono/glue/Managed/Files/AABB.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs index 6a4f785551..6a4f785551 100644 --- a/modules/mono/glue/Managed/Files/AABB.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs diff --git a/modules/mono/glue/Managed/Files/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs index aba1065498..aba1065498 100644 --- a/modules/mono/glue/Managed/Files/Array.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs diff --git a/modules/mono/glue/Managed/Files/Attributes/ExportAttribute.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ExportAttribute.cs index 6adf044886..6adf044886 100644 --- a/modules/mono/glue/Managed/Files/Attributes/ExportAttribute.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ExportAttribute.cs diff --git a/modules/mono/glue/Managed/Files/Attributes/GodotMethodAttribute.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/GodotMethodAttribute.cs index 55848769d5..55848769d5 100644 --- a/modules/mono/glue/Managed/Files/Attributes/GodotMethodAttribute.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/GodotMethodAttribute.cs diff --git a/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs index 1bf6d5199a..1bf6d5199a 100644 --- a/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs diff --git a/modules/mono/glue/Managed/Files/Attributes/SignalAttribute.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/SignalAttribute.cs index 3957387be9..3957387be9 100644 --- a/modules/mono/glue/Managed/Files/Attributes/SignalAttribute.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/SignalAttribute.cs diff --git a/modules/mono/glue/Managed/Files/Attributes/ToolAttribute.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ToolAttribute.cs index d0437409af..d0437409af 100644 --- a/modules/mono/glue/Managed/Files/Attributes/ToolAttribute.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ToolAttribute.cs diff --git a/modules/mono/glue/Managed/Files/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index c5e62b77c8..c5e62b77c8 100644 --- a/modules/mono/glue/Managed/Files/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs diff --git a/modules/mono/glue/Managed/Files/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs index df817e47e9..df817e47e9 100644 --- a/modules/mono/glue/Managed/Files/Color.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs diff --git a/modules/mono/glue/Managed/Files/Colors.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Colors.cs index f41f5e9fc8..f41f5e9fc8 100644 --- a/modules/mono/glue/Managed/Files/Colors.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Colors.cs diff --git a/modules/mono/glue/Managed/Files/DebuggingUtils.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/DebuggingUtils.cs index edfe3464ec..edfe3464ec 100644 --- a/modules/mono/glue/Managed/Files/DebuggingUtils.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/DebuggingUtils.cs diff --git a/modules/mono/glue/Managed/Files/Dictionary.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs index d72109de92..d72109de92 100644 --- a/modules/mono/glue/Managed/Files/Dictionary.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs diff --git a/modules/mono/glue/Managed/Files/Dispatcher.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dispatcher.cs index 072e0f20ff..072e0f20ff 100644 --- a/modules/mono/glue/Managed/Files/Dispatcher.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dispatcher.cs diff --git a/modules/mono/glue/Managed/Files/DynamicObject.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/DynamicObject.cs index a0f105d55e..a0f105d55e 100644 --- a/modules/mono/glue/Managed/Files/DynamicObject.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/DynamicObject.cs diff --git a/modules/mono/glue/Managed/Files/Extensions/NodeExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs index 5023725f17..5023725f17 100644 --- a/modules/mono/glue/Managed/Files/Extensions/NodeExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs diff --git a/modules/mono/glue/Managed/Files/Extensions/ObjectExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ObjectExtensions.cs index 9ef0959750..9ef0959750 100644 --- a/modules/mono/glue/Managed/Files/Extensions/ObjectExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ObjectExtensions.cs diff --git a/modules/mono/glue/Managed/Files/Extensions/ResourceLoaderExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs index 684d160b57..684d160b57 100644 --- a/modules/mono/glue/Managed/Files/Extensions/ResourceLoaderExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs diff --git a/modules/mono/glue/Managed/Files/GD.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs index 19962d418a..19962d418a 100644 --- a/modules/mono/glue/Managed/Files/GD.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs diff --git a/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotSynchronizationContext.cs index 4b5e3f8761..4b5e3f8761 100644 --- a/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotSynchronizationContext.cs diff --git a/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotTaskScheduler.cs index 8eaeea50dc..8eaeea50dc 100644 --- a/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotTaskScheduler.cs diff --git a/modules/mono/glue/Managed/Files/GodotTraceListener.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotTraceListener.cs index f1a00ae0fa..f1a00ae0fa 100644 --- a/modules/mono/glue/Managed/Files/GodotTraceListener.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotTraceListener.cs diff --git a/modules/mono/glue/Managed/Files/Interfaces/IAwaitable.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaitable.cs index 0397957d00..0397957d00 100644 --- a/modules/mono/glue/Managed/Files/Interfaces/IAwaitable.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaitable.cs diff --git a/modules/mono/glue/Managed/Files/Interfaces/IAwaiter.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaiter.cs index d3be9d781c..d3be9d781c 100644 --- a/modules/mono/glue/Managed/Files/Interfaces/IAwaiter.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaiter.cs diff --git a/modules/mono/glue/Managed/Files/Interfaces/ISerializationListener.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/ISerializationListener.cs index c3fa2f3e82..c3fa2f3e82 100644 --- a/modules/mono/glue/Managed/Files/Interfaces/ISerializationListener.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/ISerializationListener.cs diff --git a/modules/mono/glue/Managed/Files/MarshalUtils.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/MarshalUtils.cs index a1d63a62ef..a1d63a62ef 100644 --- a/modules/mono/glue/Managed/Files/MarshalUtils.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/MarshalUtils.cs diff --git a/modules/mono/glue/Managed/Files/Mathf.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs index 54821fe790..54821fe790 100644 --- a/modules/mono/glue/Managed/Files/Mathf.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs diff --git a/modules/mono/glue/Managed/Files/MathfEx.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/MathfEx.cs index 1b7fd4906f..1b7fd4906f 100644 --- a/modules/mono/glue/Managed/Files/MathfEx.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/MathfEx.cs diff --git a/modules/mono/glue/Managed/Files/NodePath.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/NodePath.cs index 8c5872ba5a..8c5872ba5a 100644 --- a/modules/mono/glue/Managed/Files/NodePath.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/NodePath.cs diff --git a/modules/mono/glue/Managed/Files/Object.base.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.base.cs index de80f7fddc..de80f7fddc 100644 --- a/modules/mono/glue/Managed/Files/Object.base.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.base.cs diff --git a/modules/mono/glue/Managed/Files/Plane.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs index 885845e3a4..885845e3a4 100644 --- a/modules/mono/glue/Managed/Files/Plane.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs diff --git a/modules/mono/glue/Managed/Files/Quat.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs index 8f60867ac3..8f60867ac3 100644 --- a/modules/mono/glue/Managed/Files/Quat.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs diff --git a/modules/mono/glue/Managed/Files/RID.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/RID.cs index 94761531b1..94761531b1 100644 --- a/modules/mono/glue/Managed/Files/RID.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/RID.cs diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index 91e614dc7b..91e614dc7b 100644 --- a/modules/mono/glue/Managed/Files/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs diff --git a/modules/mono/glue/Managed/Files/SignalAwaiter.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/SignalAwaiter.cs index 9483b6ffb4..9483b6ffb4 100644 --- a/modules/mono/glue/Managed/Files/SignalAwaiter.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/SignalAwaiter.cs diff --git a/modules/mono/glue/Managed/Files/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs index b926037e5a..b926037e5a 100644 --- a/modules/mono/glue/Managed/Files/StringExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs diff --git a/modules/mono/glue/Managed/Files/Transform.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs index 0b84050f07..0b84050f07 100644 --- a/modules/mono/glue/Managed/Files/Transform.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs diff --git a/modules/mono/glue/Managed/Files/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs index 77ea3e5830..77ea3e5830 100644 --- a/modules/mono/glue/Managed/Files/Transform2D.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs diff --git a/modules/mono/glue/Managed/Files/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index f92453f546..f92453f546 100644 --- a/modules/mono/glue/Managed/Files/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs diff --git a/modules/mono/glue/Managed/Files/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 025b09199f..025b09199f 100644 --- a/modules/mono/glue/Managed/Files/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs diff --git a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj new file mode 100644 index 0000000000..5419cd06e6 --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{AEBF0036-DA76-4341-B651-A3F2856AB2FA}</ProjectGuid> + <OutputType>Library</OutputType> + <OutputPath>bin/$(Configuration)</OutputPath> + <RootNamespace>Godot</RootNamespace> + <AssemblyName>GodotSharp</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <DocumentationFile>$(OutputPath)/$(AssemblyName).xml</DocumentationFile> + <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>portable</DebugType> + <Optimize>false</Optimize> + <DefineConstants>$(GodotDefineConstants);GODOT;DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>portable</DebugType> + <Optimize>true</Optimize> + <DefineConstants>$(GodotDefineConstants);GODOT;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Core\AABB.cs" /> + <Compile Include="Core\Array.cs" /> + <Compile Include="Core\Attributes\ExportAttribute.cs" /> + <Compile Include="Core\Attributes\GodotMethodAttribute.cs" /> + <Compile Include="Core\Attributes\RPCAttributes.cs" /> + <Compile Include="Core\Attributes\SignalAttribute.cs" /> + <Compile Include="Core\Attributes\ToolAttribute.cs" /> + <Compile Include="Core\Basis.cs" /> + <Compile Include="Core\Color.cs" /> + <Compile Include="Core\Colors.cs" /> + <Compile Include="Core\DebuggingUtils.cs" /> + <Compile Include="Core\Dictionary.cs" /> + <Compile Include="Core\Dispatcher.cs" /> + <Compile Include="Core\DynamicObject.cs" /> + <Compile Include="Core\Extensions\NodeExtensions.cs" /> + <Compile Include="Core\Extensions\ObjectExtensions.cs" /> + <Compile Include="Core\Extensions\ResourceLoaderExtensions.cs" /> + <Compile Include="Core\GD.cs" /> + <Compile Include="Core\GodotSynchronizationContext.cs" /> + <Compile Include="Core\GodotTaskScheduler.cs" /> + <Compile Include="Core\GodotTraceListener.cs" /> + <Compile Include="Core\Interfaces\IAwaitable.cs" /> + <Compile Include="Core\Interfaces\IAwaiter.cs" /> + <Compile Include="Core\Interfaces\ISerializationListener.cs" /> + <Compile Include="Core\MarshalUtils.cs" /> + <Compile Include="Core\Mathf.cs" /> + <Compile Include="Core\MathfEx.cs" /> + <Compile Include="Core\NodePath.cs" /> + <Compile Include="Core\Object.base.cs" /> + <Compile Include="Core\Plane.cs" /> + <Compile Include="Core\Quat.cs" /> + <Compile Include="Core\Rect2.cs" /> + <Compile Include="Core\RID.cs" /> + <Compile Include="Core\SignalAwaiter.cs" /> + <Compile Include="Core\StringExtensions.cs" /> + <Compile Include="Core\Transform.cs" /> + <Compile Include="Core\Transform2D.cs" /> + <Compile Include="Core\Vector2.cs" /> + <Compile Include="Core\Vector3.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <!-- + We import a props file with auto-generated includes. This works well with Rider. + However, Visual Studio and MonoDevelop won't list them in the solution explorer. + We can't use wildcards as there may be undesired old files still hanging around. + Fortunately code completion, go to definition and such still work. + --> + <Import Project="Generated\GeneratedIncludes.props" /> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> +</Project> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Properties/AssemblyInfo.cs b/modules/mono/glue/GodotSharp/GodotSharp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..f84e0183f6 --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("GodotSharp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] +[assembly: InternalsVisibleTo("GodotSharpEditor")] diff --git a/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj b/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj new file mode 100644 index 0000000000..22853797c1 --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{8FBEC238-D944-4074-8548-B3B524305905}</ProjectGuid> + <OutputType>Library</OutputType> + <OutputPath>bin/$(Configuration)</OutputPath> + <RootNamespace>Godot</RootNamespace> + <AssemblyName>GodotSharpEditor</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <DocumentationFile>$(OutputPath)/$(AssemblyName).xml</DocumentationFile> + <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>portable</DebugType> + <Optimize>false</Optimize> + <DefineConstants>$(GodotDefineConstants);GODOT;DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>portable</DebugType> + <Optimize>true</Optimize> + <DefineConstants>$(GodotDefineConstants);GODOT;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="Generated\GeneratedIncludes.props" /> + <ItemGroup> + <ProjectReference Include="..\GodotSharp\GodotSharp.csproj"> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> +</Project> diff --git a/modules/mono/glue/Managed/Properties/AssemblyInfo.cs b/modules/mono/glue/GodotSharp/GodotSharpEditor/Properties/AssemblyInfo.cs index 77b3774e81..3684b7a3cb 100644 --- a/modules/mono/glue/Managed/Properties/AssemblyInfo.cs +++ b/modules/mono/glue/GodotSharp/GodotSharpEditor/Properties/AssemblyInfo.cs @@ -1,10 +1,9 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. -[assembly: AssemblyTitle("Managed")] +[assembly: AssemblyTitle("GodotSharpEditor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] diff --git a/modules/mono/glue/Managed/.gitignore b/modules/mono/glue/Managed/.gitignore deleted file mode 100644 index 146421cac8..0000000000 --- a/modules/mono/glue/Managed/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Generated Godot API solution folder -Generated diff --git a/modules/mono/glue/Managed/IgnoredFiles/Enums.cs b/modules/mono/glue/Managed/IgnoredFiles/Enums.cs deleted file mode 100644 index 05f1abcf93..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/Enums.cs +++ /dev/null @@ -1,21 +0,0 @@ - -namespace Godot -{ - public enum Margin - { - Left = 0, - Top = 1, - Right = 2, - Bottom = 3 - } - - public enum Error - { - Ok = 0 - } - - public enum PropertyHint - { - None = 0 - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/FuncRef.cs b/modules/mono/glue/Managed/IgnoredFiles/FuncRef.cs deleted file mode 100644 index 83504fe49f..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/FuncRef.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace Godot -{ - public partial class FuncRef - { - public void SetInstance(Object instance) - { - throw new NotImplementedException(); - } - - public void SetFunction(string name) - { - throw new NotImplementedException(); - } - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/Node.cs b/modules/mono/glue/Managed/IgnoredFiles/Node.cs deleted file mode 100644 index cff61b1e0b..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/Node.cs +++ /dev/null @@ -1,29 +0,0 @@ - -using System; - -namespace Godot -{ - public partial class Node - { - public Node GetChild(int idx) - { - throw new NotImplementedException(); - } - - public Node GetNode(NodePath path) - { - throw new NotImplementedException(); - } - - public Node Owner - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } - - public Node GetParent() - { - throw new NotImplementedException(); - } - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/Resource.cs b/modules/mono/glue/Managed/IgnoredFiles/Resource.cs deleted file mode 100644 index cc0a5555b1..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/Resource.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Godot -{ - public partial class Resource - { - - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/ResourceLoader.cs b/modules/mono/glue/Managed/IgnoredFiles/ResourceLoader.cs deleted file mode 100644 index 6461d35146..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/ResourceLoader.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Godot -{ - public partial class ResourceLoader - { - public static Resource Load(string path, string typeHint = "", bool pNoCache = false) - { - throw new NotImplementedException(); - } - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/Variant.cs b/modules/mono/glue/Managed/IgnoredFiles/Variant.cs deleted file mode 100644 index 802140b062..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/Variant.cs +++ /dev/null @@ -1,11 +0,0 @@ - -namespace Godot -{ - public static class Variant - { - public enum Type - { - - } - } -} diff --git a/modules/mono/glue/Managed/IgnoredFiles/WeakRef.cs b/modules/mono/glue/Managed/IgnoredFiles/WeakRef.cs deleted file mode 100644 index 1498b7836b..0000000000 --- a/modules/mono/glue/Managed/IgnoredFiles/WeakRef.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Godot -{ - public partial class WeakRef - { - - } -} diff --git a/modules/mono/glue/Managed/Managed.csproj b/modules/mono/glue/Managed/Managed.csproj deleted file mode 100644 index 8bde3b6d22..0000000000 --- a/modules/mono/glue/Managed/Managed.csproj +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">x86</Platform> - <ProjectGuid>{DAA3DEF8-5112-407C-A5E5-6C608CF5F955}</ProjectGuid> - <OutputType>Library</OutputType> - <RootNamespace>Managed</RootNamespace> - <AssemblyName>Managed</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <LangVersion>7</LangVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>portable</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug</OutputPath> - <DefineConstants>DEBUG;</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <ExternalConsole>true</ExternalConsole> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <Optimize>true</Optimize> - <OutputPath>bin\Release</OutputPath> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <ExternalConsole>true</ExternalConsole> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Files\**\*.cs" /> - <Compile Include="IgnoredFiles\**\*.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file diff --git a/modules/mono/glue/Managed/Managed.sln b/modules/mono/glue/Managed/Managed.sln deleted file mode 100644 index 61ddde0fb7..0000000000 --- a/modules/mono/glue/Managed/Managed.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Managed", "Managed.csproj", "{DAA3DEF8-5112-407C-A5E5-6C608CF5F955}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DAA3DEF8-5112-407C-A5E5-6C608CF5F955}.Debug|x86.ActiveCfg = Debug|x86 - {DAA3DEF8-5112-407C-A5E5-6C608CF5F955}.Debug|x86.Build.0 = Debug|x86 - {DAA3DEF8-5112-407C-A5E5-6C608CF5F955}.Release|x86.ActiveCfg = Release|x86 - {DAA3DEF8-5112-407C-A5E5-6C608CF5F955}.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal diff --git a/modules/mono/glue/Managed/README.md b/modules/mono/glue/Managed/README.md deleted file mode 100644 index 65e63cae37..0000000000 --- a/modules/mono/glue/Managed/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The directory `Files` contains C# files from the core assembly project that are not part of the generated API. Any file with the `.cs` extension in this directory will be added to the core assembly project. - -A dummy solution and project is provided to get tooling help while editing these files, like code completion and name refactoring. - -The directory `IgnoredFiles` contains C# files that are needed to build the dummy project but must not be added to the core assembly project. They contain placeholders for the declarations that are part of the generated API. diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index 20863b1afe..a7bbc75e29 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -170,4 +170,41 @@ String join(const String &p_a, const String &p_b, const String &p_c, const Strin return path::join(path::join(path::join(p_a, p_b), p_c), p_d); } +String relative_to_impl(const String &p_path, const String &p_relative_to) { + // This function assumes arguments are normalized and absolute paths + + if (p_path.begins_with(p_relative_to)) { + return p_path.substr(p_relative_to.length() + 1); + } else { + String base_dir = p_relative_to.get_base_dir(); + + if (base_dir.length() <= 2 && (base_dir.empty() || base_dir.ends_with(":"))) + return p_path; + + return String("..").plus_file(relative_to_impl(p_path, base_dir)); + } +} + +#ifdef WINDOWS_ENABLED +String get_drive_letter(const String &p_norm_path) { + int idx = p_norm_path.find(":/"); + if (idx != -1 && idx < p_norm_path.find("/")) + return p_norm_path.substr(0, idx + 1); + return String(); +} +#endif + +String relative_to(const String &p_path, const String &p_relative_to) { + String relative_to_abs_norm = abspath(p_relative_to); + String path_abs_norm = abspath(p_path); + +#ifdef WINDOWS_ENABLED + if (get_drive_letter(relative_to_abs_norm) != get_drive_letter(path_abs_norm)) { + return path_abs_norm; + } +#endif + + return relative_to_impl(path_abs_norm, relative_to_abs_norm); +} + } // namespace path diff --git a/modules/mono/utils/path_utils.h b/modules/mono/utils/path_utils.h index ca25bc09f7..7e868d2b5a 100644 --- a/modules/mono/utils/path_utils.h +++ b/modules/mono/utils/path_utils.h @@ -57,6 +57,8 @@ String abspath(const String &p_path); */ String realpath(const String &p_path); +String relative_to(const String &p_path, const String &p_relative_to); + } // namespace path #endif // PATH_UTILS_H diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 13b645732e..5b04404be7 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -37,6 +37,7 @@ #include "core/variant.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" +#include "editor/editor_scale.h" #include "scene/main/viewport.h" #include "visual_script_expression.h" #include "visual_script_flow_control.h" diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 4194e129ef..0645efccd7 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -38,6 +38,7 @@ #include "core/project_settings.h" #include "core/version.h" #include "editor/editor_export.h" +#include "editor/editor_log.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "platform/android/logo.gen.h" diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ccc658b0aa..92e740889d 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2286,7 +2286,7 @@ void Control::set_theme(const Ref<Theme> &p_theme) { } if (data.theme.is_valid()) { - data.theme->connect("changed", this, "_theme_changed"); + data.theme->connect("changed", this, "_theme_changed", varray(), CONNECT_DEFERRED); } } diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index b6e647d1af..cc2d5dd6ea 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -35,6 +35,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "scene/main/viewport.h" // Only used to check for more modals when dimming the editor. #endif diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 9bcacd6ee3..2c4c7bdebe 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1946,6 +1946,7 @@ void TextEdit::indent_right() { // Ignore if the cursor is not past the first column. if (is_selection_active() && get_selection_to_column() == 0) { + selection_offset = 0; end_line--; } |