Browse Source

Don't push remote object if the same remote object is already in the history
Fix error inspector capitalization with regular objects after insepct remote objects

geequlim 8 năm trước cách đây
mục cha
commit
31b1a77dbc
3 tập tin đã thay đổi với 16 bổ sung7 xóa
  1. 14 0
      editor/editor_data.cpp
  2. 1 0
      editor/property_editor.cpp
  3. 1 7
      editor/script_editor_debugger.cpp

+ 14 - 0
editor/editor_data.cpp

@@ -86,6 +86,20 @@ void EditorHistory::_add_object(ObjectID p_object, const String &p_property, int
 	bool has_prev = current >= 0 && current < history.size();
 
 	if (has_prev) {
+
+		if (obj->is_type("ScriptEditorDebuggerInspectedObject")) {
+			for (int i = current; i >= 0; i--) {
+				Object *pre_obj = ObjectDB::get_instance(get_history_obj(i));
+				if (pre_obj->is_type("ScriptEditorDebuggerInspectedObject")) {
+					if (pre_obj->call("get_remote_object_id") == obj->call("get_remote_object_id")) {
+						History &pr = history[i];
+						pr.path[pr.path.size() - 1] = o;
+						current = i;
+						return;
+					}
+				}
+			}
+		}
 		history.resize(current + 1); //clip history to next
 	}
 

+ 1 - 0
editor/property_editor.cpp

@@ -3618,6 +3618,7 @@ void PropertyEditor::edit(Object *p_object) {
 
 	if (obj) {
 
+		set_enable_capitalize_paths(true);
 		obj->remove_change_receptor(this);
 
 		if (obj->is_type("ScriptEditorDebuggerInspectedObject")) {

+ 1 - 7
editor/script_editor_debugger.cpp

@@ -497,7 +497,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
 		}
 
 		inspected_object_id = id;
-		debugObj->update();
 		editor->push_item(debugObj, "");
 
 	} else if (p_msg == "message:video_mem") {
@@ -1000,12 +999,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
 					if (inspect_scene_tree->is_visible())
 						_scene_tree_request();
 
-					bool need_query_instance = inspected_object_id != 0;
-					need_query_instance = need_query_instance && editor->get_property_editor()->is_visible();
-					need_query_instance = need_query_instance && (editor->get_property_editor()->obj != NULL);
-					need_query_instance = need_query_instance && editor->get_property_editor()->obj->is_type("ScriptEditorDebuggerInspectedObject");
-					need_query_instance = need_query_instance && ((ObjectID)editor->get_property_editor()->obj->call("get_remote_object_id") != 0);
-					if (need_query_instance) {
+					if (inspected_object_id != 0 && editor->get_property_editor()->is_visible() && (editor->get_property_editor()->obj != NULL) && editor->get_property_editor()->obj->is_type("ScriptEditorDebuggerInspectedObject") && ((ObjectID)editor->get_property_editor()->obj->call("get_remote_object_id") != 0)) {
 						Array msg;
 						msg.push_back("inspect_object");
 						msg.push_back(inspected_object_id);