Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
b426d11d
Commit
b426d11d
authored
Jun 05, 2020
by
Tomasz Chabora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow duplicating files when holding Control
parent
c0ff2a38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
filesystem_dock.cpp
editor/filesystem_dock.cpp
+26
-1
No files found.
editor/filesystem_dock.cpp
View file @
b426d11d
...
...
@@ -2085,7 +2085,32 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data,
}
}
if
(
!
to_move
.
empty
())
{
_move_operation_confirm
(
to_dir
);
if
(
Input
::
get_singleton
()
->
is_key_pressed
(
KEY_CONTROL
))
{
for
(
int
i
=
0
;
i
<
to_move
.
size
();
i
++
)
{
String
new_path
;
String
new_path_base
;
if
(
to_move
[
i
].
is_file
)
{
new_path
=
to_dir
.
plus_file
(
to_move
[
i
].
path
.
get_file
());
new_path_base
=
new_path
.
get_basename
()
+
" (%d)."
+
new_path
.
get_extension
();
}
else
{
PackedStringArray
path_split
=
to_move
[
i
].
path
.
split
(
"/"
);
new_path
=
to_dir
.
plus_file
(
path_split
[
path_split
.
size
()
-
2
]);
new_path_base
=
new_path
+
" (%d)"
;
}
int
exist_counter
=
1
;
DirAccessRef
da
=
DirAccess
::
create
(
DirAccess
::
ACCESS_RESOURCES
);
while
(
da
->
file_exists
(
new_path
)
||
da
->
dir_exists
(
new_path
))
{
exist_counter
++
;
new_path
=
vformat
(
new_path_base
,
exist_counter
);
}
_try_duplicate_item
(
to_move
[
i
],
new_path
);
}
_rescan
();
}
else
{
_move_operation_confirm
(
to_dir
);
}
}
}
else
if
(
favorite
)
{
// Add the files from favorites.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment