瀏覽代碼

Merge pull request #96623 from ajreckof/avoid-bubbling-up-changed-notification-when-on-new-item/key-of-dictionaries-to-avoid-inspector-whipeout-

Avoid bubbling up changed notification when on new item/key of dictionaries to avoid inspector wipeout.
Thaddeus Crews 8 月之前
父節點
當前提交
7d185473bf
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      editor/editor_properties_array_dict.cpp

+ 5 - 1
editor/editor_properties_array_dict.cpp

@@ -952,7 +952,11 @@ void EditorPropertyDictionary::_property_changed(const String &p_property, Varia
 	}
 
 	object->set(p_property, p_value);
-	emit_changed(get_edited_property(), object->get_dict(), p_name, p_changing);
+	bool new_item_or_key = !p_property.begins_with("indices");
+	emit_changed(get_edited_property(), object->get_dict(), p_name, p_changing || new_item_or_key);
+	if (new_item_or_key) {
+		update_property();
+	}
 }
 
 void EditorPropertyDictionary::_change_type(Object *p_button, int p_slot_index) {