Modify existing TMap details customization implementation

I want to replace the text entry for keys to a dropdown that is populated with FName entries from a Blackboard. But I cant find the implementation for how the details panel is created for TMaps.

Does anyone know where that implementation is in the source code? I tried looking through DetailsCustomizations.cpp but there were no arrays or simple types. And there are just so many references to IDetailsCustomization that I cant find the detail panel implementation for TMap.

The handling of collections in the details panel is a bit convoluted. It starts in FPropertyNode and FItemPropertyNode. If they find a UMapProperty, they create another FPropertyNode for the key and store a pointer to it in the PropertyKeyNode attribute of the original property node. When FDetailPropertyRow builds the widgets (in FDetailPropertyRow::GetWidgetRow or, more precisely, FDetailPropertyRow::MakeNameOrKeyWidget) it checks whether this PropertyKeyNode is valid, and if it is it builds a specialized widget for the key.

However, all this special casing ignores details customizations, so it seems that there’s no particularly nice way to customize map keys. You can see this if you define a property of type

TMap<FGameplayTag, Anything>: 

The gameplay tag editor is registered as customization and is displayed properly for, e.g. array elements or map values, but it does not affect map keys at all. Instead you get a map editor that allows you to create a single map entry with empty gameplay tag as key and then neither edit this key nor add additional entries. So if you use anything but the types special cased in the SPropertyValueWidget::ConstructPropertyEditorWidget method you’re likely to get a map editor that is not particularly useful.

I created a pull request in response to this question. The patch causes keys of TMaps to respect property type customizations. So it does not directly support displaying FNames as lists, but if you, e.g., wrapped them in a struct you could add an IPropertyTypeCustomization for the wrapper. Also, with this patch gameplay tags work as map keys, and they might be a nice alternative to FNames (depending on your use case).