aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/scenes_dock.cpp
diff options
context:
space:
mode:
authorAndreas Haas2016-06-06 17:20:03 +0200
committerAndreas Haas2016-06-06 17:20:03 +0200
commitbe867f387781913f7ffdecc4332f7e0978789f5c (patch)
tree7c2879390c072e4c51862dc45c37b52964fcafe0 /tools/editor/scenes_dock.cpp
parent955ed0a95f61e14e6c941540b11905a16fb40d00 (diff)
downloadgodot-be867f387781913f7ffdecc4332f7e0978789f5c.tar.gz
godot-be867f387781913f7ffdecc4332f7e0978789f5c.tar.zst
godot-be867f387781913f7ffdecc4332f7e0978789f5c.zip
Add a "copy path" item to the filesystem dock context menu.
Copies the path (in "res://" format) of the selected resource to the clipboard. Useful for preloads/extends etc.
Diffstat (limited to 'tools/editor/scenes_dock.cpp')
-rw-r--r--tools/editor/scenes_dock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index 2ac439491..7c61e3d4a 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -1101,7 +1101,13 @@ void ScenesDock::_file_option(int p_option) {
}
} break;
+ case FILE_COPY_PATH:
+ int idx = files->get_current();
+ if (idx<0 || idx>=files->get_item_count())
+ break;
+ String path = files->get_item_metadata(idx);
+ OS::get_singleton()->set_clipboard(path);
}
}
@@ -1545,6 +1551,7 @@ void ScenesDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) {
}
if (filenames.size()==1) {
+ file_options->add_item(TTR("Copy Path"), FILE_COPY_PATH);
file_options->add_item(TTR("Rename or Move.."),FILE_MOVE);
} else {
file_options->add_item(TTR("Move To.."),FILE_MOVE);