Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Neerhom authored Jun 20, 2020
1 parent 98b5ef1 commit b1bb04e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions COM3D2.ModLoader.Patcher/ModLoaderPatcher.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
Expand Down Expand Up @@ -286,7 +286,7 @@ public static void Patch(AssemblyDefinition assembly)
BgMgr.ChangeAccess("m_dicAttachObj",true); // make public to allow hook access
MethodDefinition BgMgr_AddprefabToBg = BgMgr.GetMethod("AddPrefabToBg");
MethodDefinition BgMgr_prefab_override = Prefab_manager.GetMethod("BgMgr_prefab_override");
MethodReference BgMgr_prefab_override_ref= assembly.MainModule.Import(BgMgr_prefab_override);
MethodReference BgMgr_prefab_override_ref= assembly.MainModule.ImportReference(BgMgr_prefab_override);


for (int i = 0; i < BgMgr_AddprefabToBg.Body.Instructions.Count; i++)
Expand Down Expand Up @@ -333,6 +333,24 @@ public static void Patch(AssemblyDefinition assembly)
}

}

//add man menu file to user edit and photomode
TypeDefinition PhotoManEditManager = assembly.MainModule.GetType("PhotoManEditManager");
MethodDefinition PhotoManEditManager_ctor = PhotoManEditManager.GetMethod(".ctor");
MethodDefinition ManMenuAdd = hooks.GetMethod("ManMenuAdd");

try
{
PhotoManEditManager_ctor.InjectWith(ManMenuAdd, -1, flags: InjectFlags.PassInvokingInstance);
}
catch (Exception e)
{
Console.WriteLine("ModLoader:Failed to inject into method Deskmanager_OnChangeBg");
Console.WriteLine(e);

}


}


Expand Down

0 comments on commit b1bb04e

Please sign in to comment.