I do not like using switch on string, but Widget Comboboxes (afaik) only allow text. I am building a Dev Menu when selecting a level from within the Content folder and not playing through the main menu. If the developer wants something, they can press a key to bring up a series of comboboxes to request things.
I came across what appears to be a bug, but perhaps it is intended. The first selection in a combobox is None. When the combobox event named OnSelectionChanged fires, I fire an event on the playercontroller passing in the string argument that was selected. I use a Switch On String node to decide what to do. However, it appears if the Switch exec pin is labeled None, its text does NOT show up in the SwitchOnString node.
Has anyone else seen this? Not sure if I need to fill out a bug report or if it is intended. I can’t find anything stating this is intended and supposed to happen:
Not sure if it’s a bug but ‘None’ is a somewhat reserved word. Naming any exec pin ‘None’ removes the text and leaves the pin icon only - something I actively use every now and then. You can see it in macros, functions, events and so on.
Since the node is not to your liking, why not use an enumerator - in the long run they’re just so much more flexible, reliable and mesh so well with the Select node.
Hold up. Enumerators are stripped of their text in a packaged game. So if you populate your combo box from the enumerator’s values, in packaged game the combo box options will look like “enumerator_0; enumerator_1; etc.”
As a quick and dirty work-around, you could use a Select String node based on the enumerator and enter your values there.
Yup. Win 64 package. I just tried it with 4.23.1 btw. Not going to pretend to understand well how the reflection system works, just reporting that it does, indeed, seem to work fine (on my end).
Hey @Everynone Right! Yesterday, I successfully implemented almost identical to the image you posted. I did it in Event OnInitialized because the documentation says the only event to fire once during initialization/construction is Event OnInitialized. Your thoughts gave me the rubber duck I needed.