Skip to content

Commit

Permalink
Add a right-click action to copy the resource identifier to the sideb…
Browse files Browse the repository at this point in the history
…ar (#2333)
  • Loading branch information
Jowan-Spooner authored Jul 9, 2024
1 parent aa90f77 commit 0e802cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/dialogic/Editor/Common/sidebar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func _ready() -> void:
%RightClickMenu.clear()
%RightClickMenu.add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Remove From List", 1)
%RightClickMenu.add_separator()
%RightClickMenu.add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), "Copy Identifier", 4)
%RightClickMenu.add_separator()
%RightClickMenu.add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), "Show in FileSystem", 2)
%RightClickMenu.add_icon_item(get_theme_icon("ExternalLink", "EditorIcons"), "Open in External Program", 3)

Expand Down Expand Up @@ -186,3 +188,5 @@ func _on_right_click_menu_id_pressed(id:int) -> void:
EditorInterface.get_file_system_dock().navigate_to_path(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index")))
3: # OPEN IN EXTERNAL EDITOR
OS.shell_open(ProjectSettings.globalize_path(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index"))))
4:
DisplayServer.clipboard_set(DialogicResourceUtil.get_unique_identifier(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index"))))

0 comments on commit 0e802cc

Please sign in to comment.