Slate dropdown for TArray

I’m looking to make a custom drop down that lets a user select one option from a TArray and returns the index on play. I’ve looked around for any documentation on customizing the editor but it all seems to be conflicting or incomplete. Can anyone point me in the right direction? I’m fairly certain I need to be using IDetailLayoutBuilder and I am about to try and look through the engine code for examples but i would prefer some solid documentation.

There practicly 0 documentation (well there is some but i think it does not really make you fully understand it) on Slate as much as documentation on editor so you need to look up editor code (or other 3rd party plugins) for examples or tutorials

Look up SPropertyEditorClass, which is widget that makes class selection combo for property editor (when you use UClass* or TSubclassOf). It makes SComboButton in which is spawns dropdown SClassViewer to show selectable list of classes, using special function in sperate class, but you can create SListView and tie selection events in same class and you simply call ComboButton->SetIsOpen(false) when dropdown done it’s job to close it)

https://github.com/EpicGames/UnrealEngine/blob/e528f9f7fa161504dd629c3b390deac93650e43a/Engine/Source/Editor/PropertyEditor/Private/UserInterface/PropertyEditor/SPropertyEditorClass.cpp

There a tool called “Widget Reflector” in “Windows->Developer Tools” which alows you to explore widget layout data of slate in Editor UI, it shows which class is reproducible with specific widget, so if you interested to see how something is coded you use this to find it in engine code.

1 Like

Widget Reflector, it’s a beam of holy light in my deep dark slate life!