private void GenericNotification_SetEquipment(GenericNotification.orig_SetEquipment orig, RoR2.UI.GenericNotification self, EquipmentDef equipmentDef)
 {
     orig(self, equipmentDef);
     if (equipmentDef.equipmentIndex == catalogIndex)
     {
         var LocalUserList  = LocalUserManager.readOnlyLocalUsersList;
         var localUser      = LocalUserList[0];
         var inventoryCount = localUser.cachedBody.inventory.GetItemCount(SpiceTally);
         var index          = Mathf.Min(inventoryCount, SpiceDescArray.Length - 1);
         self.descriptionText.token = SpiceDescArray[index];
     }
 }
Esempio n. 2
0
 private void ChangePickupText(OnGenericNotification.orig_SetEquipment orig, RoR2.UI.GenericNotification self, EquipmentDef equipmentDef)
 {
     orig(self, equipmentDef);
     if (equipmentDef == instance.EquipmentDef)
     {
         var localUser = LocalUserManager.readOnlyLocalUsersList[0];
         if (localUser != null && localUser.cachedMaster?.inventory)
         {
             var inventoryCount = localUser.cachedMaster.inventory.GetItemCount(Items.SpiceTally.instance.ItemDef);
             var index          = Mathf.Min(inventoryCount, SpiceDescArray.Length - 1);
             self.descriptionText.token = SpiceDescArray[index];
         }
     }
 }