From ad313097ebcb2a0c02c956fdf74a6610c3f7c9a8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 2 Aug 2016 19:11:05 -0300 Subject: WIP visual scripting, not working yet but you can check out stuff --- tools/editor/plugins/script_text_editor.cpp | 1057 +++++++++++++++++++++++++++ 1 file changed, 1057 insertions(+) create mode 100644 tools/editor/plugins/script_text_editor.cpp (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 new file mode 100644 index 000000000..79da64db9 --- /dev/null +++ b/tools/editor/plugins/script_text_editor.cpp @@ -0,0 +1,1057 @@ +#include "script_text_editor.h" +#include "tools/editor/editor_settings.h" +#include "os/keyboard.h"" +#include "tools/editor/script_editor_debugger.h" +Vector ScriptTextEditor::get_functions() { + + + String errortxt; + int line=-1,col; + TextEdit *te=code_editor->get_text_edit(); + String text = te->get_text(); + List fnc; + + if (script->get_language()->validate(text,line,col,errortxt,script->get_path(),&fnc)) { + + //if valid rewrite functions to latest + functions.clear(); + for (List::Element *E=fnc.front();E;E=E->next()) { + + functions.push_back(E->get()); + } + + + } + + return functions; +} + +void ScriptTextEditor::apply_code() { + + if (script.is_null()) + return; +// print_line("applying code"); + script->set_source_code(code_editor->get_text_edit()->get_text()); + script->update_exports(); +} + +Ref