aboutsummaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorMateusz Adamczyk2016-10-11 23:14:03 +0200
committerRémi Verschelde2016-10-17 20:48:10 +0200
commit17edff2f84c52d7f26fc62787bf25ba8e9758124 (patch)
tree9dabef490b20201006e356a1c852554b6068de09 /tools/editor
parentb4edaa892dc4be612faeccf1cee0856b8a047aaf (diff)
downloadgodot-17edff2f84c52d7f26fc62787bf25ba8e9758124.tar.gz
godot-17edff2f84c52d7f26fc62787bf25ba8e9758124.tar.zst
godot-17edff2f84c52d7f26fc62787bf25ba8e9758124.zip
Possibility to write node path by hand in exported NodePath variable (#3486)
(cherry picked from commit cf4f3815b330093a0b4cf25569843929277739fd)
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/property_editor.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index cd602d6df..f7a42fc7b 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -3331,9 +3331,10 @@ void PropertyEditor::update_tree() {
} break;
case Variant::NODE_PATH: {
- item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
+ item->set_cell_mode(1, TreeItem::CELL_MODE_STRING);
item->set_editable( 1, !read_only );
item->set_text(1,obj->get(p.name));
+ item->add_button(1, get_icon("Collapse", "EditorIcons"));
} break;
case Variant::OBJECT: {
@@ -3610,6 +3611,7 @@ void PropertyEditor::_item_edited() {
} break;
case Variant::NODE_PATH: {
+ _edit_set(name, NodePath(item->get_text(1)));
} break;
@@ -3785,7 +3787,17 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
String n = d["name"];
String ht = d["hint_text"];
- if (t==Variant::STRING) {
+ if(t == Variant::NODE_PATH) {
+
+ Variant v = obj->get(n);
+ custom_editor->edit(obj, n, (Variant::Type)t, v, h, ht);
+ Rect2 where = tree->get_item_rect(ti, 1);
+ where.pos -= tree->get_scroll();
+ where.pos += tree->get_global_pos();
+ custom_editor->set_pos(where.pos);
+ custom_editor->popup();
+
+ } else if (t==Variant::STRING) {
Variant v = obj->get(n);