summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-07 19:22:33 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-07 19:22:33 -0300
commitb77200728e7f2b2dd446a9717c83a20c9aac0ce4 (patch)
treed5fd8da846cb1f86b68ecb6a1e0e4da5cae1a9dd /tools/editor
parent6671c6bdc78864bbe1d27c508ec9528f3b683ca2 (diff)
-Added yield nodes to visual script
-Added input selection nodes to visual script -Added script create icon for those who miss it, will only appear when it can be used.
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/scene_tree_dock.cpp17
-rw-r--r--tools/editor/scene_tree_dock.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index c4718a19a1..94587456f1 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -683,6 +683,8 @@ void SceneTreeDock::_notification(int p_what) {
}
button_add->set_icon(get_icon("Add","EditorIcons"));
button_instance->set_icon(get_icon("Instance","EditorIcons"));
+ button_create_script->set_icon(get_icon("Script","EditorIcons"));
+
filter_icon->set_texture(get_icon("Zoom","EditorIcons"));
@@ -1302,11 +1304,18 @@ void SceneTreeDock::_delete_confirm() {
void SceneTreeDock::_selection_changed() {
- if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size()>1) {
+ int selection_size = EditorNode::get_singleton()->get_editor_selection()->get_selection().size();
+ if (selection_size>1) {
//automatically turn on multi-edit
_tool_selected(TOOL_MULTI_EDIT);
}
+ if (selection_size==1 && EditorNode::get_singleton()->get_editor_selection()->get_selection().front()->key()->get_script().is_null()) {
+ button_create_script->show();
+ } else {
+ button_create_script->hide();
+ }
+
//tool_buttons[TOOL_MULTI_EDIT]->set_disabled(EditorNode::get_singleton()->get_editor_selection()->get_selection().size()<2);
}
@@ -1899,6 +1908,12 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
filter->connect("text_changed",this,"_filter_changed");
+ tb = memnew( ToolButton );
+ tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_SCRIPT, false));
+ tb->set_tooltip(TTR("Create a new script for the selected node."));
+ tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_script"));
+ filter_hbc->add_child(tb);
+ button_create_script=tb;
scene_tree = memnew( SceneTreeEditor(false,true,true ));
diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h
index bcf7ff7173..af612cbc77 100644
--- a/tools/editor/scene_tree_dock.h
+++ b/tools/editor/scene_tree_dock.h
@@ -78,6 +78,7 @@ class SceneTreeDock : public VBoxContainer {
ToolButton *button_add;
ToolButton *button_instance;
+ ToolButton *button_create_script;
SceneTreeEditor *scene_tree;