AllProcPropSeqStartPatcher.cs 743 B

123456789101112131415161718192021222324
  1. using System;
  2. using HarmonyLib;
  3. namespace COM3D2.MeidoPhotoStudio.Plugin
  4. {
  5. // TODO: Extend this further to potentially reduce the need for coroutines that wait for maid proc state
  6. public static class AllProcPropSeqStartPatcher
  7. {
  8. public static event EventHandler<ProcStartEventArgs> SequenceStart;
  9. [HarmonyPatch(typeof(Maid), nameof(Maid.AllProcPropSeqStart))]
  10. [HarmonyPostfix]
  11. private static void NotifyProcStart(Maid __instance)
  12. {
  13. SequenceStart?.Invoke(null, new ProcStartEventArgs(__instance));
  14. }
  15. }
  16. public class ProcStartEventArgs : EventArgs
  17. {
  18. public readonly Maid maid;
  19. public ProcStartEventArgs(Maid maid) => this.maid = maid;
  20. }
  21. }