[EDITOR FEATURE REQUEST] Named items in editor arrays

Perhaps this is planned or exists already but I haven’t seen it. Hopefully it’s already there!

I would like to be able to customize the text in array listings so that it is easy to browse to specific subobjects. The easiest approach is to provide a “name property” within the class contained by the array instead of / as well as the index.

At the moment I print contents out to the log so I can find the indices. I also have a lot of data in my own editor because it’s just easier to edit that way.

I agree this would be really nice, I’ve thought myself that it rather sucks to have the raw indices shown in cases where the array is set up at design time.

I have some experience with the workings of UE4’s property system, and having had a think about how this might be implemented, I’ve unfortunately come to the conclusion that it would actually be really, really hard.

The thing is, where is the label data stored? You’d need to store it per instance of your class, since each instance has it’s own array, potentially of different size. But you can’t really embed it into the data, since the property is implemented as a templated TArray, and enforcing all arrays to be TArray< FLabeledWrapper< T > > is not feasible.

So then you’re left with storing the labels in some centralized repository, which would be cool because then it’s super easy to drop this stuff for non-editor builds. Only then you have to associate each label with a particular array element in a particular instance of your class. Doable, using some kind of property path, but then trying to maintain it whenever an array element is added or removed would be a bit of a nightmare.

Of course I might be missing something, but I think this is actually a much harder feature to add than it seems.

Thanks for the response.

How about something “on the side”. You could register a map of TArrays by address that have a callback and then use the callback if found. Perhaps something dirty like TMap<void*, TFunction<FString(void*)> > where the key is the array address and TFunction is a user provided label provider. You could of course hide the void*'s from the user.