Changes

m
Text replacement - "tt>" to "samp>"
Line 11: Line 11:  
* Added [https://harmony.pardeike.net/articles/patching-finalizer.html finalizers] and [https://harmony.pardeike.net/articles/reverse-patching.html reverse patches].
 
* Added [https://harmony.pardeike.net/articles/patching-finalizer.html finalizers] and [https://harmony.pardeike.net/articles/reverse-patching.html reverse patches].
 
* Added [https://harmony.pardeike.net/articles/patching-postfix.html pass-through postfixes].
 
* Added [https://harmony.pardeike.net/articles/patching-postfix.html pass-through postfixes].
* Added [https://harmony.pardeike.net/api/HarmonyLib.Transpilers.html <tt>Manipulator</tt>] utility, <tt>CodeInstruction</tt> extensions, and other improvements for transpilers.
+
* Added [https://harmony.pardeike.net/api/HarmonyLib.Transpilers.html <samp>Manipulator</samp>] utility, <samp>CodeInstruction</samp> extensions, and other improvements for transpilers.
* Added more <tt>AccessTools.Is*</tt> methods.
+
* Added more <samp>AccessTools.Is*</samp> methods.
 
* Added support for .NET 5.
 
* Added support for .NET 5.
* Transpilers can now default to the original input by returning <tt>null</tt>.
+
* Transpilers can now default to the original input by returning <samp>null</samp>.
 
* Improved compatibility with Android modding.
 
* Improved compatibility with Android modding.
 
* Improved exception messages.
 
* Improved exception messages.
Line 46: Line 46:     
===Stricter validation===
 
===Stricter validation===
Harmony 2.x has stricter validation in general, so invalid patches that would previously somewhat work (e.g. setting <tt>__result</tt> to the wrong type) will now cause errors. See the exception messages for help fixing these.
+
Harmony 2.x has stricter validation in general, so invalid patches that would previously somewhat work (e.g. setting <samp>__result</samp> to the wrong type) will now cause errors. See the exception messages for help fixing these.
    
===Patching static constructors===
 
===Patching static constructors===
The <tt>AccessTools</tt> methods for constructors (<tt>Constructor</tt>, <tt>DeclaredConstructor</tt>, and <tt>GetDeclaredConstructors</tt>) no longer match static constructors by default. Use the new <tt>searchForStatic</tt> argument if you need to match them:
+
The <samp>AccessTools</samp> methods for constructors (<samp>Constructor</samp>, <samp>DeclaredConstructor</samp>, and <samp>GetDeclaredConstructors</samp>) no longer match static constructors by default. Use the new <samp>searchForStatic</samp> argument if you need to match them:
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Line 76: Line 76:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
<tt>Farm.cleanupBeforePlayerExit</tt> doesn't exist, so it's inherited from <tt>GameLocation</tt>. Harmony 1.x would let you patch <tt>Farm.cleanupBeforePlayerExit</tt>, but in Harmony 2.x you must target the actual method (<tt>GameLocation.cleanupBeforePlayerExit</tt> in this example).
+
<samp>Farm.cleanupBeforePlayerExit</samp> doesn't exist, so it's inherited from <samp>GameLocation</samp>. Harmony 1.x would let you patch <samp>Farm.cleanupBeforePlayerExit</samp>, but in Harmony 2.x you must target the actual method (<samp>GameLocation.cleanupBeforePlayerExit</samp> in this example).
   −
===<tt>HarmonyMethod</tt> no longer allows null===
+
===<samp>HarmonyMethod</samp> no longer allows null===
 
Harmony 1.x allowed <code>new HarmonyMethod(null)</code>, so you could safely use it with methods that might not exist. Harmony 2.x now throws an exception in that case, so you should check if you're not sure it exists:
 
Harmony 1.x allowed <code>new HarmonyMethod(null)</code>, so you could safely use it with methods that might not exist. Harmony 2.x now throws an exception in that case, so you should check if you're not sure it exists:
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
107,410

edits