Automatically Enumerated String Parameters (Patreon)
Content
Some code cleanup is being done in the new menu system, and to make it more robust I've implemented this technique.
Several different foreground & background styles will eventually be implemented in the new menu system; users will be able to select them by using their parameter strings in the console command menu_create. For example, the parameter string "colorized" will select the default menu background effect, which makes the 3D view be colorized in brown (the color will eventually be customizable).
Now, this "automatically enumerated string parameters" technique ensures that an internal value called mbgstyle_colorized is created alongside the "colorized" string. Their naming will be always consistent between each other, with the names of all internal values of the same enumerator sharing the same prefix, and the suffix of each value being identical to the name of its corresponding string parameter. It also ensures that the index of the pointer to the "colorized" string matches the value of mbgstyle_colorized, and that the array m_bgstylename has the size needed to index all of the different string parameters. The parts that were commented out would also allow for the enumerated values to start with arbitrary numbers.
These qualities reduces the amount of redundancy in the code and makes it more consistent, allowing it to scale in a safer way.
Also, I've moved these enumerators inside of their related data structures, to make it easier to understand their purpose. The string pointer arrays were kept outside of the struct because typedefs doesn't initialize data.