Patch_GameScript_GetGearAspect.cs 527 B

12345678910111213141516171819202122
  1. using GadgetCore.API;
  2. using HarmonyLib;
  3. using System.Reflection;
  4. using UnityEngine;
  5. namespace Subworlds.Patches
  6. {
  7. [HarmonyPatch(typeof(GameScript))]
  8. [HarmonyPatch("GetGearAspect")]
  9. [HarmonyGadget("SubworldCore")]
  10. public static class Patch_GameScript_GetGearAspect
  11. {
  12. [HarmonyPostfix]
  13. public static void Postfix(GameScript __instance, int id, ref string __result)
  14. {
  15. ItemInfo itemInfo = ItemRegistry.GetItem(id + 200);
  16. if (itemInfo != null)
  17. __result = itemInfo.GetName();
  18. }
  19. }
  20. }