From 32a0a50fcf567c360a7e4fd0fa5822c581b8dc64 Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Tue, 12 Jan 2021 00:51:59 +0100 Subject: [PATCH] Create spritesheet for SpriteFrames by drag and dropping. Close godotengine/godot-proposals#378 (cherry picked from commit 390ff22a8cd9292d1a7ca3383b14eef4e48712b7) --- editor/plugins/sprite_frames_editor_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 9e4c37c44fa..ad067ae13c6 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -31,6 +31,8 @@ #include "sprite_frames_editor_plugin.h" #include "core/io/resource_loader.h" +#include "core/os/input.h" +#include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" @@ -861,7 +863,11 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da PoolVector 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); + } } }