From 8fb19e58433d5b132590b804a7a573f5e616f745 Mon Sep 17 00:00:00 2001 From: marynate Date: Thu, 27 Feb 2014 22:16:00 +0800 Subject: Auto select custom property value field when pop up, user can start typing to change value right away. --- tools/editor/property_editor.cpp | 53 +++++++++++++++++++++++++++++++++++++++- tools/editor/property_editor.h | 2 ++ 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'tools/editor') diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 6b34e3f555..1cce161d08 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -51,7 +51,7 @@ void CustomPropertyEditor::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( 10,10,60, get_size().height-20 ), v ); }*/ - } + } } @@ -1397,6 +1397,53 @@ void CustomPropertyEditor::_modified(String p_string) { updating=false; } +void CustomPropertyEditor::_focus_enter() { + switch(type) { + case Variant::REAL: + case Variant::STRING: + case Variant::VECTOR2: + case Variant::RECT2: + case Variant::VECTOR3: + case Variant::PLANE: + case Variant::QUAT: + case Variant::_AABB: + case Variant::MATRIX32: + case Variant::MATRIX3: + case Variant::TRANSFORM: { + for (int i=0;ihas_focus()) { + value_editor[i]->select_all(); + break; + } + } + } break; + default: {} + } + +} + +void CustomPropertyEditor::_focus_exit() { + switch(type) { + case Variant::REAL: + case Variant::STRING: + case Variant::VECTOR2: + case Variant::RECT2: + case Variant::VECTOR3: + case Variant::PLANE: + case Variant::QUAT: + case Variant::_AABB: + case Variant::MATRIX32: + case Variant::MATRIX3: + case Variant::TRANSFORM: { + for (int i=0;iselect(0, 0); + } + } break; + default: {} + } + +} + void CustomPropertyEditor::config_action_buttons(const List& p_strings) { int w=100; @@ -1456,6 +1503,8 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns,int void CustomPropertyEditor::_bind_methods() { + ObjectTypeDB::bind_method("_focus_enter", &CustomPropertyEditor::_focus_enter); + ObjectTypeDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit); ObjectTypeDB::bind_method("_modified",&CustomPropertyEditor::_modified); ObjectTypeDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified); ObjectTypeDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed); @@ -1487,6 +1536,8 @@ CustomPropertyEditor::CustomPropertyEditor() { value_editor[i]->hide(); value_label[i]->hide(); value_editor[i]->connect("text_entered", this,"_modified"); + 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++) { diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h index fc0330c25d..7ee14679c1 100644 --- a/tools/editor/property_editor.h +++ b/tools/editor/property_editor.h @@ -105,6 +105,8 @@ class CustomPropertyEditor : public Popup { void _file_selected(String p_file); void _scroll_modified(double p_value); void _modified(String p_string); + void _focus_enter(); + void _focus_exit(); void _action_pressed(int p_which); void _type_create_selected(int p_idx); -- cgit v1.2.3 From 3ba00567c5a033625bd5789fcd83056c06edb300 Mon Sep 17 00:00:00 2001 From: sasori Date: Wed, 5 Mar 2014 18:52:57 +0100 Subject: Solved bug to select external editor url https://github.com/okamstudio/godot/issues/145 --- tools/editor/plugins/script_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/editor') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 1a17916394..a01565a046 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1507,7 +1507,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("external_editor/use_external_editor",false); EDITOR_DEF("external_editor/exec_path",""); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_FILE)); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("external_editor/exec_flags",""); } -- cgit v1.2.3 From 87fd1532159c18efc06524f2715ed74b3e32ddee Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Tue, 11 Mar 2014 13:38:30 +0800 Subject: fixed editor NodePath property --- tools/editor/editor_node.h | 2 ++ tools/editor/scene_tree_editor.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/editor') diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 87f17247c3..e35467e788 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -410,6 +410,8 @@ public: static void add_editor_plugin(EditorPlugin *p_editor); static void remove_editor_plugin(EditorPlugin *p_editor); + static EditorNode * get_singleton() { return singleton; } + void edit_node(Node *p_node); void edit_resource(const Ref& p_resource); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index 89b7e54195..1d2c864c99 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -706,7 +706,8 @@ void SceneTreeDialog::_cancel() { void SceneTreeDialog::_select() { if (tree->get_selected()) { - emit_signal("selected",tree->get_selected()->get_path()); + Node *scene = EditorNode::get_singleton()->get_edited_scene(); + emit_signal("selected","/root/" + scene->get_parent()->get_path_to(tree->get_selected())); hide(); } } -- cgit v1.2.3