summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/animation_editor.cpp4
-rw-r--r--tools/editor/connections_dialog.cpp7
-rw-r--r--tools/editor/editor_data.cpp10
-rw-r--r--tools/editor/editor_data.h1
-rw-r--r--tools/editor/editor_node.cpp25
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp59
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp4
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sprite_region_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp19
-rw-r--r--tools/editor/project_settings.cpp77
-rw-r--r--tools/editor/project_settings.h9
-rw-r--r--tools/editor/property_editor.cpp202
-rw-r--r--tools/editor/property_editor.h18
-rw-r--r--tools/editor/scene_tree_editor.cpp3
-rw-r--r--tools/editor/script_editor_debugger.cpp4
-rw-r--r--tools/editor/settings_config_dialog.cpp46
-rw-r--r--tools/editor/settings_config_dialog.h2
19 files changed, 361 insertions, 135 deletions
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp
index fbe50d6d96..cdce910665 100644
--- a/tools/editor/animation_editor.cpp
+++ b/tools/editor/animation_editor.cpp
@@ -2814,6 +2814,8 @@ void AnimationKeyEditor::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
+ key_editor->edit(key_edit);
+
zoomicon->set_texture( get_icon("Zoom","EditorIcons") );
menu_add_track->set_icon(get_icon("AddTrack","EditorIcons"));
@@ -3924,7 +3926,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
key_edit = memnew( AnimationKeyEdit );
key_edit->undo_redo=undo_redo;
//key_edit->ke_dialog=key_edit_dialog;
- key_editor->edit(key_edit);
+
type_menu = memnew( PopupMenu );
add_child(type_menu);
for(int i=0;i<Variant::VARIANT_MAX;i++)
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index e94bc78f5d..1e530b21c2 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -96,7 +96,11 @@ void ConnectDialog::_notification(int p_what) {
RID ci = get_canvas_item();
get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
- }
+ }
+
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+ bind_editor->edit(cdbinds);
+ }
}
void ConnectDialog::_tree_node_selected() {
@@ -456,7 +460,6 @@ ConnectDialog::ConnectDialog() {
set_as_toplevel(true);
cdbinds = memnew( ConnectDialogBinds );
- bind_editor->edit(cdbinds);
error = memnew( ConfirmationDialog );
add_child(error);
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp
index 5e613c658b..c872b1c3ca 100644
--- a/tools/editor/editor_data.cpp
+++ b/tools/editor/editor_data.cpp
@@ -635,6 +635,16 @@ String EditorData::get_scene_type(int p_idx) const {
return edited_scene[p_idx].root->get_type();
}
+void EditorData::move_edited_scene_to_index(int p_idx) {
+
+ ERR_FAIL_INDEX(current_edited_scene,edited_scene.size());
+ ERR_FAIL_INDEX(p_idx,edited_scene.size());
+
+ EditedScene es=edited_scene[current_edited_scene];
+ edited_scene.remove(current_edited_scene);
+ edited_scene.insert(p_idx,es);
+ current_edited_scene=p_idx;
+}
Ref<Script> EditorData::get_scene_root_script(int p_idx) const {
diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h
index 7dafeeea04..fcc8ccef06 100644
--- a/tools/editor/editor_data.h
+++ b/tools/editor/editor_data.h
@@ -196,6 +196,7 @@ public:
void set_edited_scene_live_edit_root(const NodePath& p_root);
NodePath get_edited_scene_live_edit_root();
bool check_and_update_scene(int p_idx);
+ void move_edited_scene_to_index(int p_idx);
void set_plugin_window_layout(Ref<ConfigFile> p_layout);
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 8d36134605..79f5e66401 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -2367,7 +2367,14 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
if (!scene)
break;
-
+
+ String filename = scene->get_filename();
+
+ if (filename==String()) {
+ show_warning("Can't reload a scene that was never saved..");
+ break;
+ }
+
if (unsaved_cache && !p_confirmed) {
confirmation->get_ok()->set_text("Revert");
confirmation->set_text("This action cannot be undone. Revert anyway?");
@@ -2375,7 +2382,13 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
break;
}
- Error err = load_scene(scene->get_filename());
+
+ int cur_idx = editor_data.get_edited_scene();
+ _remove_edited_scene();
+ Error err = load_scene(filename);
+ editor_data.move_edited_scene_to_index(cur_idx);
+ get_undo_redo()->clear_history();
+ scene_tabs->set_current_tab(cur_idx);
} break;
@@ -4520,14 +4533,14 @@ void EditorNode::_scene_tab_changed(int p_tab) {
editor_data.get_undo_redo().create_action("Switch Scene Tab");
editor_data.get_undo_redo().add_do_method(this,"set_current_version",unsaved?saved_version:0);
editor_data.get_undo_redo().add_do_method(this,"set_current_scene",p_tab);
- editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab);
- editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab);
+ //editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab);
+ //editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab);
editor_data.get_undo_redo().add_do_method(this,"set_current_version",next_scene_version==0?editor_data.get_undo_redo().get_version()+1:next_scene_version);
editor_data.get_undo_redo().add_undo_method(this,"set_current_version",next_scene_version);
editor_data.get_undo_redo().add_undo_method(this,"set_current_scene",editor_data.get_edited_scene());
- editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene());
- editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene());
+ //editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene());
+ //editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene());
editor_data.get_undo_redo().add_undo_method(this,"set_current_version",saved_version);
editor_data.get_undo_redo().commit_action();
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index b56140b32d..43b4276d45 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -93,7 +93,7 @@ void AnimationPlayerEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
- editor->connect("hide_animation_player_editors",this,"_hide_anim_editors");
+// editor->connect("hide_animation_player_editors",this,"_hide_anim_editors");
add_anim->set_icon( get_icon("New","EditorIcons") );
rename_anim->set_icon( get_icon("Rename","EditorIcons") );
duplicate_anim->set_icon( get_icon("Duplicate","EditorIcons") );
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index a259fa0fcc..0afea26957 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -603,6 +603,9 @@ bool CanvasItemEditor::_select(CanvasItem *item, Point2 p_click_pos, bool p_appe
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -643,6 +646,9 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -702,6 +708,9 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
@@ -731,6 +740,9 @@ int CanvasItemEditor::get_item_count() {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
ic++;
};
@@ -749,6 +761,8 @@ CanvasItem *CanvasItemEditor::get_single_item() {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
if (single_item)
return NULL; //morethan one
@@ -1102,6 +1116,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
@@ -1194,6 +1211,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -1400,6 +1420,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -1507,6 +1530,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -1881,6 +1907,8 @@ void CanvasItemEditor::_viewport_draw() {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se)
continue;
@@ -2104,6 +2132,9 @@ void CanvasItemEditor::_notification(int p_what) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
if (canvas_item->cast_to<Control>())
has_control=true;
else
@@ -2509,6 +2540,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
canvas_item->set_meta("_edit_lock_",true);
emit_signal("item_lock_status_changed");
}
@@ -2524,6 +2558,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
canvas_item->set_meta("_edit_lock_",Variant());
emit_signal("item_lock_status_changed");
@@ -2542,6 +2579,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
canvas_item->set_meta("_edit_group_",true);
emit_signal("item_group_status_changed");
}
@@ -2557,6 +2597,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
canvas_item->set_meta("_edit_group_",Variant());
emit_signal("item_group_status_changed");
}
@@ -2575,6 +2618,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
Control *c = canvas_item->cast_to<Control>();
if (!c)
@@ -2693,6 +2739,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
if (canvas_item->cast_to<Node2D>()) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
@@ -2803,6 +2852,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
if (canvas_item->cast_to<Node2D>()) {
@@ -2853,6 +2904,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
if (canvas_item->cast_to<Node2D>()) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
@@ -2887,6 +2941,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item) continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
+
// counting invisible items, for now
//if (!canvas_item->is_visible()) continue;
@@ -2979,6 +3036,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible())
continue;
+ if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
+ continue;
canvas_item->set_meta("_edit_ik_",true);
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 76e4af5f16..34d7e89760 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1018,8 +1018,10 @@ void ScriptEditor::_menu_option(int p_option) {
script_create_dialog->popup_centered(Size2(300, 300));
} break;
case FILE_SAVE: {
- if (!_test_script_times_on_disk())
+
+ if (_test_script_times_on_disk())
return;
+
editor->save_resource( current->get_edited_script() );
} break;
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 65b5365b50..18d8f5efc0 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -234,7 +234,7 @@ void ShaderEditor::_tab_changed(int p_which) {
ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>();
- if (shader_editor)
+ if (shader_editor && is_inside_tree())
shader_editor->get_text_edit()->grab_focus();
ensure_select_current();
diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp
index 725de19dd7..8dfa8a60a6 100644
--- a/tools/editor/plugins/sprite_region_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp
@@ -367,7 +367,7 @@ void SpriteRegionEditor::edit(Node *p_sprite)
{
if (p_sprite) {
node=p_sprite->cast_to<Sprite>();
- node->connect("exit_tree",this,"_node_removed",varray(),CONNECT_ONESHOT);
+ node->connect("exit_tree",this,"_node_removed",varray(p_sprite),CONNECT_ONESHOT);
} else {
if (node)
node->disconnect("exit_tree",this,"_node_removed");
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 29326a2222..acacd37f66 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -533,6 +533,8 @@ void TileMapEditor::_canvas_draw() {
if (node->get_half_offset()!=TileMap::HALF_OFFSET_X) {
+ int max_lines=2000; //avoid crash if size too smal
+
for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) {
Vector2 from = xform.xform(node->map_to_world(Vector2(i,si.pos.y)));
@@ -540,10 +542,12 @@ void TileMapEditor::_canvas_draw() {
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1);
-
+ if (max_lines--==0)
+ break;
}
} else {
+ int max_lines=10000; //avoid crash if size too smal
for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) {
@@ -558,11 +562,17 @@ void TileMapEditor::_canvas_draw() {
Vector2 to = xform.xform(node->map_to_world(Vector2(i,j+1),true)+ofs);
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1);
+
+ if (max_lines--==0)
+ break;
+
}
}
}
+ int max_lines=10000; //avoid crash if size too smal
+
if (node->get_half_offset()!=TileMap::HALF_OFFSET_Y) {
for(int i=(si.pos.y)-1;i<=(si.pos.y+si.size.y);i++) {
@@ -573,6 +583,9 @@ void TileMapEditor::_canvas_draw() {
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1);
+ if (max_lines--==0)
+ break;
+
}
} else {
@@ -590,6 +603,10 @@ void TileMapEditor::_canvas_draw() {
Vector2 to = xform.xform(node->map_to_world(Vector2(j+1,i),true)+ofs);
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1);
+
+ if (max_lines--==0)
+ break;
+
}
}
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index 26e8919375..6c5e18ec9a 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -60,6 +60,9 @@ void ProjectSettings::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
+ search_button->set_icon(get_icon("Zoom","EditorIcons"));
+ clear_button->set_icon(get_icon("Close","EditorIcons"));
+
translation_list->connect("button_pressed",this,"_translation_delete");
_update_actions();
popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),"Key",InputEvent::KEY);
@@ -90,9 +93,7 @@ void ProjectSettings::_notification(int p_what) {
autoload_file_open->add_filter("*."+E->get());
}
- } else if (p_what==NOTIFICATION_POST_POPUP) {
- globals_editor->clear_search_box();
}
}
@@ -1338,6 +1339,32 @@ void ProjectSettings::_update_autoload() {
}
+void ProjectSettings::_toggle_search_bar(bool p_pressed) {
+
+ globals_editor->get_property_editor()->set_use_filter(p_pressed);
+
+ if (p_pressed) {
+
+ search_bar->show();
+ add_prop_bar->hide();
+ search_box->grab_focus();
+ search_box->select_all();
+ } else {
+
+ search_bar->hide();
+ add_prop_bar->show();
+ }
+}
+
+void ProjectSettings::_clear_search_box() {
+
+ if (search_box->get_text()=="")
+ return;
+
+ search_box->clear();
+ globals_editor->get_property_editor()->update_tree();
+}
+
void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected);
@@ -1380,6 +1407,9 @@ void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete);
ObjectTypeDB::bind_method(_MD("_autoload_edited"),&ProjectSettings::_autoload_edited);
+ ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
+ ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
+
}
ProjectSettings::ProjectSettings(EditorData *p_data) {
@@ -1410,50 +1440,77 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
props_base->add_child(hbc);
+ search_button = memnew( ToolButton );
+ search_button->set_toggle_mode(true);
+ search_button->set_pressed(false);
+ search_button->set_text("Search");
+ hbc->add_child(search_button);
+ search_button->connect("toggled",this,"_toggle_search_bar");
+
+ hbc->add_child( memnew( VSeparator ) );
+
+ add_prop_bar = memnew( HBoxContainer );
+ add_prop_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ hbc->add_child(add_prop_bar);
+
Label *l = memnew( Label );
- hbc->add_child(l);
+ add_prop_bar->add_child(l);
l->set_text("Category:");
category = memnew( LineEdit );
category->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(category);
+ add_prop_bar->add_child(category);
category->connect("text_entered",this,"_item_adds");
l = memnew( Label );
- hbc->add_child(l);
+ add_prop_bar->add_child(l);
l->set_text("Property:");
property = memnew( LineEdit );
property->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(property);
+ add_prop_bar->add_child(property);
property->connect("text_entered",this,"_item_adds");
l = memnew( Label );
- hbc->add_child(l);
+ add_prop_bar->add_child(l);
l->set_text("Type:");
type = memnew( OptionButton );
type->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(type);
+ add_prop_bar->add_child(type);
type->add_item("bool");
type->add_item("int");
type->add_item("float");
type->add_item("string");
Button *add = memnew( Button );
- hbc->add_child(add);
+ add_prop_bar->add_child(add);
add->set_text("Add");
add->connect("pressed",this,"_item_add");
Button *del = memnew( Button );
- hbc->add_child(del);
+ add_prop_bar->add_child(del);
del->set_text("Del");
del->connect("pressed",this,"_item_del");
+ search_bar = memnew( HBoxContainer );
+ search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ hbc->add_child(search_bar);
+ search_bar->hide();
+
+ search_box = memnew( LineEdit );
+ search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ search_bar->add_child(search_box);
+
+ clear_button = memnew( ToolButton );
+ search_bar->add_child(clear_button);
+ clear_button->connect("pressed",this,"_clear_search_box");
+
globals_editor = memnew( SectionedPropertyEditor );
props_base->add_child(globals_editor);
//globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ globals_editor->get_property_editor()->register_text_enter(search_box);
globals_editor->get_property_editor()->set_capitalize_paths(false);
globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected",this,"_item_selected");
globals_editor->get_property_editor()->connect("property_toggled",this,"_item_checked",varray(),CONNECT_DEFERRED);
diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h
index cbf24e7bfd..b689340fdf 100644
--- a/tools/editor/project_settings.h
+++ b/tools/editor/project_settings.h
@@ -48,6 +48,12 @@ class ProjectSettings : public AcceptDialog {
UndoRedo *undo_redo;
SectionedPropertyEditor *globals_editor;
+ HBoxContainer *search_bar;
+ ToolButton *search_button;
+ LineEdit *search_box;
+ ToolButton *clear_button;
+
+ HBoxContainer *add_prop_bar;
ConfirmationDialog *message;
LineEdit *category;
LineEdit *property;
@@ -136,6 +142,9 @@ class ProjectSettings : public AcceptDialog {
void _translation_res_option_changed();
void _translation_res_option_delete(Object *p_item,int p_column, int p_button);
+ void _toggle_search_bar(bool p_pressed);
+ void _clear_search_box();
+
ProjectSettings();
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 16e4d4ec6c..4b1b93ea6e 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "property_editor.h"
+#include "scene/gui/label.h"
#include "io/resource_loader.h"
#include "io/image_loader.h"
#include "object_type_db.h"
@@ -34,6 +35,7 @@
#include "globals.h"
#include "scene/resources/font.h"
#include "pair.h"
+#include "scene/scene_string_names.h"
#include "editor_settings.h"
#include "editor_import_export.h"
#include "editor_node.h"
@@ -41,8 +43,6 @@
#include "array_property_edit.h"
#include "editor_help.h"
#include "scene/resources/packed_scene.h"
-#include "os/input.h"
-#include "os/keyboard.h"
void CustomPropertyEditor::_notification(int p_what) {
@@ -52,16 +52,11 @@ void CustomPropertyEditor::_notification(int p_what) {
RID ci = get_canvas_item();
get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
+ /*
+ if (v.get_type()==Variant::COLOR) {
- } else if (p_what==NOTIFICATION_POPUP_HIDE) {
-
- if (!text_changed)
- return;
-
- if (Input::get_singleton()->is_key_pressed(KEY_ESCAPE))
- return;
-
- _modified(String());
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( 10,10,60, get_size().height-20 ), v );
+ }*/
}
}
@@ -240,8 +235,6 @@ String CustomPropertyEditor::get_name() const {
bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Type p_type, const Variant& p_variant,int p_hint,String p_hint_text) {
- text_changed=false;
-
owner=p_owner;
updating=true;
name=p_name;
@@ -261,6 +254,8 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
value_editor[i]->hide();
value_label[i]->hide();
+ if (i<4)
+ scroll[i]->hide();
}
for (int i=0;i<MAX_ACTION_BUTTONS;i++) {
@@ -596,10 +591,44 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
} break;
case Variant::COLOR: {
+
color_picker->show();
color_picker->set_edit_alpha(hint!=PROPERTY_HINT_COLOR_NO_ALPHA);
color_picker->set_color(v);
set_size( Size2(300, color_picker->get_combined_minimum_size().height+10));
+ /*
+ int ofs=80;
+ int m=10;
+ int h=20;
+ Color c=v;
+ float values[4]={c.r,c.g,c.b,c.a};
+ for (int i=0;i<4;i++) {
+ int y=m+i*h;
+
+ value_editor[i]->show();
+ value_label[i]->show();
+ value_label[i]->set_pos(Point2(ofs,y));
+ scroll[i]->set_min(0);
+ scroll[i]->set_max(1.0);
+ scroll[i]->set_page(0);
+ scroll[i]->set_pos(Point2(ofs+15,y+Math::floor((h-scroll[i]->get_minimum_size().height)/2.0)));
+ scroll[i]->set_val(values[i]);
+ scroll[i]->set_size(Size2(120,1));
+ scroll[i]->show();
+ value_editor[i]->set_pos(Point2(ofs+140,y));
+ value_editor[i]->set_size(Size2(40,h));
+ value_editor[i]->set_text( String::num(values[i],2 ));
+
+ }
+
+ value_label[0]->set_text("R");
+ value_label[1]->set_text("G");
+ value_label[2]->set_text("B");
+ value_label[3]->set_text("A");
+
+ Size2 new_size = value_editor[3]->get_pos() + value_editor[3]->get_size() + Point2(10,10);
+ set_size( new_size );
+ */
} break;
case Variant::IMAGE: {
@@ -1155,8 +1184,37 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
} break;
default: {};
}
+
+}
+
+void CustomPropertyEditor::_scroll_modified(double p_value) {
+
+ if (updating)
+ return;
+ /*
+ switch(type) {
+
+ case Variant::COLOR: {
+
+ for (int i=0;i<4;i++) {
+
+ value_editor[i]->set_text( String::num(scroll[i]->get_val(),2) );
+ }
+ Color c;
+ c.r=scroll[0]->get_val();
+ c.g=scroll[1]->get_val();
+ c.b=scroll[2]->get_val();
+ c.a=scroll[3]->get_val();
+ v=c;
+ update();
+ emit_signal("variant_changed");
+ } break;
+ default: {}
+ }
+ */
}
+
void CustomPropertyEditor::_drag_easing(const InputEvent& p_ev) {
@@ -1251,7 +1309,6 @@ void CustomPropertyEditor::_modified(String p_string) {
if (updating)
return;
updating=true;
- text_changed=false;
switch(type) {
case Variant::REAL: {
@@ -1378,8 +1435,20 @@ void CustomPropertyEditor::_modified(String p_string) {
} break;
case Variant::COLOR: {
+ /*
+ for (int i=0;i<4;i++) {
-
+ scroll[i]->set_val( value_editor[i]->get_text().to_double() );
+ }
+ Color c;
+ c.r=value_editor[0]->get_text().to_double();
+ c.g=value_editor[1]->get_text().to_double();
+ c.b=value_editor[2]->get_text().to_double();
+ c.a=value_editor[3]->get_text().to_double();
+ v=c;
+ update();
+ emit_signal("variant_changed");
+ */
} break;
case Variant::IMAGE: {
@@ -1532,11 +1601,9 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns,int
value_label[i]->hide();
}
}
-}
-void CustomPropertyEditor::_text_editor_changed(String p_text) {
- text_changed=true;
+
}
void CustomPropertyEditor::_bind_methods() {
@@ -1545,6 +1612,7 @@ void CustomPropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit);
ObjectTypeDB::bind_method("_modified",&CustomPropertyEditor::_modified);
ObjectTypeDB::bind_method("_range_modified", &CustomPropertyEditor::_range_modified);
+ ObjectTypeDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified);
ObjectTypeDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed);
ObjectTypeDB::bind_method("_file_selected",&CustomPropertyEditor::_file_selected);
ObjectTypeDB::bind_method("_type_create_selected",&CustomPropertyEditor::_type_create_selected);
@@ -1552,9 +1620,9 @@ void CustomPropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method("_color_changed",&CustomPropertyEditor::_color_changed);
ObjectTypeDB::bind_method("_draw_easing",&CustomPropertyEditor::_draw_easing);
ObjectTypeDB::bind_method("_drag_easing",&CustomPropertyEditor::_drag_easing);
- ObjectTypeDB::bind_method("_text_edit_changed",&CustomPropertyEditor::_text_edit_changed);
- ObjectTypeDB::bind_method("_menu_option",&CustomPropertyEditor::_menu_option);
- ObjectTypeDB::bind_method("_text_editor_changed",&CustomPropertyEditor::_text_editor_changed);
+ ObjectTypeDB::bind_method( "_text_edit_changed",&CustomPropertyEditor::_text_edit_changed);
+ ObjectTypeDB::bind_method( "_menu_option",&CustomPropertyEditor::_menu_option);
+
ADD_SIGNAL( MethodInfo("variant_changed") );
ADD_SIGNAL( MethodInfo("resource_edit_request") );
@@ -1565,8 +1633,6 @@ CustomPropertyEditor::CustomPropertyEditor() {
read_only=false;
updating=false;
- text_changed=false;
-
for (int i=0;i<MAX_VALUE_EDITORS;i++) {
value_editor[i]=memnew( LineEdit );
@@ -1576,11 +1642,22 @@ CustomPropertyEditor::CustomPropertyEditor() {
value_editor[i]->hide();
value_label[i]->hide();
value_editor[i]->connect("text_entered", this,"_modified");
- value_editor[i]->connect("text_changed", this, "_text_editor_changed");
value_editor[i]->connect("focus_enter", this, "_focus_enter");
value_editor[i]->connect("focus_exit", this, "_focus_exit");
}
+ for(int i=0;i<4;i++) {
+
+ scroll[i] = memnew( HScrollBar );
+ scroll[i]->hide();
+ scroll[i]->set_min(0);
+ scroll[i]->set_max(1.0);
+ scroll[i]->set_step(0.01);
+ add_child(scroll[i]);
+ scroll[i]->connect("value_changed", this,"_scroll_modified");
+
+ }
+
for(int i=0;i<20;i++) {
checks20[i]=memnew( Button );
checks20[i]->set_toggle_mode(true);
@@ -1652,6 +1729,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
easing_draw->hide();
easing_draw->connect("draw",this,"_draw_easing");
easing_draw->connect("input_event",this,"_drag_easing");
+ //easing_draw->emit_signal(SceneStringNames::get_singleton()->input_event,InputEvent());
easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE);
menu = memnew(PopupMenu);
@@ -1967,7 +2045,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
if (img.empty())
p_item->set_text(1,"[Image (empty)]");
else
- p_item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"]");
+ p_item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"-"+String(Image::get_format_name(img.get_format()))+"]");
} break;
case Variant::NODE_PATH: {
@@ -2929,7 +3007,7 @@ void PropertyEditor::update_tree() {
if (img.empty())
item->set_text(1,"[Image (empty)]");
else
- item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"]");
+ item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"-"+String(Image::get_format_name(img.get_format()))+"]");
if (show_type_icons)
item->set_icon( 0,get_icon("Image","EditorIcons") );
@@ -3021,7 +3099,7 @@ void PropertyEditor::update_tree() {
int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
if (_get_instanced_node_original_property(p.name,vorig) || usage) {
Variant v = obj->get(p.name);
-
+
if (_is_property_different(v,vorig,usage)) {
//print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")");
@@ -3699,10 +3777,6 @@ class SectionedPropertyEditorFilter : public Object {
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
PropertyInfo pi=E->get();
-
- if (section=="")
- p_list->push_back(pi);
-
int sp = pi.name.find("/");
if (sp!=-1) {
String ss = pi.name.substr(0,sp);
@@ -3712,7 +3786,7 @@ class SectionedPropertyEditorFilter : public Object {
p_list->push_back(pi);
}
} else {
- if (section=="global")
+ if (section=="")
p_list->push_back(pi);
}
}
@@ -3737,18 +3811,10 @@ public:
};
-void SectionedPropertyEditor::_notification(int p_what) {
-
- if (p_what==NOTIFICATION_ENTER_TREE) {
-
- clear_button->set_icon(get_icon("Close", "EditorIcons"));
- }
-}
void SectionedPropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected);
- ObjectTypeDB::bind_method("_clear_search_box",&SectionedPropertyEditor::clear_search_box);
}
void SectionedPropertyEditor::_section_selected(int p_which) {
@@ -3756,30 +3822,9 @@ void SectionedPropertyEditor::_section_selected(int p_which) {
filter->set_section( sections->get_item_metadata(p_which) );
}
-void SectionedPropertyEditor::clear_search_box() {
-
- if (search_box->get_text().strip_edges()=="")
- return;
-
- search_box->clear();
- editor->update_tree();
-}
-
-
String SectionedPropertyEditor::get_current_section() const {
- String section = sections->get_item_metadata( sections->get_current() );
-
- if (section=="") {
- String name = editor->get_selected_path();
-
- int sp = name.find("/");
- if (sp!=-1)
- section = name.substr(0, sp);
-
- }
-
- return section;
+ return sections->get_item_metadata( sections->get_current() );
}
String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
@@ -3799,20 +3844,11 @@ void SectionedPropertyEditor::edit(Object* p_object) {
sections->clear();
Set<String> existing_sections;
-
- existing_sections.insert("");
- sections->add_item("All");
- sections->set_item_metadata(0, "");
-
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
PropertyInfo pi=E->get();
-
if (pi.usage&PROPERTY_USAGE_CATEGORY)
continue;
- if ( !(pi.usage&PROPERTY_USAGE_EDITOR) )
- continue;
-
if (pi.name.find(":")!=-1 || pi.name=="script/script")
continue;
int sp = pi.name.find("/");
@@ -3825,10 +3861,10 @@ void SectionedPropertyEditor::edit(Object* p_object) {
}
} else {
- if (!existing_sections.has("global")) {
- existing_sections.insert("global");
+ if (!existing_sections.has("")) {
+ existing_sections.insert("");
sections->add_item("Global");
- sections->set_item_metadata(sections->get_item_count()-1,"global");
+ sections->set_item_metadata(sections->get_item_count()-1,"");
}
}
@@ -3853,8 +3889,6 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() {
SectionedPropertyEditor::SectionedPropertyEditor() {
- add_constant_override("separation", 8);
-
VBoxContainer *left_vb = memnew( VBoxContainer);
left_vb->set_custom_minimum_size(Size2(160,0));
add_child(left_vb);
@@ -3869,26 +3903,12 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
add_child(right_vb);
filter = memnew( SectionedPropertyEditorFilter );
-
- HBoxContainer *hbc = memnew( HBoxContainer );
- right_vb->add_margin_child("Search:",hbc);
-
- search_box = memnew( LineEdit );
- search_box->set_h_size_flags(SIZE_EXPAND_FILL);
- hbc->add_child(search_box);
-
- clear_button = memnew( ToolButton );
- hbc->add_child(clear_button);
- clear_button->connect("pressed", this, "_clear_search_box");
-
editor = memnew( PropertyEditor );
- editor->register_text_enter(search_box);
- editor->set_use_filter(true);
editor->set_v_size_flags(SIZE_EXPAND_FILL);
right_vb->add_margin_child("Properties:",editor,true);
editor->get_scene_tree()->set_column_titles_visible(false);
- add_child(editor);
+
editor->hide_top_label();
diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h
index 2e533a0c64..63ad090901 100644
--- a/tools/editor/property_editor.h
+++ b/tools/editor/property_editor.h
@@ -38,6 +38,8 @@
#include "scene/gui/menu_button.h"
#include "scene/gui/texture_frame.h"
#include "scene/gui/text_edit.h"
+#include "scene/gui/check_button.h"
+#include "scene/gui/split_container.h"
#include "scene_tree_editor.h"
/**
@@ -83,6 +85,7 @@ class CustomPropertyEditor : public Popup {
String hint_text;
LineEdit *value_editor[MAX_VALUE_EDITORS];
Label *value_label[MAX_VALUE_EDITORS];
+ HScrollBar *scroll[4];
Button *action_buttons[MAX_ACTION_BUTTONS];
MenuButton *type_button;
Vector<String> inheritors_array;
@@ -103,6 +106,7 @@ class CustomPropertyEditor : public Popup {
void _text_edit_changed();
void _file_selected(String p_file);
+ void _scroll_modified(double p_value);
void _modified(String p_string);
void _range_modified(double p_value);
void _focus_enter();
@@ -122,10 +126,6 @@ class CustomPropertyEditor : public Popup {
void config_value_editors(int p_amount, int p_columns,int p_label_w,const List<String>& p_strings);
void config_action_buttons(const List<String>& p_strings);
- bool text_changed;
-
- void _text_editor_changed(String p_text);
-
protected:
void _notification(int p_what);
@@ -259,16 +259,12 @@ class SectionedPropertyEditor : public HBoxContainer {
OBJ_TYPE(SectionedPropertyEditor,HBoxContainer);
ItemList *sections;
SectionedPropertyEditorFilter *filter;
- LineEdit *search_box;
- ToolButton *clear_button;
PropertyEditor *editor;
- void _section_selected(int p_which);
-
-protected:
- void _notification(int p_what);
static void _bind_methods();
+ void _section_selected(int p_which);
+
public:
PropertyEditor *get_property_editor();
@@ -276,8 +272,6 @@ public:
String get_full_item_path(const String& p_item);
String get_current_section() const;
- void clear_search_box();
-
SectionedPropertyEditor();
~SectionedPropertyEditor();
};
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index ea7d760133..0260457c81 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -721,6 +721,9 @@ void SceneTreeEditor::_update_selection(TreeItem *item) {
NodePath np = item->get_metadata(0);
+ if (!has_node(np))
+ return;
+
Node *n=get_node(np);
if (!n)
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index bcc80796c4..773f4c7eea 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -532,6 +532,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
+ inspector->edit(variables);
+
step->set_icon( get_icon("DebugStep","EditorIcons"));
next->set_icon( get_icon("DebugNext","EditorIcons"));
back->set_icon( get_icon("Back","EditorIcons"));
@@ -1310,7 +1312,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
pending_in_queue=0;
variables = memnew( ScriptEditorDebuggerVariables );
- inspector->edit(variables);
+
breaked=false;
tabs->add_child(dbg);
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index 3d30b3882d..ebbc488ff2 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -73,6 +73,9 @@ void EditorSettingsDialog::popup_edit_settings() {
property_editor->edit(EditorSettings::get_singleton());
property_editor->get_property_editor()->update_tree();
+ search_box->select_all();
+ search_box->grab_focus();
+
popup_centered_ratio(0.7);
}
@@ -245,15 +248,22 @@ void EditorSettingsDialog::_update_plugins() {
}
+void EditorSettingsDialog::_clear_search_box() {
+
+ if (search_box->get_text()=="")
+ return;
+
+ search_box->clear();
+ property_editor->get_property_editor()->update_tree();
+}
+
void EditorSettingsDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
rescan_plugins->set_icon(get_icon("Reload","EditorIcons"));
+ clear_button->set_icon(get_icon("Close","EditorIcons"));
_update_plugins();
- } else if (p_what==NOTIFICATION_POST_POPUP) {
-
- property_editor->clear_search_box();
}
}
@@ -265,6 +275,7 @@ void EditorSettingsDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_plugin_settings"),&EditorSettingsDialog::_plugin_settings);
ObjectTypeDB::bind_method(_MD("_plugin_edited"),&EditorSettingsDialog::_plugin_edited);
ObjectTypeDB::bind_method(_MD("_plugin_install"),&EditorSettingsDialog::_plugin_install);
+ ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
}
EditorSettingsDialog::EditorSettingsDialog() {
@@ -275,17 +286,38 @@ EditorSettingsDialog::EditorSettingsDialog() {
add_child(tabs);
set_child_rect(tabs);
+ VBoxContainer *vbc = memnew( VBoxContainer );
+ tabs->add_child(vbc);
+ vbc->set_name("General");
+
+ HBoxContainer *hbc = memnew( HBoxContainer );
+ hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ vbc->add_child(hbc);
+
+ Label *l = memnew( Label );
+ l->set_text("Search: ");
+ hbc->add_child(l);
+
+ search_box = memnew( LineEdit );
+ search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ hbc->add_child(search_box);
+
+ clear_button = memnew( ToolButton );
+ hbc->add_child(clear_button);
+ clear_button->connect("pressed",this,"_clear_search_box");
+
property_editor = memnew( SectionedPropertyEditor );
//property_editor->hide_top_label();
- property_editor->set_name("General");
+ property_editor->get_property_editor()->set_use_filter(true);
+ property_editor->get_property_editor()->register_text_enter(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- tabs->add_child(property_editor);
+ vbc->add_child(property_editor);
- VBoxContainer *vbc = memnew( VBoxContainer );
+ vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
vbc->set_name("Plugins");
- HBoxContainer *hbc = memnew( HBoxContainer );
+ hbc = memnew( HBoxContainer );
vbc->add_child(hbc);
hbc->add_child( memnew( Label("Plugin List: ")));
hbc->add_spacer();
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index 119b4035ca..e1c3238a64 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -51,6 +51,8 @@ class EditorSettingsDialog : public AcceptDialog {
Button *rescan_plugins;
Tree *plugins;
+ LineEdit *search_box;
+ ToolButton *clear_button;
SectionedPropertyEditor *property_editor;
Timer *timer;