summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-10-17 11:17:06 +0200
committerGitHub <noreply@github.com>2016-10-17 11:17:06 +0200
commitc4b7c7d81bf3d4750aa5a824ec108ba121565c48 (patch)
treed940e0b6a49a9564116d7d3213a735638045a80f /tools
parentbdce7eefa046c7b9520a5e243de11428b0e7ff2a (diff)
parentcf4f3815b330093a0b4cf25569843929277739fd (diff)
Merge pull request #6796 from mateka/issue-3486
Possibility to write node path by hand in exported NodePath variable (#3486)
Diffstat (limited to 'tools')
-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 f18d5c928a..ef6b1aa47c 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -3613,9 +3613,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: {
@@ -3892,6 +3893,7 @@ void PropertyEditor::_item_edited() {
} break;
case Variant::NODE_PATH: {
+ _edit_set(name, NodePath(item->get_text(1)));
} break;
@@ -4067,7 +4069,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);