summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/connections_dialog.cpp95
-rw-r--r--tools/editor/connections_dialog.h11
-rw-r--r--tools/editor/create_dialog.cpp17
-rw-r--r--tools/editor/editor_help.cpp9
-rw-r--r--tools/editor/editor_help.h1
-rw-r--r--tools/editor/editor_import_export.cpp2
-rw-r--r--tools/editor/editor_node.cpp51
-rw-r--r--tools/editor/editor_node.h5
-rw-r--r--tools/editor/editor_settings.cpp1
-rw-r--r--tools/editor/groups_editor.cpp20
-rw-r--r--tools/editor/groups_editor.h4
-rw-r--r--tools/editor/icons/icon_connection_and_groups.pngbin0 -> 760 bytes
-rw-r--r--tools/editor/icons/icon_down.pngbin317 -> 186 bytes
-rw-r--r--tools/editor/icons/icon_up.pngbin327 -> 185 bytes
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp4
-rw-r--r--tools/editor/node_dock.cpp104
-rw-r--r--tools/editor/node_dock.h38
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp21
-rw-r--r--tools/editor/plugins/script_editor_plugin.h6
-rw-r--r--tools/editor/project_export.cpp2
-rw-r--r--tools/editor/scene_tree_dock.cpp52
-rw-r--r--tools/editor/scene_tree_dock.h5
-rw-r--r--tools/editor/scene_tree_editor.cpp33
-rw-r--r--tools/editor/scene_tree_editor.h4
25 files changed, 374 insertions, 113 deletions
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index b99cd12f65..e2b8f2884f 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -94,8 +94,8 @@ void ConnectDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
- RID ci = get_canvas_item();
- get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
+ //RID ci = get_canvas_item();
+ //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
if (p_what==NOTIFICATION_ENTER_TREE) {
@@ -480,21 +480,21 @@ ConnectDialog::~ConnectDialog()
-void ConnectionsDialog::_notification(int p_what) {
+void ConnectionsDock::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
- RID ci = get_canvas_item();
- get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
+ //RID ci = get_canvas_item();
+ //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
}
-void ConnectionsDialog::_close() {
+void ConnectionsDock::_close() {
hide();
}
-void ConnectionsDialog::_connect() {
+void ConnectionsDock::_connect() {
TreeItem *it = tree->get_selected();
ERR_FAIL_COND(!it);
@@ -516,6 +516,9 @@ void ConnectionsDialog::_connect() {
undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method);
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(this,"update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
+
undo_redo->commit_action();
@@ -533,13 +536,13 @@ void ConnectionsDialog::_connect() {
-void ConnectionsDialog::ok_pressed() {
+void ConnectionsDock::_connect_pressed() {
TreeItem *item = tree->get_selected();
if (!item) {
//no idea how this happened, but disable
- get_ok()->set_disabled(true);
+ connect_button->set_disabled(true);
return;
}
if (item->get_parent()==tree->get_root() || item->get_parent()->get_parent()==tree->get_root()) {
@@ -577,6 +580,8 @@ void ConnectionsDialog::ok_pressed() {
undo_redo->add_undo_method(node,"connect",c.signal,c.target,c.method,Vector<Variant>(),c.flags);
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(this,"update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
undo_redo->commit_action();
c.source->disconnect(c.signal,c.target,c.method);
@@ -584,7 +589,7 @@ void ConnectionsDialog::ok_pressed() {
}
}
/*
-void ConnectionsDialog::_remove() {
+void ConnectionsDock::_remove() {
if (!tree->get_selected())
return;
@@ -600,7 +605,7 @@ void ConnectionsDialog::_remove() {
}
*/
/*
-void ConnectionsDialog::_remove_confirm() {
+void ConnectionsDock::_remove_confirm() {
if (!tree->get_selected())
return;
@@ -620,18 +625,16 @@ void ConnectionsDialog::_remove_confirm() {
}
*/
-struct _ConnectionsDialogMethodInfoSort {
+struct _ConnectionsDockMethodInfoSort {
_FORCE_INLINE_ bool operator()(const MethodInfo& a, const MethodInfo& b) const {
return a.name < b.name;
}
};
-void ConnectionsDialog::update_tree() {
+void ConnectionsDock::update_tree() {
- if (!is_visible())
- return; //don't update if not visible, of course
- tree->clear();
+ tree->clear();
if (!node)
return;
@@ -643,7 +646,7 @@ void ConnectionsDialog::update_tree() {
node->get_signal_list(&node_signals);
- //node_signals.sort_custom<_ConnectionsDialogMethodInfoSort>();
+ //node_signals.sort_custom<_ConnectionsDockMethodInfoSort>();
bool did_script=false;
StringName base = node->get_type();
@@ -773,68 +776,72 @@ void ConnectionsDialog::update_tree() {
}
}
- get_ok()->set_text(TTR("Connect"));
- get_ok()->set_disabled(true);
+ connect_button->set_text(TTR("Connect"));
+ connect_button->set_disabled(true);
}
-void ConnectionsDialog::set_node(Node* p_node) {
+void ConnectionsDock::set_node(Node* p_node) {
node=p_node;
update_tree();
}
-void ConnectionsDialog::_something_selected() {
+void ConnectionsDock::_something_selected() {
TreeItem *item = tree->get_selected();
if (!item) {
//no idea how this happened, but disable
- get_ok()->set_text(TTR("Connect.."));
- get_ok()->set_disabled(true);
+ connect_button->set_text(TTR("Connect.."));
+ connect_button->set_disabled(true);
} else if (item->get_parent()==tree->get_root() || item->get_parent()->get_parent()==tree->get_root()) {
//a signal - connect
- get_ok()->set_text(TTR("Connect.."));
- get_ok()->set_disabled(false);
+ connect_button->set_text(TTR("Connect.."));
+ connect_button->set_disabled(false);
} else {
//a slot- disconnect
- get_ok()->set_text(TTR("Disconnect"));
- get_ok()->set_disabled(false);
+ connect_button->set_text(TTR("Disconnect"));
+ connect_button->set_disabled(false);
}
}
-void ConnectionsDialog::_bind_methods() {
+void ConnectionsDock::_bind_methods() {
- ObjectTypeDB::bind_method("_connect",&ConnectionsDialog::_connect);
- ObjectTypeDB::bind_method("_something_selected",&ConnectionsDialog::_something_selected);
- ObjectTypeDB::bind_method("_close",&ConnectionsDialog::_close);
-// ObjectTypeDB::bind_method("_remove_confirm",&ConnectionsDialog::_remove_confirm);
- ObjectTypeDB::bind_method("update_tree",&ConnectionsDialog::update_tree);
+ ObjectTypeDB::bind_method("_connect",&ConnectionsDock::_connect);
+ ObjectTypeDB::bind_method("_something_selected",&ConnectionsDock::_something_selected);
+ ObjectTypeDB::bind_method("_close",&ConnectionsDock::_close);
+ ObjectTypeDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed);
+ ObjectTypeDB::bind_method("update_tree",&ConnectionsDock::update_tree);
}
-ConnectionsDialog::ConnectionsDialog(EditorNode *p_editor) {
+ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
editor=p_editor;
- set_title(TTR("Edit Connections.."));
- set_hide_on_ok(false);
-
- VBoxContainer *vbc = memnew( VBoxContainer );
- add_child(vbc);
- set_child_rect(vbc);
+ set_name(TTR("Signals"));
+ VBoxContainer *vbc = this;
tree = memnew( Tree );
tree->set_columns(1);
tree->set_select_mode(Tree::SELECT_ROW);
tree->set_hide_root(true);
- vbc->add_margin_child(TTR("Connections:"),tree,true);
-
+ vbc->add_child(tree);
+ tree->set_v_size_flags(SIZE_EXPAND_FILL);
+
+ connect_button = memnew( Button );
+ connect_button->set_text("Connect");
+ HBoxContainer *hb = memnew( HBoxContainer);
+ vbc->add_child(hb);
+ hb->add_spacer();
+ hb->add_child(connect_button);
+ connect_button->connect("pressed",this,"_connect_pressed");
// add_child(tree);
connect_dialog = memnew( ConnectDialog );
@@ -858,12 +865,12 @@ ConnectionsDialog::ConnectionsDialog(EditorNode *p_editor) {
remove_confirm->connect("confirmed", this,"_remove_confirm");
connect_dialog->connect("connected", this,"_connect");
tree->connect("item_selected", this,"_something_selected");
- get_cancel()->set_text(TTR("Close"));
+ add_constant_override("separation",3*EDSCALE);
}
-ConnectionsDialog::~ConnectionsDialog()
+ConnectionsDock::~ConnectionsDock()
{
}
diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h
index 575bcf54d7..96ebaf85b0 100644
--- a/tools/editor/connections_dialog.h
+++ b/tools/editor/connections_dialog.h
@@ -95,10 +95,11 @@ public:
};
-class ConnectionsDialog : public ConfirmationDialog {
+class ConnectionsDock : public VBoxContainer {
- OBJ_TYPE( ConnectionsDialog , ConfirmationDialog );
+ OBJ_TYPE( ConnectionsDock , VBoxContainer );
+ Button *connect_button;
EditorNode *editor;
Node *node;
Tree *tree;
@@ -114,7 +115,7 @@ class ConnectionsDialog : public ConfirmationDialog {
protected:
- virtual void ok_pressed();
+ void _connect_pressed();
void _notification(int p_what);
static void _bind_methods();
public:
@@ -124,8 +125,8 @@ public:
void set_node(Node* p_node);
String get_selected_type();
- ConnectionsDialog(EditorNode *p_editor=NULL);
- ~ConnectionsDialog();
+ ConnectionsDock(EditorNode *p_editor=NULL);
+ ~ConnectionsDock();
};
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 8bce415fb8..b6137ddac0 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -36,6 +36,8 @@
#if 1
#include "os/keyboard.h"
+#include "editor_settings.h"
+#include "editor_help.h"
void CreateDialog::popup(bool p_dontclear) {
@@ -107,6 +109,21 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
}
+ if (bool(EditorSettings::get_singleton()->get("scenetree_editor/start_create_dialog_fully_expanded"))) {
+ item->set_collapsed(false);
+ } else {
+ // don't collapse search results
+ bool collapse = (search_box->get_text() == "");
+ // don't collapse the root node
+ collapse &= (item != p_root);
+ // don't collapse abstract nodes on the first tree level
+ collapse &= ((parent != p_root) || (ObjectTypeDB::can_instance(p_type)));
+ item->set_collapsed(collapse);
+ }
+
+ const String& description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
+ item->set_tooltip(0,description);
+
if (has_icon(p_type,"EditorIcons")) {
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index b426def503..2d0a8a80b0 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -644,6 +644,13 @@ void EditorHelp::_class_desc_select(const String& p_select) {
}
+void EditorHelp::_class_desc_input(const InputEvent& p_input) {
+ if (p_input.type==InputEvent::MOUSE_BUTTON && p_input.mouse_button.pressed && p_input.mouse_button.button_index==1) {
+ class_desc->set_selection_enabled(false);
+ class_desc->set_selection_enabled(true);
+ }
+}
+
void EditorHelp::_add_type(const String& p_type) {
String t = p_type;
@@ -1625,6 +1632,7 @@ void EditorHelp::_bind_methods() {
ObjectTypeDB::bind_method("_class_list_select",&EditorHelp::_class_list_select);
ObjectTypeDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select);
+ ObjectTypeDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input);
// ObjectTypeDB::bind_method("_button_pressed",&EditorHelp::_button_pressed);
ObjectTypeDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed);
ObjectTypeDB::bind_method("_request_help",&EditorHelp::_request_help);
@@ -1659,6 +1667,7 @@ EditorHelp::EditorHelp() {
pc->add_child(class_desc);
class_desc->set_area_as_parent_rect(8);
class_desc->connect("meta_clicked",this,"_class_desc_select");
+ class_desc->connect("input_event",this,"_class_desc_input");
}
class_desc->get_v_scroll()->connect("value_changed",this,"_scroll_changed");
diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h
index f6dda9f545..c3d19894df 100644
--- a/tools/editor/editor_help.h
+++ b/tools/editor/editor_help.h
@@ -157,6 +157,7 @@ class EditorHelp : public VBoxContainer {
void _scroll_changed(double p_scroll);
void _class_list_select(const String& p_select);
void _class_desc_select(const String& p_select);
+ void _class_desc_input(const InputEvent& p_input);
Error _goto_desc(const String& p_class, int p_vscr=-1);
//void _update_history_buttons();
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index ac7ea514d7..f9b9c0b41c 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -889,7 +889,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
- Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_atlas");
+ Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
Error err = plugin->import2(dst_file,imd,get_image_compression(),true);
if (err) {
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 98cc198d94..5d0617d8ab 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1533,6 +1533,7 @@ void EditorNode::push_item(Object *p_object,const String& p_property) {
if (!p_object) {
property_editor->edit(NULL);
+ node_dock->set_node(NULL);
scene_tree_dock->set_selected(NULL);
return;
}
@@ -1678,6 +1679,7 @@ void EditorNode::_edit_current() {
scene_tree_dock->set_selected(NULL);
property_editor->edit( NULL );
+ node_dock->set_node(NULL);
object_menu->set_disabled(true);
_display_top_editors(false);
@@ -1697,6 +1699,7 @@ void EditorNode::_edit_current() {
ERR_FAIL_COND(!current_res);
scene_tree_dock->set_selected(NULL);
property_editor->edit( current_res );
+ node_dock->set_node(NULL);
object_menu->set_disabled(false);
//resources_dock->add_resource(Ref<Resource>(current_res));
@@ -1713,6 +1716,7 @@ void EditorNode::_edit_current() {
property_editor->edit( current_node );
+ node_dock->set_node( current_node );
scene_tree_dock->set_selected(current_node);
object_menu->get_popup()->clear();
@@ -1721,6 +1725,7 @@ void EditorNode::_edit_current() {
} else {
property_editor->edit( current_obj );
+ node_dock->set_node(NULL);
//scene_tree_dock->set_selected(current_node);
//object_menu->get_popup()->clear();
@@ -2760,10 +2765,12 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
if (ischecked) {
file_server->stop();
+ run_native->set_deploy_dumb(false);
//debug_button->set_icon(gui_base->get_icon("FileServer","EditorIcons"));
//debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Enable File Server");
} else {
file_server->start();
+ run_native->set_deploy_dumb(true);
//debug_button->set_icon(gui_base->get_icon("FileServerActive","EditorIcons"));
//debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Disable File Server");
}
@@ -2779,13 +2786,13 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
ScriptEditor::get_singleton()->get_debugger()->set_live_debugging(!ischecked);
} break;
- case RUN_DEPLOY_DUMB_CLIENTS: {
+ /*case RUN_DEPLOY_DUMB_CLIENTS: {
bool ischecked = debug_button->get_popup()->is_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS));
debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_DUMB_CLIENTS),!ischecked);
run_native->set_deploy_dumb(!ischecked);
- } break;
+ } break;*/
case RUN_DEPLOY_REMOTE_DEBUG: {
bool ischecked = debug_button->get_popup()->is_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_REMOTE_DEBUG));
@@ -2809,7 +2816,11 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case RUN_RELOAD_SCRIPTS: {
- ScriptEditor::get_singleton()->get_debugger()->reload_scripts();
+
+ bool ischecked = debug_button->get_popup()->is_item_checked( debug_button->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS));
+ debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS),!ischecked);
+
+ ScriptEditor::get_singleton()->set_live_auto_reload_running_scripts(!ischecked);
} break;
case SETTINGS_UPDATE_ALWAYS: {
@@ -3811,6 +3822,10 @@ ScenesDock *EditorNode::get_scenes_dock() {
return scenes_dock;
}
+SceneTreeDock *EditorNode::get_scene_tree_dock() {
+
+ return scene_tree_dock;
+}
void EditorNode::_instance_request(const String& p_path){
@@ -5200,7 +5215,7 @@ void EditorNode::_bind_methods() {
ADD_SIGNAL( MethodInfo("play_pressed") );
ADD_SIGNAL( MethodInfo("pause_pressed") );
ADD_SIGNAL( MethodInfo("stop_pressed") );
- ADD_SIGNAL( MethodInfo("request_help") );
+ ADD_SIGNAL( MethodInfo("request_help") );
ADD_SIGNAL( MethodInfo("script_add_function_request",PropertyInfo(Variant::OBJECT,"obj"),PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::STRING_ARRAY,"args")) );
ADD_SIGNAL( MethodInfo("resource_saved",PropertyInfo(Variant::OBJECT,"obj")) );
@@ -5779,16 +5794,20 @@ EditorNode::EditorNode() {
debug_button->set_tooltip(TTR("Debug options"));
p=debug_button->get_popup();
- p->add_check_item(TTR("Live Editing"),RUN_LIVE_DEBUG);
- p->add_check_item(TTR("File Server"),RUN_FILE_SERVER);
- p->add_separator();
- p->add_check_item(TTR("Deploy Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG);
- p->add_check_item(TTR("Deploy File Server Clients"),RUN_DEPLOY_DUMB_CLIENTS);
+ p->add_check_item(TTR("Deploy with Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged."));
+ p->add_check_item(TTR("Small Deploy with Network FS"),RUN_FILE_SERVER);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is enabled, export or deploy will produce a minimal executable.\nThe filesystem will be provided from the project by the editor over the network.\nOn Android, deploy will use the USB cable for faster performance. This option speeds up testing for games with a large footprint."));
p->add_separator();
p->add_check_item(TTR("Visible Collision Shapes"),RUN_DEBUG_COLLISONS);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("Collision shapes and raycast nodes (for 2D and 3D) will be visible on the running game if this option is turned on."));
p->add_check_item(TTR("Visible Navigation"),RUN_DEBUG_NAVIGATION);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("Navigation meshes and polygons will be visible on the running game if this option is turned on."));
p->add_separator();
- p->add_item(TTR("Reload Scripts"),RUN_RELOAD_SCRIPTS);
+ p->add_check_item(TTR("Sync Scene Changes"),RUN_LIVE_DEBUG);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
+ p->add_check_item(TTR("Sync Script Changes"),RUN_RELOAD_SCRIPTS);
+ p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
p->connect("item_pressed",this,"_menu_option");
/*
@@ -5913,7 +5932,7 @@ EditorNode::EditorNode() {
scene_tree_dock = memnew( SceneTreeDock(this,scene_root,editor_selection,editor_data) );
scene_tree_dock->set_name(TTR("Scene"));
//top_pallete->add_child(scene_tree_dock);
- dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scene_tree_dock);
+ dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(scene_tree_dock);
#if 0
resources_dock = memnew( ResourcesDock(this) );
resources_dock->set_name("Resources");
@@ -5921,7 +5940,7 @@ EditorNode::EditorNode() {
dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(resources_dock);
//top_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL);
#endif
- dock_slot[DOCK_SLOT_RIGHT_BL]->hide();
+ dock_slot[DOCK_SLOT_LEFT_BR]->hide();
/*Control *editor_spacer = memnew( Control );
editor_spacer->set_custom_minimum_size(Size2(260,200));
editor_spacer->set_v_size_flags(Control::SIZE_EXPAND_FILL);
@@ -5943,7 +5962,7 @@ EditorNode::EditorNode() {
VBoxContainer *prop_editor_base = memnew( VBoxContainer );
prop_editor_base->set_name(TTR("Inspector")); // Properties?
- dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(prop_editor_base);
+ dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(prop_editor_base);
HBoxContainer *prop_editor_hb = memnew( HBoxContainer );
@@ -6055,10 +6074,14 @@ EditorNode::EditorNode() {
property_editor->set_undo_redo(&editor_data.get_undo_redo());
+ node_dock = memnew( NodeDock );
+ //node_dock->set_undoredo(&editor_data.get_undo_redo());
+ dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(node_dock);
+
scenes_dock = memnew( ScenesDock(this) );
scenes_dock->set_name(TTR("FileSystem"));
scenes_dock->set_use_thumbnails(int(EditorSettings::get_singleton()->get("file_dialog/display_mode"))==EditorFileDialog::DISPLAY_THUMBNAILS);
- dock_slot[DOCK_SLOT_LEFT_BR]->add_child(scenes_dock);
+ dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scenes_dock);
//prop_pallete->add_child(scenes_dock);
scenes_dock->connect("open",this,"open_request");
scenes_dock->connect("instance",this,"_instance_request");
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 9ad5a08525..7d9b11ed83 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -49,6 +49,7 @@
#include "tools/editor/call_dialog.h"
#include "tools/editor/reparent_dialog.h"
#include "tools/editor/connections_dialog.h"
+#include "tools/editor/node_dock.h"
#include "tools/editor/settings_config_dialog.h"
#include "tools/editor/groups_editor.h"
#include "tools/editor/editor_data.h"
@@ -169,7 +170,7 @@ private:
RUN_SETTINGS,
RUN_PROJECT_MANAGER,
RUN_FILE_SERVER,
- RUN_DEPLOY_DUMB_CLIENTS,
+ //RUN_DEPLOY_DUMB_CLIENTS,
RUN_LIVE_DEBUG,
RUN_DEBUG_COLLISONS,
RUN_DEBUG_NAVIGATION,
@@ -272,6 +273,7 @@ private:
SceneTreeDock *scene_tree_dock;
//ResourcesDock *resources_dock;
PropertyEditor *property_editor;
+ NodeDock *node_dock;
VBoxContainer *prop_editor_vb;
ScenesDock *scenes_dock;
EditorRunNative *run_native;
@@ -664,6 +666,7 @@ public:
void request_instance_scene(const String &p_path);
ScenesDock *get_scenes_dock();
+ SceneTreeDock *get_scene_tree_dock();
static UndoRedo* get_undo_redo() { return &singleton->editor_data.get_undo_redo(); }
EditorSelection *get_editor_selection() { return editor_selection; }
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 1080509b8f..93b3369aaf 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -493,6 +493,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("scenetree_editor/duplicate_node_name_num_separator",0);
hints["scenetree_editor/duplicate_node_name_num_separator"]=PropertyInfo(Variant::INT,"scenetree_editor/duplicate_node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash");
//set("scenetree_editor/display_old_action_buttons",false);
+ set("scenetree_editor/start_create_dialog_fully_expanded",false);
set("gridmap_editor/pick_distance", 5000.0);
diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp
index 906ee27d1b..898e1e115e 100644
--- a/tools/editor/groups_editor.cpp
+++ b/tools/editor/groups_editor.cpp
@@ -30,6 +30,7 @@
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"
+#include "editor_node.h"
void GroupsEditor::_add_group(const String& p_group) {
@@ -47,8 +48,10 @@ void GroupsEditor::_add_group(const String& p_group) {
undo_redo->add_do_method(node,"add_to_group",name,true);
undo_redo->add_do_method(this,"update_tree");
- undo_redo->add_undo_method(node,"remove_from_group",name,get_text());
+ undo_redo->add_undo_method(node,"remove_from_group",name);
undo_redo->add_undo_method(this,"update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
undo_redo->commit_action();
@@ -72,6 +75,8 @@ void GroupsEditor::_remove_group(Object *p_item, int p_column, int p_id) {
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(node,"add_to_group",name,true);
undo_redo->add_undo_method(this,"update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree
undo_redo->commit_action();
}
@@ -125,14 +130,10 @@ GroupsEditor::GroupsEditor() {
node=NULL;
- set_title(TTR("Group Editor"));
-
- VBoxContainer *vbc = memnew( VBoxContainer );
- add_child(vbc);
- set_child_rect(vbc);
+ VBoxContainer *vbc = this;
HBoxContainer *hbc = memnew( HBoxContainer );
- vbc->add_margin_child(TTR("Group"), hbc);
+ vbc->add_child(hbc);
group_name = memnew( LineEdit );
group_name->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -147,10 +148,9 @@ GroupsEditor::GroupsEditor() {
tree = memnew( Tree );
tree->set_hide_root(true);
tree->set_v_size_flags(SIZE_EXPAND_FILL);
- vbc->add_margin_child(TTR("Node Group(s)"), tree, true);
+ vbc->add_child(tree);
tree->connect("button_pressed",this,"_remove_group");
-
- get_ok()->set_text(TTR("Close"));
+ add_constant_override("separation",3*EDSCALE);
}
GroupsEditor::~GroupsEditor()
diff --git a/tools/editor/groups_editor.h b/tools/editor/groups_editor.h
index 6a897d0cbb..6edb577140 100644
--- a/tools/editor/groups_editor.h
+++ b/tools/editor/groups_editor.h
@@ -39,9 +39,9 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-class GroupsEditor : public AcceptDialog {
+class GroupsEditor : public VBoxContainer {
- OBJ_TYPE(GroupsEditor,AcceptDialog);
+ OBJ_TYPE(GroupsEditor,VBoxContainer);
Node *node;
diff --git a/tools/editor/icons/icon_connection_and_groups.png b/tools/editor/icons/icon_connection_and_groups.png
new file mode 100644
index 0000000000..1fe4a28ed7
--- /dev/null
+++ b/tools/editor/icons/icon_connection_and_groups.png
Binary files differ
diff --git a/tools/editor/icons/icon_down.png b/tools/editor/icons/icon_down.png
index 908e06836b..d2fcdb4c9f 100644
--- a/tools/editor/icons/icon_down.png
+++ b/tools/editor/icons/icon_down.png
Binary files differ
diff --git a/tools/editor/icons/icon_up.png b/tools/editor/icons/icon_up.png
index ec1e090f86..346c4cdba8 100644
--- a/tools/editor/icons/icon_up.png
+++ b/tools/editor/icons/icon_up.png
Binary files differ
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 21e7ee36bb..31b6333975 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -1834,7 +1834,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {
} else if (EditorImportExport::get_singleton()->image_get_export_group(p_path)) {
- Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_2d");
+ Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
@@ -1848,7 +1848,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {
String xt = p_path.extension().to_lower();
if (EditorImportExport::get_singleton()->get_image_formats().has(xt)) { //should check for more I guess?
- Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_2d");
+ Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
diff --git a/tools/editor/node_dock.cpp b/tools/editor/node_dock.cpp
new file mode 100644
index 0000000000..fb5a50e633
--- /dev/null
+++ b/tools/editor/node_dock.cpp
@@ -0,0 +1,104 @@
+#include "node_dock.h"
+#include "editor_node.h"
+
+void NodeDock::show_groups() {
+
+ groups_button->set_pressed(true);
+ connections_button->set_pressed(false);
+ groups->show();
+ connections->hide();
+}
+
+void NodeDock::show_connections(){
+
+ groups_button->set_pressed(false);
+ connections_button->set_pressed(true);
+ groups->hide();
+ connections->show();
+}
+
+
+void NodeDock::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("show_groups"),&NodeDock::show_groups);
+ ObjectTypeDB::bind_method(_MD("show_connections"),&NodeDock::show_connections);
+}
+
+void NodeDock::_notification(int p_what) {
+
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+ connections_button->set_icon(get_icon("Connect","EditorIcons"));
+ groups_button->set_icon(get_icon("Groups","EditorIcons"));
+ }
+}
+
+NodeDock *NodeDock::singleton=NULL;
+
+void NodeDock::set_node(Node* p_node) {
+
+ connections->set_node(p_node);
+ groups->set_current(p_node);
+
+ if (p_node) {
+ if (connections_button->is_pressed())
+ connections->show();
+ else
+ groups->show();
+
+ mode_hb->show();
+ select_a_node->hide();
+ } else {
+ connections->hide();
+ groups->hide();
+ mode_hb->hide();
+ select_a_node->show();
+ }
+}
+
+NodeDock::NodeDock()
+{
+ singleton=this;
+
+ set_name(TTR("Node"));
+ mode_hb = memnew( HBoxContainer );
+ add_child(mode_hb);
+ mode_hb->hide();
+
+
+ connections_button = memnew( ToolButton );
+ connections_button->set_text(TTR("Signals"));
+ connections_button->set_toggle_mode(true);
+ connections_button->set_pressed(true);
+ connections_button->set_h_size_flags(SIZE_EXPAND_FILL);
+ mode_hb->add_child(connections_button);
+ connections_button->connect("pressed",this,"show_connections");
+
+ groups_button = memnew( ToolButton );
+ groups_button->set_text(TTR("Groups"));
+ groups_button->set_toggle_mode(true);
+ groups_button->set_pressed(false);
+ groups_button->set_h_size_flags(SIZE_EXPAND_FILL);
+ mode_hb->add_child(groups_button);
+ groups_button->connect("pressed",this,"show_groups");
+
+ connections = memnew( ConnectionsDock(EditorNode::get_singleton()) );
+ connections->set_undoredo(EditorNode::get_singleton()->get_undo_redo());
+ add_child(connections);
+ connections->set_v_size_flags(SIZE_EXPAND_FILL);
+ connections->hide();
+
+ groups = memnew( GroupsEditor );
+ groups->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
+ add_child(groups);
+ groups->set_v_size_flags(SIZE_EXPAND_FILL);
+ groups->hide();
+
+ select_a_node = memnew( Label );
+ select_a_node->set_text(TTR("Select a Node to edit Signals and Groups."));
+ select_a_node->set_v_size_flags(SIZE_EXPAND_FILL);
+ select_a_node->set_valign(Label::VALIGN_CENTER);
+ select_a_node->set_align(Label::ALIGN_CENTER);
+ select_a_node->set_autowrap(true);
+ add_child(select_a_node);
+
+}
diff --git a/tools/editor/node_dock.h b/tools/editor/node_dock.h
new file mode 100644
index 0000000000..02312b90b5
--- /dev/null
+++ b/tools/editor/node_dock.h
@@ -0,0 +1,38 @@
+#ifndef NODE_DOCK_H
+#define NODE_DOCK_H
+
+#include "connections_dialog.h"
+#include "groups_editor.h"
+
+class NodeDock : public VBoxContainer {
+
+ OBJ_TYPE(NodeDock,VBoxContainer);
+
+ ToolButton *connections_button;
+ ToolButton *groups_button;
+
+ ConnectionsDock *connections;
+ GroupsEditor *groups;
+
+ HBoxContainer *mode_hb;
+
+ Label* select_a_node;
+
+protected:
+
+ static void _bind_methods();
+ void _notification(int p_what);
+
+public:
+
+ static NodeDock *singleton;
+
+ void set_node(Node* p_node);
+
+ void show_groups();
+ void show_connections();
+
+ NodeDock();
+};
+
+#endif // NODE_DOCK_H
diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp
index c333d1d85f..2a6940332c 100644
--- a/tools/editor/plugins/sample_library_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_library_editor_plugin.cpp
@@ -481,7 +481,7 @@ SampleLibraryEditor::SampleLibraryEditor() {
file->connect("files_selected", this,"_file_load_request");
tree->connect("item_edited", this,"_item_edited");
-
+ is_playing = false;
}
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 2453ff3190..39b350eb4e 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -887,8 +887,19 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource>& p_res) {
_update_script_names();
+
+ if (!pending_auto_reload && auto_reload_running_scripts) {
+ call_deferred("_live_auto_reload_running_scripts");
+ pending_auto_reload=true;
+ }
+}
+
+void ScriptEditor::_live_auto_reload_running_scripts() {
+ pending_auto_reload=false;
+ debugger->reload_scripts();
}
+
bool ScriptEditor::_test_script_times_on_disk() {
@@ -2475,6 +2486,11 @@ void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) {
}
}
+void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
+
+ auto_reload_running_scripts=p_enabled;
+}
+
void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action);
@@ -2505,6 +2521,8 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open);
ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back);
+ ObjectTypeDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts);
+
}
ScriptEditor::ScriptEditor(EditorNode *p_editor) {
@@ -2514,6 +2532,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
completion_cache = memnew( EditorScriptCodeCompletionCache );
restoring_layout=false;
waiting_update_names=false;
+ auto_reload_running_scripts=false;
editor=p_editor;
menu_hb = memnew( HBoxContainer );
@@ -2875,6 +2894,8 @@ void ScriptEditorPlugin::edited_scene_changed() {
script_editor->edited_scene_changed();
}
+
+
ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
editor=p_node;
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index cbcfd9a77e..4eb3519059 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -236,6 +236,10 @@ class ScriptEditor : public VBoxContainer {
bool grab_focus_block;
+ bool pending_auto_reload;
+ bool auto_reload_running_scripts;
+ void _live_auto_reload_running_scripts();
+
ScriptEditorQuickOpen *quick_open;
EditorScriptCodeCompletionCache *completion_cache;
@@ -322,6 +326,7 @@ public:
virtual void edited_scene_changed();
ScriptEditorDebugger *get_debugger() { return debugger; }
+ void set_live_auto_reload_running_scripts(bool p_enabled);
ScriptEditor(EditorNode *p_editor);
~ScriptEditor();
@@ -357,6 +362,7 @@ public:
virtual void get_breakpoints(List<String> *p_breakpoints);
+
virtual void edited_scene_changed();
ScriptEditorPlugin(EditorNode *p_node);
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 7f016ead2d..3b02c73189 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -1057,7 +1057,7 @@ void ProjectExportDialog::_group_atlas_preview() {
imd->set_option("atlas",true);
imd->set_option("crop",true);
- Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_atlas");
+ Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
Error err = plugin->import2(dst_file,imd,EditorExportPlatform::IMAGE_COMPRESSION_NONE,true);
if (err) {
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 3e36a30361..9612305a0f 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -260,8 +260,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
//if (!_validate_no_foreign())
// break;
- connect_dialog->popup_centered_ratio();
- connect_dialog->set_node(current);
+ //connect_dialog->popup_centered_ratio();
+ //connect_dialog->set_node(current);
} break;
case TOOL_GROUP: {
@@ -271,8 +271,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
//if (!_validate_no_foreign())
// break;
- groups_editor->set_current(current);
- groups_editor->popup_centered_ratio();
+ //groups_editor->set_current(current);
+ //groups_editor->popup_centered_ratio();
} break;
case TOOL_SCRIPT: {
@@ -1663,8 +1663,8 @@ void SceneTreeDock::_tree_rmb(const Vector2& p_menu_pos) {
if (!EditorNode::get_singleton()->get_edited_scene()) {
menu->clear();
- menu->add_item(TTR("New Scene Root"),TOOL_NEW,KEY_MASK_CMD|KEY_A);
- menu->add_item(TTR("Inherit Scene"),TOOL_INSTANCE);
+ menu->add_icon_item(get_icon("Add","EditorIcons"),TTR("New Scene Root"),TOOL_NEW,KEY_MASK_CMD|KEY_A);
+ menu->add_icon_item(get_icon("Instance","EditorIcons"),TTR("Inherit Scene"),TOOL_INSTANCE);
menu->set_size(Size2(1,1));
menu->set_pos(p_menu_pos);
@@ -1681,31 +1681,31 @@ void SceneTreeDock::_tree_rmb(const Vector2& p_menu_pos) {
if (selection.size()==1) {
- menu->add_item(TTR("Add Child Node"),TOOL_NEW,KEY_MASK_CMD|KEY_A);
- menu->add_item(TTR("Instance Child Scene"),TOOL_INSTANCE);
+ menu->add_icon_item(get_icon("Add","EditorIcons"),TTR("Add Child Node"),TOOL_NEW,KEY_MASK_CMD|KEY_A);
+ menu->add_icon_item(get_icon("Instance","EditorIcons"),TTR("Instance Child Scene"),TOOL_INSTANCE);
menu->add_separator();
- menu->add_item(TTR("Change Type"),TOOL_REPLACE);
+ menu->add_icon_item(get_icon("Reload","EditorIcons"),TTR("Change Type"),TOOL_REPLACE);
+ //menu->add_separator(); moved to their own dock
+ //menu->add_icon_item(get_icon("Groups","EditorIcons"),TTR("Edit Groups"),TOOL_GROUP);
+ //menu->add_icon_item(get_icon("Connect","EditorIcons"),TTR("Edit Connections"),TOOL_CONNECT);
menu->add_separator();
- menu->add_item(TTR("Edit Groups"),TOOL_GROUP);
- menu->add_item(TTR("Edit Connections"),TOOL_CONNECT);
- menu->add_separator();
- menu->add_item(TTR("Add Script"),TOOL_SCRIPT);
+ menu->add_icon_item(get_icon("Script","EditorIcons"),TTR("Add Script"),TOOL_SCRIPT);
menu->add_separator();
}
- menu->add_item(TTR("Move Up"),TOOL_MOVE_UP,KEY_MASK_CMD|KEY_UP);
- menu->add_item(TTR("Move Down"),TOOL_MOVE_DOWN,KEY_MASK_CMD|KEY_DOWN);
- menu->add_item(TTR("Duplicate"),TOOL_DUPLICATE,KEY_MASK_CMD|KEY_D);
- menu->add_item(TTR("Reparent"),TOOL_REPARENT);
+ menu->add_icon_item(get_icon("Up","EditorIcons"),TTR("Move Up"),TOOL_MOVE_UP,KEY_MASK_CMD|KEY_UP);
+ menu->add_icon_item(get_icon("Down","EditorIcons"),TTR("Move Down"),TOOL_MOVE_DOWN,KEY_MASK_CMD|KEY_DOWN);
+ menu->add_icon_item(get_icon("Duplicate","EditorIcons"),TTR("Duplicate"),TOOL_DUPLICATE,KEY_MASK_CMD|KEY_D);
+ menu->add_icon_item(get_icon("Reparent","EditorIcons"),TTR("Reparent"),TOOL_REPARENT);
if (selection.size()==1) {
menu->add_separator();
- menu->add_item(TTR("Merge From Scene"),TOOL_MERGE_FROM_SCENE);
- menu->add_item(TTR("Save Branch as Scene"),TOOL_NEW_SCENE_FROM);
+ menu->add_icon_item(get_icon("Blend","EditorIcons"),TTR("Merge From Scene"),TOOL_MERGE_FROM_SCENE);
+ menu->add_icon_item(get_icon("Save","EditorIcons"),TTR("Save Branch as Scene"),TOOL_NEW_SCENE_FROM);
}
menu->add_separator();
- menu->add_item(TTR("Delete Node(s)"),TOOL_ERASE,KEY_DELETE);
+ menu->add_icon_item(get_icon("Remove","EditorIcons"),TTR("Delete Node(s)"),TOOL_ERASE,KEY_DELETE);
menu->set_size(Size2(1,1));
menu->set_pos(p_menu_pos);
@@ -1820,13 +1820,13 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
add_child(create_dialog);
create_dialog->connect("create",this,"_create");
- groups_editor = memnew( GroupsEditor );
- add_child(groups_editor);
- groups_editor->set_undo_redo(&editor_data->get_undo_redo());
+ //groups_editor = memnew( GroupsEditor );
+ //add_child(groups_editor);
+ //groups_editor->set_undo_redo(&editor_data->get_undo_redo());
- connect_dialog = memnew( ConnectionsDialog(p_editor) );
- add_child(connect_dialog);
- connect_dialog->set_undoredo(&editor_data->get_undo_redo());
+ //connect_dialog = memnew( ConnectionsDialog(p_editor) );
+ //add_child(connect_dialog);
+ //connect_dialog->set_undoredo(&editor_data->get_undo_redo());
script_create_dialog = memnew( ScriptCreateDialog );
add_child(script_create_dialog);
diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h
index a5866944f3..60bec9b4f4 100644
--- a/tools/editor/scene_tree_dock.h
+++ b/tools/editor/scene_tree_dock.h
@@ -86,8 +86,8 @@ class SceneTreeDock : public VBoxContainer {
EditorData *editor_data;
EditorSelection *editor_selection;
- GroupsEditor *groups_editor;
- ConnectionsDialog *connect_dialog;
+ //GroupsEditor *groups_editor;
+ //ConnectionsDialog *connect_dialog;
ScriptCreateDialog *script_create_dialog;
AcceptDialog *accept;
ConfirmationDialog *delete_dialog;
@@ -166,6 +166,7 @@ public:
void perform_node_renames(Node* p_base,List<Pair<NodePath,NodePath> > *p_renames, Map<Ref<Animation>, Set<int> > *r_rem_anims=NULL);
SceneTreeEditor *get_tree_editor() { return scene_tree; }
+
SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelection *p_editor_selection,EditorData &p_editor_data);
};
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index 09a5e7860f..bc12ff23e5 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -216,6 +216,17 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
warning->set_text(config_err);
warning->popup_centered_minsize();
+ } else if (p_id==BUTTON_SIGNALS) {
+
+ item->select(0);
+ NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
+ NodeDock::singleton->show_connections();
+
+ } else if (p_id==BUTTON_GROUPS) {
+
+ item->select(0);
+ NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
+ NodeDock::singleton->show_groups();
}
}
@@ -285,10 +296,25 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
}
}
- String warning = p_node->get_configuration_warning();
- if (warning!=String()) {
- item->add_button(0,get_icon("NodeWarning","EditorIcons"),BUTTON_WARNING);
+
+ if (can_rename) { //should be can edit..
+
+ String warning = p_node->get_configuration_warning();
+ if (warning!=String()) {
+ item->add_button(0,get_icon("NodeWarning","EditorIcons"),BUTTON_WARNING);
+ }
+
+ bool has_connections = p_node->has_persistent_signal_connections();
+ bool has_groups = p_node->has_persistent_groups();
+
+ if (has_connections && has_groups) {
+ item->add_button(0,get_icon("ConnectionAndGroups","EditorIcons"),BUTTON_SIGNALS);
+ } else if (has_connections) {
+ item->add_button(0,get_icon("Connect","EditorIcons"),BUTTON_SIGNALS);
+ } else if (has_groups) {
+ item->add_button(0,get_icon("Groups","EditorIcons"),BUTTON_GROUPS);
+ }
}
if (p_node==get_scene_node() && p_node->get_scene_inherited_state().is_valid()) {
@@ -999,6 +1025,7 @@ void SceneTreeEditor::_bind_methods() {
ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw);
ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw);
+ ObjectTypeDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree);
ADD_SIGNAL( MethodInfo("node_selected") );
ADD_SIGNAL( MethodInfo("node_renamed") );
diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h
index 94be75ea8e..ae0afa32ec 100644
--- a/tools/editor/scene_tree_editor.h
+++ b/tools/editor/scene_tree_editor.h
@@ -49,7 +49,9 @@ class SceneTreeEditor : public Control {
BUTTON_SCRIPT=2,
BUTTON_LOCK=3,
BUTTON_GROUP=4,
- BUTTON_WARNING=5
+ BUTTON_WARNING=5,
+ BUTTON_SIGNALS=6,
+ BUTTON_GROUPS=7,
};
enum {