// Token: 0x06002357 RID: 9047 RVA: 0x0009A728 File Offset: 0x00098928
 private void AllocateIcons(int desiredItemCount)
 {
     if (desiredItemCount != this.itemIcons.Count)
     {
         while (this.itemIcons.Count > desiredItemCount)
         {
             UnityEngine.Object.Destroy(this.itemIcons[this.itemIcons.Count - 1].gameObject);
             this.itemIcons.RemoveAt(this.itemIcons.Count - 1);
         }
         while (this.itemIcons.Count < desiredItemCount)
         {
             ItemIcon component = UnityEngine.Object.Instantiate <GameObject>(this.itemIconPrefab, this.rectTransform).GetComponent <ItemIcon>();
             this.itemIcons.Add(component);
             this.LayoutIndividualIcon(this.itemIcons.Count - 1);
         }
     }
     this.OnIconCountChanged();
 }
Beispiel #2
0
        private void ItemIcon_SetItemIndex(On.RoR2.UI.ItemIcon.orig_SetItemIndex orig, RoR2.UI.ItemIcon self, ItemIndex newItemIndex, int newItemCount)
        {
            orig(self, newItemIndex, newItemCount);
            var itemDef = ItemCatalog.GetItemDef(newItemIndex);

            if (self.tooltipProvider != null && itemDef != null)
            {
                var itemDescription = !Language.IsTokenInvalid(itemDef.descriptionToken) ? Language.GetString(itemDef.descriptionToken) : Language.GetString(itemDef.pickupToken);
                itemDescription += "\n\n" + PickupStatProvider.ProvideItemStats(newItemIndex, newItemCount);
                self.tooltipProvider.overrideBodyText = itemDescription;
            }
        }
Beispiel #3
0
        internal void SetItemIndex(On.RoR2.UI.ItemIcon.orig_SetItemIndex orig, RoR2.UI.ItemIcon self, ItemIndex itemIndex, int itemCount)
        {
            orig(self, itemIndex, itemCount);

            self.tooltipProvider.bodyToken = ItemCatalog.GetItemDef(itemIndex).descriptionToken;
        }