Add support for custom debugging builds.#363
Add support for custom debugging builds.#363R-T-B wants to merge 12 commits intoKSPModdingLibs:devfrom
Conversation
…at behave slightly differently.
|
Should be ready now, there were some slight transpiler logic errors on MSVC built dlls but I fixed them. |
|
converting to draft pending more testing. |
Phantomical
left a comment
There was a problem hiding this comment.
I will probably have more comments but I need to do my taxes so I'm posting these for now.
|
So, I think it's ready now. But welcome any further comments. The worst part is probably how it uses file size to ID stock dlls, but, well, it certainly won't ever do the wrong codepath on a stock user, and the support for modded dlls is explicitly understood to be best effort, so... |
|
That should be it for tweaks, I have made a test build here and will be asking custom deobfuscated dll / debugging build users to play with it and see what happens. https://github.com/R-T-B/KSPCommunityFixes/releases/tag/1.40.1_RTBFORKr2 |
Phantomical
left a comment
There was a problem hiding this comment.
Two more small comments. I'm also not quite happy with the ModuleIndexingMismatch one, so I'm going to take a shot at rewriting some of it to work appropriately.
| return code; | ||
| } | ||
|
|
||
| static bool DoubleCurve_RecomputeTangents_Prefix(DoubleCurve __instance) |
There was a problem hiding this comment.
Since we're unconditionally overriding the method this should be PatchType.Override, and the method renamed to suit. It's a bit more efficient and you can then remove the bool return.
| } | ||
| else | ||
| { | ||
| AddPatch(PatchType.Prefix, typeof(Funding), "onVesselRecoveryProcessing"); |
There was a problem hiding this comment.
Ditto here, should be an override patch.
This simply adds support for custom dll builds where possible, mostly by using prefixes or fixed transpilers. It uses a basic size heureustic that is pretty reliable to detect custom dlls of Assembly-CSharp.
This is mostly useful for debugging, and is expected to be best effort, not a truly supported thing, but I expect it would be welcomed by some.