summaryrefslogtreecommitdiffstats
path: root/editor/import_dock.cpp
diff options
context:
space:
mode:
authorNong Van Tinh <vannongtinh@gmail.com>2023-03-20 14:47:41 +0700
committerNong Van Tinh <vannongtinh@gmail.com>2023-05-01 08:15:15 +0700
commitf40a5fc3f6bd7df17dd4d426b46a364c85a6330a (patch)
tree9a9ef221a749aa6636e5d2e0dc56edccde4bb683 /editor/import_dock.cpp
parent4d5f10fc3ad4e72c22391663c37d1f46510bb291 (diff)
downloadredot-engine-f40a5fc3f6bd7df17dd4d426b46a364c85a6330a.tar.gz
Expose 'Reimport' on right-click context menu in the FileSystem panel
Diffstat (limited to 'editor/import_dock.cpp')
-rw-r--r--editor/import_dock.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp
index b5680f2f2c..824a65c443 100644
--- a/editor/import_dock.cpp
+++ b/editor/import_dock.cpp
@@ -316,6 +316,21 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
}
}
+void ImportDock::reimport_resources(const Vector<String> &p_paths) {
+ switch (p_paths.size()) {
+ case 0:
+ ERR_FAIL_MSG("You need to select files to reimport them.");
+ case 1:
+ set_edit_path(p_paths[0]);
+ break;
+ default:
+ set_edit_multiple_paths(p_paths);
+ break;
+ }
+
+ _reimport_attempt();
+}
+
void ImportDock::_update_preset_menu() {
preset->get_popup()->clear();