From 95eb7466df890dcbed9eb8e8bda15bd9235db9c0 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 11 Sep 2016 11:28:01 -0300 Subject: -Added a ColorFrame control, kind of like Texture but for color. -Added dropping nodes to text editor for them to become a path -Fixed issues with font not properly being set in code editor --- tools/editor/plugins/script_text_editor.cpp | 146 ++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) (limited to 'tools/editor/plugins/script_text_editor.cpp') diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp index 57cf8cbea..69f4c9d9a 100644 --- a/tools/editor/plugins/script_text_editor.cpp +++ b/tools/editor/plugins/script_text_editor.cpp @@ -30,6 +30,7 @@ #include "tools/editor/editor_settings.h" #include "os/keyboard.h" #include "tools/editor/script_editor_debugger.h" +#include "tools/editor/editor_node.h" Vector ScriptTextEditor::get_functions() { @@ -920,6 +921,10 @@ void ScriptTextEditor::_bind_methods() { ObjectTypeDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option); ObjectTypeDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line); + ObjectTypeDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw); + ObjectTypeDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw); + ObjectTypeDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw); + ADD_SIGNAL(MethodInfo("name_changed")); ADD_SIGNAL(MethodInfo("request_help_search",PropertyInfo(Variant::STRING,"topic"))); } @@ -957,6 +962,144 @@ void ScriptTextEditor::set_debugger_active(bool p_active) { } + +Variant ScriptTextEditor::get_drag_data_fw(const Point2& p_point,Control* p_from) { + + return Variant(); +} + +bool ScriptTextEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const{ + + Dictionary d = p_data; + if (d.has("type") && + ( + + String(d["type"])=="resource" || + String(d["type"])=="files" || + String(d["type"])=="nodes" + ) ) { + + + return true; + } + + + return false; + +} + +#ifdef TOOLS_ENABLED + +static Node* _find_script_node(Node* p_edited_scene,Node* p_current_node,const Ref