Download

Custom Dropdown in Blueprint/Component Properties

Hi,

I’ve been combing the forums and searching for hours tonight and I feel like I’m missing something important as what I’m trying to do seems like it should be incredibly simple.

We have a legacy data mapping tool that we export proprietary data for, to be used on the C++ side of our game. From it, we populate lots of things such as (Item ID/Name) (Loot Table Name, Loot Table ID) etc…

In the simplest case, we merely want to select a single entry from an array of table lookups which consist of a Name and the lookup ID (key).

Item List ]
Item A ]
Item B ]

Item A ] <— picked

Similar to if you want to pick from a list of classes in the game using TSubclassOf but in this case it’s just an array of custom formatted data.

So from the designer’s perspective, they run the editor, go to their component archetype and select which “item” they want from a list of items.

I’ve looked at the Enum support and we clearly can’t use that as this is dynamic.

I’ve looked at DataAsset, made instances of them in our game engine class hoping that I could access them in the editor (This one sounds hopeful, any ideas?)

I’ve looked into DataTable and that seems like incredible overkill for what we are trying to achieve, not to mention our data is not formatted even remotely that way and fast accessible lists are constructed from our data in different ways depending on key type so pushing everything into CSVs would completely break our data paradigm.

There has to be someone who has figured this out. Should I be looking at Customized Detail Panels? If so, is there any actual good documentation about them? The two examples I found are either outdated or have never actually worked.

I apologize if I sound frustrated, but this really seems like basic functionality that I am clearly have had no luck discovering.

Thanks in Advance.

Did you read this? I found that documentation to be excellent. It’s true it’s now slightly outdated, but combined with the latest API references it’s easy to understand what’s been changed. It’s just a couple of cosmetic things like moving a method from one class to another. Also there are literally hundreds of examples of using details customizations in the engine source on Github.

All you need to do is add a combo box which you populate with the options you want to make available from your data source. It might be worth wrapping access to your data source in a UDataAsset, so you could access it from the details customization via asset lookup instead of using a global. But generally I think data assets are for when you want to be able to edit the data inside the editor, so it’s perhaps not necessary in your case.

Thank you for pointing me in the right direction. I had gone down the path you suggested and couldn’t find much that worked, but your response made a lot of sense so I combed through Git as recommended. Found a couple good examples that work with 4.7.1 and in about 30 minutes of work have all of the panel customizations that we need to continue moving forward. I really appreciate your help. I was convinced that I was out in the weeds and I was right. lol