"Previous override" support? #202
-
|
I just learned about Mutagen and have started working to convert a big pile of XEditLib P/Invoke code. One important thing that I haven't been able to find - though that doesn't mean it's not there, I might just be missing it - is the PO pointer that XEdit provides. I assume that the Specifically, I use this to check for ITPO, which is important for my use case. I suppose I could do something like scan through the entire load order searching for the last previous record with the same key, but it seems inefficient by comparison... I have to do this on potentially several thousand records. AFAICT the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
For finding PO you could use something like this snippet: //this is some formlink that you can get either from record or from FormKeys
var formLink = ...
var overrides = formLink.ResolveAll(state.LinkCache).Take(2).ToList();
//overrides then contains winning override at 0 position and previous override at 1st.If you also want to know which override comes from which mod you can use |
Beta Was this translation helpful? Give feedback.
-
|
Hey! Good question! Going to convert this issue to a discussion FAQ, so others can see it in the future. Thanks @theSkyseS, you're right on the money. LinkCaches + ResolveAll is what you're looking for. I've been filling out the docs, so I just took the opportunity to get the relevant ones complete: |
Beta Was this translation helpful? Give feedback.
Hey! Good question! Going to convert this issue to a discussion FAQ, so others can see it in the future.
Thanks @theSkyseS, you're right on the money. LinkCaches + ResolveAll is what you're looking for.
I've been filling out the docs, so I just took the opportunity to get the relevant ones complete:
https://github.com/Mutagen-Modding/Mutagen/wiki/LinkCache
https://github.com/Mutagen-Modding/Mutagen/wiki/Previous-Override-Iteration