Patch_GameScript_HoverCombatChip.cs 599 B

1234567891011121314151617181920212223242526272829
  1. using GadgetCore;
  2. using GadgetCore.API;
  3. using HarmonyLib;
  4. using System;
  5. using System.Reflection;
  6. using UnityEngine;
  7. namespace CombatChipChest.Patches
  8. {
  9. [HarmonyPatch(typeof(GameScript))]
  10. [HarmonyPatch("HoverCombatChip")]
  11. [HarmonyGadget("CombatChipChest")]
  12. public static class Patch_GameScript_HoverCombatChip
  13. {
  14. [HarmonyPrefix]
  15. public static void Prefix(GameScript __instance, int slot , int[] ___combatChips)
  16. {
  17. try
  18. {
  19. if (slot <= 5)
  20. {
  21. Core.combatChipStore.UpdateText(___combatChips[slot]);
  22. }
  23. }
  24. catch { }
  25. }
  26. }
  27. }