From 6fc1c3a4d1cf0c865f7dfdb1221ef07a5d25f305 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 27 Feb 2016 23:10:44 -0300 Subject: Completed the support for plugins! It is not possible to add plugins. Not all APIs are provided yet, please request whathever you are missing. Some example plugins are provided in demos/plugins. Just copy them to a folder in your project named addons/ and then enable them from the project settings. Have fun! --- tools/doc/doc_data.cpp | 8 +- tools/editor/create_dialog.cpp | 29 ++- tools/editor/editor_data.cpp | 12 +- tools/editor/editor_data.h | 3 + tools/editor/editor_help.cpp | 80 ++++++-- tools/editor/editor_import_export.cpp | 31 ++- tools/editor/editor_import_export.h | 4 + tools/editor/editor_node.cpp | 184 ++++++++++++++++- tools/editor/editor_node.h | 38 ++-- tools/editor/editor_plugin.cpp | 79 +++++++- tools/editor/editor_plugin.h | 30 ++- tools/editor/editor_plugin_settings.cpp | 188 ++++++++++++++++++ tools/editor/editor_plugin_settings.h | 35 ++++ tools/editor/editor_settings.cpp | 217 --------------------- tools/editor/editor_settings.h | 12 -- .../io_plugins/editor_font_import_plugin.cpp | 2 +- .../io_plugins/editor_scene_import_plugin.cpp | 11 +- .../editor/io_plugins/editor_scene_import_plugin.h | 2 +- tools/editor/plugins/path_editor_plugin.cpp | 12 +- tools/editor/plugins/path_editor_plugin.h | 6 +- tools/editor/plugins/spatial_editor_plugin.cpp | 29 ++- tools/editor/plugins/spatial_editor_plugin.h | 4 - tools/editor/project_settings.cpp | 12 ++ tools/editor/project_settings.h | 10 + tools/editor/settings_config_dialog.cpp | 201 ------------------- tools/editor/settings_config_dialog.h | 14 -- tools/editor/spatial_editor_gizmos.cpp | 63 ++++-- tools/editor/spatial_editor_gizmos.h | 93 ++++----- 28 files changed, 820 insertions(+), 589 deletions(-) create mode 100644 tools/editor/editor_plugin_settings.cpp create mode 100644 tools/editor/editor_plugin_settings.h (limited to 'tools') diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 3836fa710b..2d0d7617c2 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -190,7 +190,11 @@ void DocData::generate(bool p_basic_types) { #ifdef DEBUG_METHODS_ENABLED if (m && m->get_return_type()!=StringName()) method.return_type=m->get_return_type(); - else if (arginfo.type!=Variant::NIL) // { + else if (method.name.find(":")!=-1) { + method.return_type=method.name.get_slice(":",1); + method.name=method.name.get_slice(":",0); + + } else if (arginfo.type!=Variant::NIL) // { #endif method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type); // } @@ -210,7 +214,7 @@ void DocData::generate(bool p_basic_types) { } else if (arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE) { type_name=arginfo.hint_string; } else if (arginfo.type==Variant::NIL) - type_name="var"; + type_name="Variant"; else type_name=Variant::get_type_name(arginfo.type); diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index 0f39d72308..23b8cad9ce 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -171,6 +171,7 @@ void CreateDialog::_update_search() { if (EditorNode::get_editor_data().get_custom_types().has(type)) { //there are custom types based on this... cool. + //print_line("there are custom types"); const Vector &ct = EditorNode::get_editor_data().get_custom_types()[type]; @@ -259,7 +260,33 @@ Object *CreateDialog::instance_selected() { TreeItem *selected = search_options->get_selected(); if (selected) { - return ObjectTypeDB::instance(selected->get_text(0)); + String custom = selected->get_metadata(0); + if (custom!=String()) { + if (EditorNode::get_editor_data().get_custom_types().has(custom)) { + + for(int i=0;iget_text(0)) { + Ref icon = EditorNode::get_editor_data().get_custom_types()[custom][i].icon; + Ref