Пример #1
0
 public void Set(ContainerBoxItem item, bool selectionIsOn)
 {
     this.Item = item;
     this.dataProvider.ClearItems();
     this._itemBuffer.AddRange(item.Content);
     this._itemBuffer.Sort(this._comparer);
     if (!selectionIsOn)
     {
         this.dataProvider.Init <GarageItem>(this._itemBuffer);
     }
     else
     {
         GarageItem selected = this._itemBuffer.First <GarageItem>();
         this.dataProvider.Init <GarageItem>(this._itemBuffer, selected);
         selected.Select();
     }
     this._itemBuffer.Clear();
     this.containerDescription.text = item.GetLocalizedDescription(item.MarketItem.Id);
     base.GetComponentInChildren <ScrollRect>().verticalNormalizedPosition = 1f;
 }
Пример #2
0
        private void ContainerSelected(GarageItemUI item)
        {
            ContainerBoxItem item2 = item.Item as ContainerBoxItem;

            this.openText.text = this.openContainer.Value;
            this.selected      = item2;
            this.amount.text   = string.Format(this.Pluralize(item2.Count), item2.Count);
            this.title.text    = item2.Name;
            bool flag = item.Item.MarketItem.HasComponent <GameplayChestItemComponent>();

            this.openButtonText.text = (!flag || (item2.Count <= 1)) ? this.openContainer.Value : this.openAllContainers.Value;
            this.openContainerBlock.GetComponent <Animator>().SetBool("Visible", item2.Count > 0);
            if (item2.Price <= 0)
            {
                this.buyButton.gameObject.SetActive(false);
            }
            else
            {
                this.buyButton.gameObject.SetActive(true);
                this.buyButton.Init(1, item2.OldPrice, item2.Price);
            }
            int index = 0;
            Dictionary <int, int> packXPrices = item2.PackXPrices;

            if (packXPrices != null)
            {
                List <BuyContainerButton> list = new List <BuyContainerButton>();
                foreach (KeyValuePair <int, int> pair in packXPrices)
                {
                    BuyContainerButton button = this.xBuyButtons[index];
                    button.gameObject.SetActive(true);
                    button.Init(pair.Key, pair.Key * item2.XPrice, pair.Value);
                    list.Add(button);
                    index++;
                }
                if (< > f__am$cache0 == null)
                {