Cycle through Enum values

Hi,

I’m setting up an options menu and I’m trying to make a selector that cycles through options when you click the left or right buttons.
I want to be able to select an Enum or equivalent from the dropdown so that I can pull the correct data.
Currently I have Difficulty (Easy,Normal, Hard) and TextLanguage (Eng, Fr, Ita, Ger, Span)

I could of course do this with a series of switches but that would be tiresome and require alot of edits in the future if I want to change something. I’m currently using this to just change the preview and ofcourse it will only pull the default value, anyone done something like this before mind showing a better way?

Each Enum type has their own ForEach node.

1 Like

I assume you want to cycle through the enums when clicking the next/previous buttons.
If so, try this:


Replace test enum with your enum

Result

[Edit]
Clear the array before adding to avoid repeats.

2 Likes

Or use Event On Initialized instead of construct

2 Likes

Thanks that’s great but I don’t think it’s quite what I need as it will only work for one category.
Basically when I choose the option I want it to pull data from a separate list and each option will have a separate list that is pre built so no changes during runtime.

All these below and more I want to nest within the widget so that you can select the Enum and then populate the tab with only these options
E_Language
English
French
etc

E_Difficulty
Easy
Medium
Hard

E_SubtitleSize
Small
Medium
Large

Something kinda like this, I’m using an empty Byte and setting it based on the other Enum, it does return the correct index but unfortunately it doesn’t return the text only the index.

Sorry about the delay.

In this case you’re gonna have to use different array variables for each of the different OpenSelectionTypes, instead of just a byte array.

like different array variables for :

  • Platform Options
  • Difficulty Options
  • etc…
1 Like

Thanks, that’s what I ended up doing in the end after some experimenting and I didn’t now what those Enum loops were for :sweat_smile:, thanks again

1 Like

Here’s what’s inside the Add to Selection List function in case anyone wants to do something similar. The UpdateSelectionText just updates the text, nothing fancy

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.