diff options
author | hbina085 <hanif.ariffin.4326@gmail.com> | 2019-05-05 03:59:10 -0400 |
---|---|---|
committer | hbina085 <hanif.ariffin.4326@gmail.com> | 2019-05-17 00:49:37 -0400 |
commit | 5f862ee1867feff8a96cde08c71c5f8821bcfe7b (patch) | |
tree | b46799265adfe141a20c372e56d7a9c35a4b5139 /editor | |
parent | d8617f237acbed21ca4b1a9e7df2d28b32e511b1 (diff) |
Now able to "Copy Node Path" from Remote tab". Fixes issue 28585.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/script_editor_debugger.cpp | 20 | ||||
-rw-r--r-- | editor/script_editor_debugger.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 1da8bf874c..a661c2cfc3 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -299,6 +299,7 @@ void ScriptEditorDebugger::_scene_tree_rmb_selected(const Vector2 &p_position) { item_menu->clear(); item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); + item_menu->add_icon_item(get_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); item_menu->set_global_position(get_global_mouse_position()); item_menu->popup(); } @@ -396,6 +397,7 @@ Size2 ScriptEditorDebugger::get_minimum_size() const { ms.y = MAX(ms.y, 250 * EDSCALE); return ms; } + void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_data) { if (p_msg == "debug_enter") { @@ -1930,6 +1932,24 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { file_dialog->popup_centered_ratio(); } break; + case ITEM_MENU_COPY_NODE_PATH: { + + TreeItem *ti = inspect_scene_tree->get_selected(); + String text = ti->get_text(0); + + if (ti->get_parent() == NULL) { + text = "."; + } else if (ti->get_parent()->get_parent() == NULL) { + text = "."; + } else { + while (ti->get_parent()->get_parent() != inspect_scene_tree->get_root()) { + ti = ti->get_parent(); + text = ti->get_text(0) + "/" + text; + } + } + + OS::get_singleton()->set_clipboard(text); + } break; } } diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index f7afe6bf72..05dcab0f80 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -66,6 +66,7 @@ class ScriptEditorDebugger : public Control { enum ItemMenu { ITEM_MENU_COPY_ERROR, ITEM_MENU_SAVE_REMOTE_NODE, + ITEM_MENU_COPY_NODE_PATH, }; AcceptDialog *msgdialog; |