summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-15 09:17:05 +0100
committerGitHub <noreply@github.com>2021-01-15 09:17:05 +0100
commit8a331070868cf4e4c5aa91d20ca3a22a8cc42a8e (patch)
treef25021b164ddc0616074841d21ee9741e0706953 /editor
parent64ba83a096783c7bb3d4c20c6bec29699687d228 (diff)
parent390ff22a8cd9292d1a7ca3383b14eef4e48712b7 (diff)
Merge pull request #35572 from dankan1890/drag_sheet
Create spritesheet for SpriteFrames by drag and dropping.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 2aa6ad0eaa..0547f99079 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -32,6 +32,7 @@
#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
+#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "scene/3d/sprite_3d.h"
@@ -952,7 +953,11 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
if (String(d["type"]) == "files") {
Vector<String> files = d["files"];
- _file_load_request(files, at_pos);
+ if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) {
+ _prepare_sprite_sheet(files[0]);
+ } else {
+ _file_load_request(files, at_pos);
+ }
}
}