diff --git a/editor/inspector/editor_inspector.cpp b/editor/inspector/editor_inspector.cpp index 1efc1491497c..70c352eab39d 100644 --- a/editor/inspector/editor_inspector.cpp +++ b/editor/inspector/editor_inspector.cpp @@ -33,8 +33,10 @@ #include "core/os/keyboard.h" #include "editor/debugger/editor_debugger_inspector.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/doc/doc_tools.h" #include "editor/docks/inspector_dock.h" +#include "editor/editor_interface.h" #include "editor/editor_main_screen.h" #include "editor/editor_node.h" #include "editor/editor_string_names.h" @@ -1348,7 +1350,11 @@ void EditorProperty::menu_option(int p_option) { InspectorDock::get_inspector_singleton()->set_property_clipboard(object->get(property)); } break; case MENU_PASTE_VALUE: { - emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard()); + const Dictionary clipboard = InspectorDock::get_inspector_singleton()->get_property_clipboard(); + if (clipboard.has("@pastebin_category_name") || clipboard.has("@pastebin_section_name")) { + break; + } + emit_changed(property, clipboard); } break; case MENU_COPY_PROPERTY_PATH: { DisplayServer::get_singleton()->clipboard_set(property_path); @@ -1757,8 +1763,135 @@ Size2 EditorInspectorCategory::get_minimum_size() const { return ms; } +void EditorInspectorCategory::_collect_properties(const Object *p_object, LocalVector &r_properties) const { + List property_list; + p_object->get_property_list(&property_list, true); + + String current_category; + for (const PropertyInfo &prop_info : property_list) { + if (prop_info.usage & PROPERTY_USAGE_GROUP) { + continue; + } + if (prop_info.usage & PROPERTY_USAGE_CATEGORY) { + current_category = prop_info.name; + continue; + } + if (!(prop_info.usage & PROPERTY_USAGE_EDITOR)) { + continue; + } + if (!current_category.ends_with(info.name)) { + continue; + } + + r_properties.push_back(prop_info.name); + } +} + void EditorInspectorCategory::_handle_menu_option(int p_option) { switch (p_option) { + case MENU_COPY_VALUE: { + const Object *object = EditorInterface::get_singleton()->get_inspector()->get_edited_object(); + String category_name = info.name; + if (!EditorNode::get_editor_data().is_type_recognized(info.name) && ResourceLoader::exists(info.hint_string, "Script")) { + Ref