Repository: godotengine/godot (language: cpp)

Issue:
Exported typed dictionary with value as Texture2D can't be changed through the editor
### Tested versions

4.4 stable

### System information

Windows 11 Godot 4.4 stable

### Issue description

Exported typed dictionary with value as Texture2D can't be changed through the editor
![Image](https://github.com/user-attachments/assets/66705de8-33ef-4d9b-bfc4-aabf1f9aa308)

### Steps to reproduce

Try to edit the values of the already-typed dictionary values, it wont let you

### Minimal reproduction project (MRP)

[MRP.zip](https://github.com/user-attachments/files/19516840/MRP.zip)


Discussion / hints:
If we breakpoint where Nil property selectors get instantiated

https://github.com/godotengine/godot/blob/ba3482926daa6450d21b030cfe029689525c0e51/editor/editor_properties.cpp#L3537-L3545

it seems like the type for the value is being  #considered as `NIL`, rather than using the type encoded in the hint text.

An easy way to work around this seems to be to add a check in the case for `Variant::NIL` to see if the `p_hint` is a resource type or a node type, and then instead return the result of the function with `Variant::OBJECT` passed in as the `p_type` instead. This gets you a result like this where the value is `<empty>` and is editable, which seems more desirable.

![Image](https://github.com/user-attachments/assets/a5c25458-d423-4b1f-bdf7-1206ae061125)

Fix patch:
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index b10bd992377f..4899eeebe672 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -1360,7 +1360,14 @@ void EditorPropertyDictionary::update_property() {
 
 			Variant value;
 			object->get_by_property_name(slot.prop_name, value);
-			Variant::Type value_type = value.get_type();
+
+			Variant::Type value_type;
+
+			if (dict.is_typed_value() && slot.prop_key) {
+				value_type = value_subtype;
+			} else {
+				value_type = value.get_type();
+			}
 
 			// Check if the editor property needs to be updated.
 			bool value_as_id = Object::cast_to<EncodedObjectAsID>(value);


Test patch: