Patch_GameScript_Talk.cs 489 B

123456789101112131415161718192021222324
  1. using GadgetCore.API;
  2. using HarmonyLib;
  3. namespace ScrapYard.Patches
  4. {
  5. [HarmonyPatch(typeof(GameScript))]
  6. [HarmonyPatch("Talk")]
  7. [HarmonyGadget("ScrapYard")]
  8. public static class Patch_GameScript_Talk
  9. {
  10. [HarmonyPrefix]
  11. public static bool Prefix(GameScript __instance, int a)
  12. {
  13. if (a < 0)
  14. {
  15. __instance.StartCoroutine(__instance.ExitTalking());
  16. Core.logger.Log("Stop talking");
  17. return false;
  18. }
  19. return true;
  20. }
  21. }
  22. }