Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update MpCompatPatchLoader and sync field attribute (#472)
Updates to `MpCompatSyncFieldAttribute`: - Removed `context`, as it's unused (both here and in MP) - This includes removing the constructor accepting that argument - The existing constructors no longer accept SyncContext argument - Made `fieldName` field public - Made `instancePath` field - Added constructors accepting `instancePath` as an argument - This means constructors accepting `type` as both `string` and `Type` - The `Type` getter will return `null` if `typeName` and `type` fields are null/empty and `instancePath` isn't null/empty - Sync fields support `instancePath` starting with a static member, in which case the `Type` is expected to be null Updated `MpCompatPatchLoader`: - Added a field (`FastInvokeHandler`) to call ISyncField registration method that accepts instance path - This includes code to setup that field in static constructor - Perhaps we could make the field public at some point, if that would be needed/helpful? - Modified code setting up sync fields to support instance path, as well as handling the unexpected situation where the method to register them wasn't found/failed A side note - we should open the ability to use `ISyncField`s with instance path using the MP API. Another side note - if I remember correctly, it may be possible to simplify Cash Register compat (and potentially the 3 Corruption mods as well, but they weren't updated since 1.2, so... not worth it for them). I'll look into it in the future.
- Loading branch information