| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using GadgetCore.API;
- using HarmonyLib;
- using System.Collections;
- using System.Reflection;
- using UnityEngine;
- namespace StorageExpansion.Patches
- {
- [HarmonyPatch(typeof(GameScript))]
- [HarmonyPatch("RefreshSlotStorage")]
- [HarmonyGadget("StorageExpansion")]
- public static class Patch_GameScript_RefreshSlotStorage
- {
- [HarmonyPrefix]
- public static bool Prefix(GameScript __instance, int i, Item[] ___storage, GameObject[] ___storageIconBack, GameObject[] ___storageIcon,
- int ___curStoragePage, TextMesh[] ___txtQStorage)
- {
- int num = i + ___curStoragePage * Core.settingAmountSlots;
- ___storageIcon[i].GetComponent<Renderer>().material = (Material)Resources.Load("i/i" + ___storage[num].id);
- AnimIcon animIcon = (AnimIcon)___storageIconBack[i].GetComponent("AnimIcon");
- if (___storage[num].id < 300 || ___storage[num].id >= 2000)
- {
- ___storageIconBack[i].SetActive(false);
- animIcon.anim = 0;
- }
- else
- {
- ___storageIconBack[i].GetComponent<Renderer>().material = (Material)Resources.Load("iBack" + ___storage[num].tier);
- if (___storage[num].tier == 3)
- {
- animIcon.anim = 1;
- }
- else
- {
- animIcon.anim = 0;
- }
- ___storageIconBack[i].SetActive(true);
- }
- if (___storage[num].q > 1)
- {
- ___txtQStorage[i].text = string.Empty + ___storage[num].q;
- }
- else
- {
- ___txtQStorage[i].text = string.Empty;
- }
- return false;
- }
- }
- }
|