emoose / MBINCompiler

Now maintained by monkeyman192: https://github.com/monkeyman192/MBINCompiler
Other
43 stars 69 forks source link

Specify size of strings in string list instead of using List<NMSString0x80> etc #8

Open emoose opened 8 years ago

emoose commented 8 years ago

Should be pretty easy, can probably just change it to List<string> and use [MarshalAs(SizeConst= <stringLength>)], then in the deserializer have it use that SizeConst value when it encounters a List<string>.

I've just used special NMSString0x templates as a hacky workaround right now but that uglies up the XML a lot, I'll probably get around to fixing it later but if anyone wants to look into this in the meantime feel free.

emoose commented 8 years ago

Maybe we should change the NMSAttribute to have a Size and a Count field, Size for lengths of data, Count for number of entries in an array.

That way we can use string[] instead of NMSString0x80[] and specify the lengths of the strings in the template.