How to build a Dynamic Drop down menu that changes values etc.

Hello, I am kind of an amateur, but I’ve been able to figure everything else out but this.

I am trying to build a menu that you add your own names to. (this part is done).

However, I am have trouble trying to set some variable settings due to what named named entry is chosen during gameplay.

So basically you can pick some settings, then you can save those settings.. Actor quantity of varying types of actors, Actor Skin etc. Then, later you can go back to the drop down menu and select that name in the dropdown and it loads all of those settings automatically.

I think I have gotten as far as placing possible variables into a struct, then having those settings change based on the selection.

What I’m having a problem with is figuring out how to take the named dropdown array and tying it to and saving those settings in the struct and have it different for each named menu item in the array.
I think this is an array within an array type thing. And I think I do need to use maps for this.

But I just can’t for the life of me wrap my head around how to get it done. I’ve searched for hours for something similar and have been not able to do so.

I think it’s basically having some menu settings but having it be variable, which is the confusing part cause you have to retrieve settings that are not constant.

I tried to explain this as clearly as possible. But if there needs to be more info please let me know.

Can anyone help me? Thank you!!!

If the values being stored aren’t constant, you’ll probably want to use an array or map of strings. First make a struct called S_SettingsGroup or some such which has a name var and a string array var. Then make an array variable of those (or tuck it into another struct lol).

It will require a bit of convoluted logic to parse the strings, but the Split String node can help speed that up. For example, here, I formatted the strings in array as either “text/[whatever]” or color/(rgba)", split the string with “/” and switched on left output of split, and plugged the right output into the input pins of set text and set color after converting it from string.

Making the formatted string at runtime could be a bit of a headache tho, as you would need to do a bunch of crazy, contextual appends on string. Like if saving a color option, you would have to append “color/” to the color value.

Hi,

also hard to explain, but i try. I have an example with Viewpoints.

In your menu you setup a scrollbox. It is not a dropdown i know, but you can combine it with a ExpandableArea to have nearly the same effect.

If you have the struct already we are fine.

Create a blueprint widget and call it list_entry. This BP will be the buttons in your scrollbox.
This BP contains a variable of your struct. So create a variable with type of your struct.
Create a button, text etc. whatever you need.
Maybe also a variable “name” you can put in the button text.
(the variables should have “instance editable” and “expose on spawn” enabled)

In your menu blueprint you can handle the list_entry “spawning”.
So when the user changes some settings and press save, you go → make struc.
Store this struc in an array. This array you can use to Create a savegame if you want to save all settings later. (if you need also help here just ask)

Next call your function to create the menu entries. Clear children of scrollbox first.
->Array of struc->For each loop->create widget of class your list_entry->their you connect the pins for your struct and the name.

If you load from save game you will call this function as well to propagate already existing entries.

In your list_entry blueprint you can have all the function what you want to happen when the user click the button of one of them. You have the struct inside, break it and do things with it.

For sure, you want to set the buttons text on construct in the list_entry blueprint.

Hello!
Thanks for the reply and information. Both of you.

But I think the way Andi is doing it is going to work better in my situation and for my brain.

I cannot get it to work though. I cannot get it to add a child to the scroll box.

I probably will need help on how to save this info.
Hopefully some of these screenshots will help see what I have going on. I can provide further info on details if needed.
I could not make my textbox instance editable or expose on spawn it says it’s a simple static text widget and I cannot change the variable type. But I have added code that I think should make it editable on spawn. ( If I did it correctly, cannot text since it doesn’t spawn at all.)

I do have one question about all of this though.

When each button is spawned, I’m saving this somehow to an array that ties the struct in it’s current form into it or the button itself? When I load the information you said I can this function but it’s in an array of just the struct? I guess it kind of confuses me how it saves the struct, and each itemized button in the list to the same struct but the values in the struct are different for each instance. Is it because I’m saving the Struct info to each itemized list_entry button? Should I be setting all of that info in the widget when I am also setting the name? So each instance has all that info and not a separate array?

Without further ado. The screen shots.

Thanks again for helping me. I know I’m slow to respond but life is crazy as we all know and this is just my (hobby) lol.

-Shockey