123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.Collections.Generic;
- using System.Reflection;
- using MaidStatus;
- using Mono.Cecil;
- using NeighPatcher;
- using PrivateMaidMode;
- namespace AllMaidsInPrivateMode.Patcher
- {
- public static class Patcher
- {
- public static readonly string[] TargetAssemblyNames = { "Assembly-CSharp.dll" };
- public static void Patch(AssemblyDefinition ad)
- {
- NeighPatcher.NeighPatcher.PatchAll(ad, "AllMaidsInPrivateMode.Patcher.Hooks");
- }
- }
- public static class Hooks
- {
- [NeighPatch("Assembly-CSharp", "PrivateMaidMode.PrivateCharaSelectMain", "OnCall")]
- public static void OnCreate()
- {
- var field = typeof(PrivateCharaSelectMain).GetField("<>f__mg$cache0",
- BindingFlags.Static | BindingFlags.NonPublic);
- field.SetValue(
- null, new uGUICharacterSelectManager.CallBackMaidList(uGUICharacterSelectManager.DefaultMaidList));
- }
- [NeighPatch("Assembly-CSharp", "PrivateMaidMode.PrivateModeMgr", "CreateListData")]
- public static void OnCreateListData(ref List<Maid> ___maidList)
- {
- var characterMgr = GameMain.Instance.CharacterMgr;
- for (var i = 0; i < characterMgr.GetStockMaidCount(); i++)
- {
- var stockMaid = characterMgr.GetStockMaid(i);
- var status = stockMaid.status;
- if (status.specialRelation != SpecialRelation.Married)
- ___maidList.Add(stockMaid);
- }
- }
- }
- }
|