コード例 #1
0
 private void Reverse()
 {
     foreach (ItemNodeUI itemNodeUi in this._shopRateViewer.itemListUI)
     {
         ShopViewer.ExtraPadding       extraData = itemNodeUi.extraData as ShopViewer.ExtraPadding;
         ShopViewer.ItemListController source    = extraData.source;
         StuffItem stuffItem = itemNodeUi.Item;
         if (source == this._shopViewer.controllers[0])
         {
             this._shopViewer.controllers[0].AddItem(stuffItem, extraData);
         }
         else if (source == this._shopViewer.controllers[1])
         {
             this._shopViewer.controllers[1].AddItem(stuffItem, extraData);
         }
         else
         {
             Debug.LogError((object)string.Format("ItemNode ExtraData not ShopViewer:{0}", (object)source));
         }
     }
     this._shopRateViewer.controller.Clear();
     foreach (ItemNodeUI itemNodeUi in this._shopSendViewer.itemListUI)
     {
         StuffItem stuffItem = itemNodeUi.Item;
         if (this._inventoryUI.itemList.AddItem(stuffItem))
         {
             this._inventoryUI.ItemListAddNode(this._inventoryUI.itemListUI.SearchNotUsedIndex, stuffItem);
             this._inventoryUI.ItemListNodeFilter(this._inventoryUI.categoryUI.CategoryID, true);
         }
     }
     this._shopSendViewer.controller.Clear();
     this._shopRateViewer.rateCounter.x = 0;
     this._shopRateViewer.rateCounter.y = 0;
 }
コード例 #2
0
        private void ItemReturnProc(
            int count,
            int sel,
            ShopViewer.ItemListController sender,
            ShopViewer.ItemListController receiver)
        {
            ItemNodeUI node = sender.itemListUI.GetNode(sel);

            MerchantData.VendorItem source = node.Item as MerchantData.VendorItem;
            StuffItem stuffItem            = this._shopInfoPanelUI.mode != ShopInfoPanelUI.Mode.Shop ? new StuffItem(node.Item) : (StuffItem) new MerchantData.VendorItem(source);

            stuffItem.Count = count;
            sender.RemoveItem(sel, stuffItem);
            ShopViewer.ExtraPadding extraData = node.extraData as ShopViewer.ExtraPadding;
            receiver = extraData.source;
            if (receiver != this._inventoryUI.controller)
            {
                receiver.AddItem(stuffItem, new ShopViewer.ExtraPadding(extraData.item, sender));
            }
            else if (this._inventoryUI.itemList.AddItem(stuffItem))
            {
                this._inventoryUI.ItemListAddNode(this._inventoryUI.itemListUI.SearchNotUsedIndex, stuffItem);
                this._inventoryUI.ItemListNodeFilter(this._inventoryUI.categoryUI.CategoryID, true);
            }
            bool flag1 = Object.op_Equality((Object)this._inventoryUI.itemListUI, (Object)receiver.itemListUI);

            if (!flag1)
            {
                receiver.itemListUI.Refresh();
            }
            bool flag2 = Object.op_Equality((Object)this._inventoryUI.itemListUI, (Object)sender.itemListUI);

            if (!flag2)
            {
                sender.itemListUI.Refresh();
            }
            if (flag1 || flag2)
            {
                this._inventoryUI.Refresh();
            }
            this._shopInfoPanelUI.Refresh();
            int num = node.Rate * count;

            if (sender == this._shopSendViewer.controller)
            {
                this._shopRateViewer.rateCounter.x -= num;
            }
            else
            {
                if (sender != this._shopRateViewer.controller)
                {
                    return;
                }
                this._shopRateViewer.rateCounter.y -= num;
            }
        }
コード例 #3
0
        private void ItemReturnProc(
            int count,
            int sel,
            ShopViewer.ItemListController sender,
            ShopViewer.ItemListController receiver)
        {
            ItemNodeUI node      = sender.itemListUI.GetNode(sel);
            StuffItem  stuffItem = new StuffItem(node.Item);

            stuffItem.Count = count;
            sender.RemoveItem(sel, stuffItem);
            ShopViewer.ExtraPadding extraData = node.extraData as ShopViewer.ExtraPadding;
            receiver = extraData.source;
            if (receiver != this._inventoryUI.controller)
            {
                receiver.AddItem(stuffItem, new ShopViewer.ExtraPadding(extraData.item, sender));
            }
            else if (this._inventoryUI.itemList.AddItem(stuffItem))
            {
                this._inventoryUI.ItemListAddNode(this._inventoryUI.itemListUI.SearchNotUsedIndex, stuffItem);
                this._inventoryUI.ItemListNodeFilter(this._inventoryUI.categoryUI.CategoryID, true);
            }
            bool flag1 = Object.op_Equality((Object)this._inventoryUI.itemListUI, (Object)receiver.itemListUI);

            if (!flag1)
            {
                receiver.itemListUI.Refresh();
            }
            bool flag2 = Object.op_Equality((Object)this._inventoryUI.itemListUI, (Object)sender.itemListUI);

            if (!flag2)
            {
                sender.itemListUI.Refresh();
            }
            if (flag1 || flag2)
            {
                this._inventoryUI.Refresh();
            }
            this._shopInfoPanelUI.Refresh();
            this.SendCheck();
        }