summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-18 10:59:31 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-18 10:59:31 -0300
commitdc62389739bcc9ece889230cdd07cc6a2cb04a2d (patch)
treee69c5899daf404a207d4b955054287e4172a0f70 /editor
parente61d547ed08924d75e18469fe648463dee3bd5a3 (diff)
-Properly check limits to objects sent (regarding to size), fixes #9034
-Changed the way objects are marshalled and sent to the debugger -Editing debugged objects happens in the remote inspector now
Diffstat (limited to 'editor')
-rw-r--r--editor/property_editor.cpp29
-rw-r--r--editor/script_editor_debugger.cpp14
2 files changed, 36 insertions, 7 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 2f47d3e130..0ec83d8a36 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -38,6 +38,7 @@
#include "editor_node.h"
#include "editor_settings.h"
#include "io/image_loader.h"
+#include "io/marshalls.h"
#include "io/resource_loader.h"
#include "multi_node_edit.h"
#include "os/input.h"
@@ -2320,7 +2321,15 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p
} break;
case Variant::OBJECT: {
- if (obj->get(p_name).get_type() == Variant::NIL || obj->get(p_name).operator RefPtr().is_null()) {
+ Ref<EncodedObjectAsID> encoded = obj->get(p_name); //for debugger and remote tools
+
+ if (encoded.is_valid()) {
+
+ p_item->set_text(1, "Object: " + itos(encoded->get_object_id()));
+ p_item->set_icon(1, Ref<Texture>());
+ p_item->set_custom_as_button(1, true);
+
+ } else if (obj->get(p_name).get_type() == Variant::NIL || obj->get(p_name).operator RefPtr().is_null()) {
p_item->set_text(1, "<null>");
p_item->set_icon(1, Ref<Texture>());
p_item->set_custom_as_button(1, false);
@@ -3610,7 +3619,16 @@ void PropertyEditor::update_tree() {
RES res = obj->get(p.name).operator RefPtr();
- if (obj->get(p.name).get_type() == Variant::NIL || res.is_null()) {
+ Ref<EncodedObjectAsID> encoded = obj->get(p.name); //for debugger and remote tools
+
+ if (encoded.is_valid()) {
+
+ item->set_text(1, "Object: " + itos(encoded->get_object_id()));
+ item->set_icon(1, Ref<Texture>());
+ item->set_custom_as_button(1, true);
+ item->set_editable(1, true);
+
+ } else if (obj->get(p.name).get_type() == Variant::NIL || res.is_null()) {
item->set_text(1, "<null>");
item->set_icon(1, Ref<Texture>());
item->set_custom_as_button(1, false);
@@ -3939,6 +3957,13 @@ void PropertyEditor::_item_edited() {
if (!item->is_custom_set_as_button(1))
break;
+ Ref<EncodedObjectAsID> encoded = obj->get(name); //for debugger and remote tools
+
+ if (encoded.is_valid()) {
+
+ emit_signal("object_id_selected", encoded->get_object_id());
+ }
+
RES res = obj->get(name);
if (res.is_valid()) {
emit_signal("resource_selected", res.get_ref_ptr(), name);
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 01cfdc1b57..bcf24b98f6 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -372,7 +372,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
if (has_icon(p_data[i + 2], "EditorIcons"))
it->set_icon(0, get_icon(p_data[i + 2], "EditorIcons"));
it->set_metadata(0, id);
+
if (id == inspected_object_id) {
+ TreeItem *cti = it->get_parent(); //ensure selected is always uncollapsed
+ while (cti) {
+ cti->set_collapsed(false);
+ cti = cti->get_parent();
+ }
it->select(0);
}
@@ -385,6 +391,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
it->set_collapsed(true);
}
}
+
lv[level] = it;
}
updating_scene_tree = false;
@@ -439,11 +446,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
inspected_object->last_edited_id = id;
- if (tabs->get_current_tab() == 2) {
- inspect_properties->edit(inspected_object);
- } else {
- editor->push_item(inspected_object);
- }
+ tabs->set_current_tab(inspect_info->get_index());
+ inspect_properties->edit(inspected_object);
} else if (p_msg == "message:video_mem") {