From 37f1e86108a84c9b371e37c3854d8a03c8aea743 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 12 Sep 2016 10:52:29 -0300 Subject: Do ctrl-click on any code identifier to go to definiton or help page. --- tools/editor/plugins/script_editor_plugin.cpp | 47 ++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'tools/editor/plugins/script_editor_plugin.cpp') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 77b410647..340e5cca4 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -43,6 +43,17 @@ /*** SCRIPT EDITOR ****/ + +void ScriptEditorBase::_bind_methods() { + + ADD_SIGNAL(MethodInfo("name_changed")); + ADD_SIGNAL(MethodInfo("request_help_search",PropertyInfo(Variant::STRING,"topic"))); + ADD_SIGNAL(MethodInfo("request_open_script_at_line",PropertyInfo(Variant::OBJECT,"script"),PropertyInfo(Variant::INT,"line"))); + ADD_SIGNAL(MethodInfo("request_save_history")); + ADD_SIGNAL(MethodInfo("go_to_help",PropertyInfo(Variant::STRING,"what"))); + +} + static bool _can_open_in_editor(Script* p_script) { String path = p_script->get_path(); @@ -346,6 +357,34 @@ void ScriptEditor::_update_history_arrows() { script_forward->set_disabled( history_pos>=history.size()-1 ); } +void ScriptEditor::_save_history() { + + + if (history_pos>=0 && history_posget_current_tab_control()) { + + Node *n = tab_container->get_current_tab_control(); + + if (n->cast_to()) { + + history[history_pos].state=n->cast_to()->get_edit_state(); + } + if (n->cast_to()) { + + history[history_pos].state=n->cast_to()->get_scroll(); + } + } + + history.resize(history_pos+1); + ScriptHistory sh; + sh.control=tab_container->get_current_tab_control(); + sh.state=Variant(); + + history.push_back(sh); + history_pos++; + + _update_history_arrows(); +} + void ScriptEditor::_go_to_tab(int p_idx) { @@ -1535,6 +1574,11 @@ void ScriptEditor::edit(const Ref