GetEnumOptions/Union Types interaction
aers opened this issue · 2 comments
I'm using xedit-lib to crawl xedit's definitions for fields. Under ARMO/VMAD/Scripts/[array_element]/Properties/[array_element]/Value there's a union type for the values with a bunch of different options (int, float, bool, string, etc). If the plugin has a Bool here, the types that return are:
VT: vtEnum
ET: etUnion
DT: dtUnion
since bools are just True/False enums and union types have their own element type & def types. The problem is that calling GetEnumOptions on this will throw an exception since xedit-lib is probably expecting:
VT: vtEnum
ET: etValue
DT: dtInteger
GetValue() works as expected and returns True for the union enum.
I don't know if there are any other types with this issue; I'm not sure if there's a union which has a flag or reference type as a direct option.
(incidentally, this bug causes zedit to fail to load enum options for union enums)
xEdit's union stuff is very complicated, requires a lot of hoop-jumping in code.
I'll see if I can fix GetEnumOptions
to properly resolve union inner definitions.
Should be fixed in 64ea21d