Rampastring / WorldAlteringEditor

Map editor for C&C: Red Alert 2, C&C: Tiberian Sun and Dawn of the Tiberium Age.
Other
70 stars 19 forks source link

Allow parsing script action options from another section #175

Closed Starkku closed 2 months ago

Starkku commented 3 months ago

Allows using OptionsSectionName in ScriptActions.ini to allow reading the preset options (OptionN key) from another section. Practically necessary for certain Phobos AI script actions because several of them use the same fixed list of possible parameter values, which would be exceedingly verbose to define separately for each of them.

Because the editor currently makes assumption that every section in this INI file is a script action, I made it so that ones prefixed with $ are not treated as such so that they can be used purely for defining the options (you can also just point to another script action I guess). A 'proper' solution to this would have required multiple parsing passes of the INI file to figure out which sections are actually used in OptionsSectionName or an equally complicated solution, or having it expect the sections in a specific order. If anyone can think of a better way to do this, I can adjust it.