-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move and slightly modify ReplaceMethod method (#483)
- Moved `ReplaceMethod` from `ARimworldOfMagic` to `PatchingUtilities` - Made the method an extension method - Renamed parameters - `target` and `replacement` changed to `from` and `to`, matching Harmony's MethodReplacer - `buttonText` changed to `targetText`, since the method - Changed the parameter order - `baseMethod` now comes after `from` and `to` parameters and is now optional - `buttonText` now comes - The `from` and `to` arguments are now `MethodBase` rather than `MethodInfo` - This will allow replacement of constructors - The method no longer checks the operand and only checks if the operator is `MethodBase` and equal to `from` - It wasn't really needed, and will now allow for replacement of constructors - To support constructor replacement, the replaced `opcode` will be set to `Newobj` if the `to` is a constructor - The `extraInstructions` now gives a single argument (current instruction` to allow for potential modifications - Likewise, `extraInstructions` is now called after opcode/operand are changed
- Loading branch information
1 parent
66e1699
commit 663e35f
Showing
2 changed files
with
96 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters