We are mkaing use of the FDetailArrayBuilder details builder (in PropertyCustomizationHelpers.h) to assist in some property customization.
In our use case we are deriving this class to providee some use-case specific behaviours.
To enable this we required changing the following members of FDetailArrayBuilder from private to protected:
DisplayName
OnGenerateArrayElementWidget
ArrayProperty
BsaeProperty
OnRebuildChildren
bGenerateHeader
bDisplayResetToDefault
bDisplayElementNum
OnNumElementsChangedHandle
We think this change may provide useful to others, so it would be great if those members were exposed to sub-classes in a future release of Unreal Engine.
We probably won’t do this on our side without more context or user requests.
We view those as implementation details that we can change. Making those protected would increase the burden for us to make change in the future as we would need to try to reduce the upgrade pain or amount breakage it would cause.
Some context for our use case, and why we exposed these members:
We have an array of structs we want to customise the interaction with. The customisation has some subtle differences depending on context so we make use of some of the available boolean members to toggle on/off certain customisations.
To display the array of properties we use the FDetailArrayBuilder, but we needed to be able to customise some elements of it:
What “ResetToDefault” does (we derive the default values from a different source, rather than the defaults for the value types)
Both the Reset To Default on the header for the whole array, and the Reset To Default on individual elements.
What each row in the row looks like (this behaviour exists out of the box with no engine changes)
Adding buttons to the header row of the array for custom addition/removal behaviours - we allow manual sync of missing/additional array elements compared to an authored default. Additionally we hide the default array actions you would get in a header.
To provide those behaviours we needed to primarily override the GenerateHeaderRowContent function. However to provide some of the functionality the base class already provides we needed access to some of the members in the base class - or we’d need to hide those members/use new members that serve the same purpose.
On reflection we really only use the following members, rather than any of the delegates:
DisplayName
ArrayProperty
BaseProperty
bGenerateheader
bDisplayResetToDefault
bDisplayElementNum
We don’t require write access to any of these.
In lieu of having these exposed to derived classes, is there any recommended way we could achieve our needs without changing engine source?
Hum, I think that would be the exact type of thing we might break if we have to change it.
May I suggest simply having your own fork of the FDetailArrayBuilder type. We mostly see it has a small helper type to create the customizations so you wouldn’t loose a lot from having your own version of it.