diff options
-rw-r--r-- | editor/debugger/editor_debugger_tree.cpp | 5 | ||||
-rw-r--r-- | editor/editor_node.cpp | 10 | ||||
-rw-r--r-- | editor/gui/editor_object_selector.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/editor_plugin.cpp | 1 | ||||
-rw-r--r-- | platform/linuxbsd/wayland/display_server_wayland.cpp | 2 | ||||
-rw-r--r-- | platform/macos/doc_classes/EditorExportPlatformMacOS.xml | 7 | ||||
-rw-r--r-- | platform/macos/export/export_plugin.cpp | 16 | ||||
-rw-r--r-- | scene/debugger/scene_debugger.cpp | 16 | ||||
-rw-r--r-- | servers/rendering/renderer_canvas_cull.cpp | 6 |
9 files changed, 68 insertions, 9 deletions
diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp index c4d7899b2d..a900842651 100644 --- a/editor/debugger/editor_debugger_tree.cpp +++ b/editor/debugger/editor_debugger_tree.cpp @@ -277,11 +277,14 @@ Variant EditorDebuggerTree::get_drag_data(const Point2 &p_point) { } String path = selected->get_text(0); + const int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)); HBoxContainer *hb = memnew(HBoxContainer); TextureRect *tf = memnew(TextureRect); tf->set_texture(selected->get_icon(0)); - tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); + tf->set_custom_minimum_size(Size2(icon_size, icon_size)); + tf->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED); + tf->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); hb->add_child(tf); Label *label = memnew(Label(path)); hb->add_child(label); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 95b3c30d1b..dd6c88ef25 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4771,7 +4771,13 @@ Ref<Texture2D> EditorNode::_get_class_or_script_icon(const String &p_class, cons // Look for the native base type in the editor theme. This is relevant for // scripts extending other scripts and for built-in classes. String script_class_name = p_script->get_language()->get_global_class_name(p_script->get_path()); - String base_type = ScriptServer::get_global_class_native_base(script_class_name); + String base_type; + if (script_class_name.is_empty()) { + base_type = p_script->get_instance_base_type(); + } else { + base_type = ScriptServer::get_global_class_native_base(script_class_name); + } + if (theme.is_valid() && theme->has_icon(base_type, EditorStringName(EditorIcons))) { return theme->get_icon(base_type, EditorStringName(EditorIcons)); } @@ -4836,6 +4842,8 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p Ref<Script> scr; if (ScriptServer::is_global_class(p_class)) { scr = EditorNode::get_editor_data().script_class_load_script(p_class); + } else if (ResourceLoader::exists(p_class)) { // If the script is not a class_name we check if the script resource exists. + scr = ResourceLoader::load(p_class); } return _get_class_or_script_icon(p_class, scr, p_fallback, true); diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp index b73cd3b65c..ec5caa8c2a 100644 --- a/editor/gui/editor_object_selector.cpp +++ b/editor/gui/editor_object_selector.cpp @@ -30,6 +30,7 @@ #include "editor_object_selector.h" +#include "editor/debugger/editor_debugger_inspector.h" #include "editor/editor_data.h" #include "editor/editor_node.h" #include "editor/editor_string_names.h" @@ -131,6 +132,19 @@ void EditorObjectSelector::update_path() { Ref<Texture2D> obj_icon; if (Object::cast_to<MultiNodeEdit>(obj)) { obj_icon = EditorNode::get_singleton()->get_class_icon(Object::cast_to<MultiNodeEdit>(obj)->get_edited_class_name()); + } else if (Object::cast_to<EditorDebuggerRemoteObject>(obj)) { + String class_name; + Ref<Script> base_script = obj->get_script(); + if (base_script.is_valid()) { + class_name = base_script->get_global_name(); + + if (class_name.is_empty()) { + // If there is no class_name in this script we just take the script path. + class_name = base_script->get_path(); + } + } + + obj_icon = EditorNode::get_singleton()->get_class_icon(class_name.is_empty() ? Object::cast_to<EditorDebuggerRemoteObject>(obj)->type_name : class_name); } else { obj_icon = EditorNode::get_singleton()->get_object_icon(obj); } diff --git a/editor/plugins/editor_plugin.cpp b/editor/plugins/editor_plugin.cpp index c8426bce73..29e4adb45a 100644 --- a/editor/plugins/editor_plugin.cpp +++ b/editor/plugins/editor_plugin.cpp @@ -153,7 +153,6 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C } break; case CONTAINER_PROJECT_SETTING_TAB_RIGHT: { ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(p_control); - ProjectSettingsEditor::get_singleton()->get_tabs()->move_child(p_control, 1); } break; } diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp index 3fbbc263a0..71c721ca1d 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.cpp +++ b/platform/linuxbsd/wayland/display_server_wayland.cpp @@ -1479,12 +1479,12 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win driver_found = true; } } +#endif // GLES3_ENABLED if (!driver_found) { r_error = ERR_UNAVAILABLE; ERR_FAIL_MSG("Video driver not found."); } -#endif // GLES3_ENABLED cursor_set_shape(CURSOR_BUSY); diff --git a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml index c261c252ba..dcaba9bbd2 100644 --- a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml +++ b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml @@ -75,6 +75,13 @@ <member name="codesign/custom_options" type="PackedStringArray" setter="" getter=""> Array of the additional command line arguments passed to the code signing tool. </member> + <member name="codesign/entitlements/additional" type="String" setter="" getter=""> + Additional data added to the root [code]<dict>[/code] section of the [url=https://developer.apple.com/documentation/bundleresources/entitlements].entitlements[/url] file. The value should be an XML section with pairs of key-value elements, e.g.: + [codeblock lang=text] + <key>key_name</key> + <string>value</string> + [/codeblock] + </member> <member name="codesign/entitlements/address_book" type="bool" setter="" getter=""> Enable to allow access to contacts in the user's address book, if it's enabled you should also provide usage message in the [member privacy/address_book_usage_description] option. See [url=https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_personal-information_addressbook]com.apple.security.personal-information.addressbook[/url]. </member> diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index c99e9cdd0c..7887e5d0ab 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -327,7 +327,7 @@ bool EditorExportPlatformMacOS::get_export_option_visibility(const EditorExportP } bool advanced_options_enabled = p_preset->are_advanced_options_enabled(); - if (p_option.begins_with("privacy")) { + if (p_option.begins_with("privacy") || p_option == "codesign/entitlements/additional") { return advanced_options_enabled; } } @@ -501,6 +501,7 @@ void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_movies", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_user_selected", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::ARRAY, "codesign/entitlements/app_sandbox/helper_executables", PROPERTY_HINT_ARRAY_TYPE, itos(Variant::STRING) + "/" + itos(PROPERTY_HINT_GLOBAL_FILE) + ":"), Array())); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/entitlements/additional", PROPERTY_HINT_MULTILINE_TEXT), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "codesign/custom_options"), PackedStringArray())); #ifdef MACOS_ENABLED @@ -2126,6 +2127,11 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p } } + const String &additional_entitlements = p_preset->get("codesign/entitlements/additional"); + if (!additional_entitlements.is_empty()) { + ent_f->store_line(additional_entitlements); + } + ent_f->store_line("</dict>"); ent_f->store_line("</plist>"); } else { @@ -2288,6 +2294,14 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p } } + if (FileAccess::exists(ent_path)) { + print_verbose("entitlements:\n" + FileAccess::get_file_as_string(ent_path)); + } + + if (FileAccess::exists(hlp_ent_path)) { + print_verbose("helper entitlements:\n" + FileAccess::get_file_as_string(hlp_ent_path)); + } + // Clean up temporary entitlements files. if (FileAccess::exists(hlp_ent_path)) { DirAccess::remove_file_or_error(hlp_ent_path); diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index 07c32eef13..22e5238fae 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -535,7 +535,21 @@ SceneDebuggerTree::SceneDebuggerTree(Node *p_root) { } } } - nodes.push_back(RemoteNode(count, n->get_name(), n->get_class(), n->get_instance_id(), n->get_scene_file_path(), view_flags)); + + String class_name; + ScriptInstance *script_instance = n->get_script_instance(); + if (script_instance) { + Ref<Script> script = script_instance->get_script(); + if (script.is_valid()) { + class_name = script->get_global_name(); + + if (class_name.is_empty()) { + // If there is no class_name in this script we just take the script path. + class_name = script->get_path(); + } + } + } + nodes.push_back(RemoteNode(count, n->get_name(), class_name.is_empty() ? n->get_class() : class_name, n->get_instance_id(), n->get_scene_file_path(), view_flags)); } } diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index b5873528f7..701b4da8f8 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -95,7 +95,7 @@ void RendererCanvasCull::_collect_ysort_children(RendererCanvasCull::Item *p_can } if (snapping_2d_transforms_to_pixel) { - child_xform.columns[2] = child_xform.columns[2].round(); + child_xform.columns[2] = (child_xform.columns[2] + Point2(0.5, 0.5)).floor(); } r_items[r_index] = child_items[i]; @@ -303,8 +303,8 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2 Transform2D parent_xform = p_parent_xform; if (snapping_2d_transforms_to_pixel) { - self_xform.columns[2] = self_xform.columns[2].round(); - parent_xform.columns[2] = parent_xform.columns[2].round(); + self_xform.columns[2] = (self_xform.columns[2] + Point2(0.5, 0.5)).floor(); + parent_xform.columns[2] = (parent_xform.columns[2] + Point2(0.5, 0.5)).floor(); } final_xform = parent_xform * self_xform; |