diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-26 00:00:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-26 00:00:44 +0200 |
commit | f3c906757cd9fd9fcff2943ce76e17cdbcf052d4 (patch) | |
tree | f970b287efddb36c90d19a64043459a1f1fa058b /editor | |
parent | a8476c04f457a3fd3eecf32cc8fbd86381ac0826 (diff) | |
parent | ebecd148fe7abeebfbe2daee7eedd49e7b744763 (diff) |
Merge pull request #64573 from KoBeWi/signal_name_plagiarism
Add "Copy Name" option to signal menu
Diffstat (limited to 'editor')
-rw-r--r-- | editor/connections_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/connections_dialog.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 6c86b341da..dc8a64d904 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -840,6 +840,9 @@ void ConnectionsDock::_handle_signal_menu_option(int p_option) { disconnect_all_dialog->set_text(vformat(TTR("Are you sure you want to remove all connections from the \"%s\" signal?"), signal_name)); disconnect_all_dialog->popup_centered(); } break; + case COPY_NAME: { + DisplayServer::get_singleton()->clipboard_set(item->get_metadata(0).operator Dictionary()["name"]); + } break; } } @@ -1164,6 +1167,7 @@ ConnectionsDock::ConnectionsDock() { signal_menu->connect("id_pressed", callable_mp(this, &ConnectionsDock::_handle_signal_menu_option)); signal_menu->add_item(TTR("Connect..."), CONNECT); signal_menu->add_item(TTR("Disconnect All"), DISCONNECT_ALL); + signal_menu->add_item(TTR("Copy Name"), COPY_NAME); slot_menu = memnew(PopupMenu); add_child(slot_menu); diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 7e7192019b..352c5c99d6 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -177,13 +177,14 @@ class ConnectionsDock : public VBoxContainer { //Right-click Pop-up Menu Options. enum SignalMenuOption { CONNECT, - DISCONNECT_ALL + DISCONNECT_ALL, + COPY_NAME, }; enum SlotMenuOption { EDIT, GO_TO_SCRIPT, - DISCONNECT + DISCONNECT, }; Node *selected_node = nullptr; |