Exemplo n.º 1
0
 private IEnumerator ItemListUISettingCoroutine(
     ItemListController listCon,
     PanelType panelType)
 {
     // ISSUE: object of a compiler-generated type is created
     return((IEnumerator) new RecyclingUI.\u003CItemListUISettingCoroutine\u003Ec__Iterator2()
     {
         listCon = listCon
     });
 }
Exemplo n.º 2
0
 public void SetItemInfo(
     ItemListController sender,
     ItemListController receiver,
     ItemNodeUI nodeUI,
     int currentID,
     ButtonType buttonType)
 {
     this.ItemInfo.Item1 = (__Null)sender;
     this.ItemInfo.Item2 = (__Null)receiver;
     this.ItemInfo.Item3 = (__Null)nodeUI;
     this.ItemInfo.Item4 = (__Null)currentID;
     this.ItemInfo.Item5 = (__Null)buttonType;
 }
Exemplo n.º 3
0
 private void NonSelection(ItemListController con)
 {
     if (con == null || this.ListControllers.IsNullOrEmpty <ItemListController>())
     {
         return;
     }
     foreach (ItemListController listController in this.ListControllers)
     {
         if (listController != null && listController != con)
         {
             listController.itemListUI.ForceSetNonSelect();
         }
     }
 }
Exemplo n.º 4
0
        public void AttachItem(
            ItemListController sender,
            ItemListController receiver,
            int currentID,
            ItemNodeUI itemUI,
            ButtonType buttonType)
        {
            this.ClearItemInfo();
            if (sender == null || receiver == null)
            {
                this.IsActiveControl = false;
            }
            else if (!Singleton <Resources> .IsInstance() || Object.op_Equality((Object)itemUI, (Object)null) || (itemUI.Item == null || itemUI.Item.Count <= 0))
            {
                this.IsActiveControl = false;
            }
            else
            {
                StuffItem     stuffItem     = itemUI.Item;
                StuffItemInfo stuffItemInfo = Singleton <Resources> .Instance.GameInfo.GetItem(stuffItem.CategoryID, stuffItem.ID);

                if (stuffItemInfo == null)
                {
                    this.IsActiveControl = false;
                }
                else
                {
                    this.SetItemInfo(sender, receiver, itemUI, currentID, buttonType);
                    this.InputNumber = 1;
                    this.RefreshUI();
                    this._itemNameText.set_text(stuffItemInfo.Name);
                    this._flavorText.set_text(stuffItemInfo.Explanation);
                    int num = (int)buttonType;
                    for (int index = 0; index < this._buttons.Length; ++index)
                    {
                        Button element = this._buttons.GetElement <Button>(index);
                        if (!Object.op_Equality((Object)element, (Object)null) && ((Component)element).get_gameObject().get_activeSelf() != (index == num))
                        {
                            ((Component)element).get_gameObject().SetActive(index == num);
                        }
                    }
                    this.IsActiveControl = true;
                }
            }
        }
Exemplo n.º 5
0
 private void RefreshSendButtonInteractable()
 {
     if (this._buttons.IsNullOrEmpty <Button>())
     {
         return;
     }
     if (!this.IsNumberInput)
     {
         this.SetInteractableSendButton(false);
     }
     else
     {
         StuffItem          stuffItem          = !Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null) ? (StuffItem)null : ((ItemNodeUI)this.ItemInfo.Item3).Item;
         ItemListController itemListController = (ItemListController)this.ItemInfo.Item2;
         if (stuffItem == null || itemListController == null)
         {
             this.SetInteractableSendButton(false);
         }
         else
         {
             this.SetInteractableSendButton(this.InputNumber <= itemListController.PossibleCount(stuffItem));
         }
     }
 }
Exemplo n.º 6
0
 public ExtraPadding(StuffItem item, ItemListController source)
 {
     this.item   = item;
     this.source = source;
 }
Exemplo n.º 7
0
        public void SendItem(
            int count,
            PanelType panelType,
            ItemListController sender,
            ItemListController receiver,
            int currentID,
            ItemNodeUI nodeUI)
        {
            if (sender == null || receiver == null || (Object.op_Equality((Object)nodeUI, (Object)null) || nodeUI.Item == null) || (count <= 0 || nodeUI.Item.Count <= 0))
            {
                return;
            }
            StuffItem stuffItem1 = new StuffItem(nodeUI.Item);

            stuffItem1.Count = Mathf.Min(count, nodeUI.Item.Count);
            int num = receiver.AddItem(stuffItem1);

            if (num <= 0)
            {
                return;
            }
            switch (panelType)
            {
            case PanelType.Pouch:
            case PanelType.Chest:
                if (this.SelectedInventoryUI != null)
                {
                    List <StuffItem> itemList   = this.SelectedInventoryUI.itemList;
                    ItemListUI       itemListUi = this.SelectedInventoryUI.itemListUI;
                    StuffItem        stuffItem2 = itemList.Find((Predicate <StuffItem>)(x => x == nodeUI.Item));
                    if (stuffItem2 != null)
                    {
                        stuffItem2.Count -= num;
                        if (stuffItem2.Count <= 0)
                        {
                            itemList.Remove(stuffItem2);
                            itemListUi.RemoveItemNode(currentID);
                            itemListUi.ForceSetNonSelect();
                            this._infoPanelUI.DetachItem();
                        }
                        Action refreshEvent = sender.RefreshEvent;
                        if (refreshEvent != null)
                        {
                            refreshEvent();
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;

            case PanelType.DecidedItem:
            case PanelType.CreatedItem:
                if (sender.RemoveItem(currentID, new StuffItem(nodeUI.Item)
                {
                    Count = num
                }) <= 0)
                {
                    this._infoPanelUI.DetachItem();
                }
                if (this.SelectedInventoryUI != null && Object.op_Inequality((Object)this.SelectedInventoryUI.itemListUI, (Object)null))
                {
                    Action refreshEvent = this.SelectedInventoryUI.ListController.RefreshEvent;
                    if (refreshEvent != null)
                    {
                        refreshEvent();
                        break;
                    }
                    break;
                }
                break;
            }
            this.OnSendItem.OnNext(stuffItem1);
        }