diff options
author | Ryan Roden-Corrent <ryan@rcorre.net> | 2022-03-13 09:23:44 -0400 |
---|---|---|
committer | Ryan Roden-Corrent <ryan@rcorre.net> | 2022-03-13 09:23:44 -0400 |
commit | d271e2517e77707d33ca46811a87603340befa2f (patch) | |
tree | 501410c261856891d9fe41a80acfb6281557b75a | |
parent | 90faf04f293fcdf636f641bfe3d88c5857695d9b (diff) |
Copy full project setting path from dialog.
The EditorProperty UI elements for project settings are created from
SectionedInspector, which has a prefix added to each property path. Each
EditorProperty needs to be made aware of this path so copy_property_path
copies the full path, and not just the suffix.
Fixes #59020.
-rw-r--r-- | editor/editor_inspector.cpp | 4 | ||||
-rw-r--r-- | editor/editor_inspector.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index d48ca7f3b3..999f057db9 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -881,7 +881,7 @@ void EditorProperty::menu_option(int p_option) { emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard()); } break; case MENU_COPY_PROPERTY_PATH: { - DisplayServer::get_singleton()->clipboard_set(property); + DisplayServer::get_singleton()->clipboard_set(property_path); } break; case MENU_PIN_VALUE: { emit_signal(SNAME("property_pinned"), property, !pinned); @@ -2331,6 +2331,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit if (F.properties.size() == 1) { //since it's one, associate: ep->property = F.properties[0]; + ep->property_path = property_prefix + F.properties[0]; ep->property_usage = 0; } @@ -2889,6 +2890,7 @@ void EditorInspector::update_tree() { if (F.properties.size() == 1) { //since it's one, associate: ep->property = F.properties[0]; + ep->property_path = property_prefix + F.properties[0]; ep->property_usage = p.usage; //and set label? } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 43f71740e3..b76d16e59c 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -68,6 +68,7 @@ private: friend class EditorInspector; Object *object; StringName property; + String property_path; int property_usage; |