Skip to content

Makes It easier to patch Properties And Methods Using Harmony!!!

Notifications You must be signed in to change notification settings

LimeAndPyro/EasyPatching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EasyPatching

Makes It easier to patch Properties And Methods Using Harmony!!!

If You have any questions feel free to contact By my discord username Lime/Pyro/Creed#1212!

if used throw a note with my discord name in the code :)

Example Code

Method Patches = Patches into specific method For example class Deeznuts is the typeof(deeznuts) and the methodname lets say is "inyourmom".

Post Method Patch = EasyPatchMethodPost Patches a Method And its Func After the Orig Func Is ran.

Post Method Code

 public static void Patch()
    {
        EasyPatching.EasyPatchMethodPost(typeof(NetworkManager), "Method_Public_Void_Player_1", typeof(PlayerPatches), "OnArrivalPost");
    }

PrePost Method Patch = EasyPatchPropertyPre Patches A Property Before The Original Func is Ran.

Prepost Method Code

  public static void Patch()
         {
             EasyPatching.EasyPatchMethodPost(typeof(NetworkManager), "Method_Public_Void_Player_1", typeof(PlayerPatches), "OnArrivalPost");
         }

Output Function = The Function which you run your own code that will either run before or after the original code.

Prepost Method Function Code

Property Patching = Patches into a specific property Such as float, int, etc.

Post Property Patch = EasyPatchPropertyPost Patches A Property After The Original Func is Ran.

Post Property Code

 public static void Patch()
         {
             EasyPatching.EasyPatchPropertyPost(typeof(PhotonPeer), "ServerAddress", typeof(PlayerPatches), "GetAddress");
         }

Property Prepost Patch = EasyPatchPropertyPre Patches A Property Before The Original Func is Ran

PrePost Property Code

 public static void Patch()
         {
             EasyPatching.EasyPatchPropertyPre(typeof(PhotonPeer), "ServerAddress", typeof(PlayerPatches), "GetAddress");
         }

IMPORTANT NOTES

-Remember to always start your patches after.

-You must use typeof cast For All Type Param.

-Its better to start all your patches in a seperete class then to start them individually on application start.

Example start cs

Example On App Start

Thank you for Checking out my repo Much love.

EDIT(I accidentally got the wrong method for onplayer join it fixed now tho)

About

Makes It easier to patch Properties And Methods Using Harmony!!!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages