Exemple #1
0
        public void ItemClick()
        {
            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);

                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new DepotItemClickEvent();
                        e.BagId   = itemData.BagId;
                        e.Index   = itemData.Index;
                        e.TableId = itemData.ItemId;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Exemple #2
0
        public void ItemClick()
        {
            if (listItemLogic != null)
            {
                var itemData = listItemLogic.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    //PackItemClickEvent e = new PackItemClickEvent();
                    //e.BagId = itemData.BagId;
                    //e.Index = listItemLogic.Index;
                    //EventDispatcher.Instance.DispatchEvent(e);
                    if (itemData.BagId == (int)eBagType.Equip)
                    {
                        var ee = new UIEvent_RecycleItemSelect();
                        ee.Item = itemData;
                        ee.type = 0;
                        EventDispatcher.Instance.DispatchEvent(ee);
                    }
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Exemple #3
0
        public void ItemClick()
        {
            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);
                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new PackItemClickEvent();
                        e.BagId   = itemData.BagId;
                        e.Index   = itemList.Index;
                        e.TableId = itemData.ItemId;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                    else
                    {
                        if (UIManager.GetInstance().GetController(UIConfig.ChestInfoUI).State == FrameState.Open)
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else
                        {
                            var e = new UIEvent_ClickChest(itemData.ItemId);
                            //e.Args.Tab = itemData.ItemId;
                            e.From         = "Bag";
                            e.BagDataModel = itemData;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                    }

                    //var e = new PackItemClickEvent();
                    //e.BagId = itemData.BagId;
                    //e.Index = itemList.Index;
                    //EventDispatcher.Instance.DispatchEvent(e);
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Exemple #4
0
        public void ItemClick()
        {
            var item = listItemLogic.Item as BagItemDataModel;

            if (item.ItemId != -1)
            {
                var e = new UIEvent_TradingBagItemClick(item);
                EventDispatcher.Instance.DispatchEvent(e);
            }
            else
            {
                if (item.Status == (int)eBagItemType.Lock)
                {
                    var e = new PackUnlockEvent(item);
                    EventDispatcher.Instance.DispatchEvent(e);
                }
            }
        }
Exemple #5
0
        public void ItemClick()
        {
            var conler   = UIManager.Instance.GetController(UIConfig.BackPackUI);
            var packType = "";

            if (conler != null)
            {
                packType = conler.CallFromOtherClass("GetPackType", null).ToString();
            }

            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;
                var index    = itemList.Index;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);

                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new DonateItemClickEvent();
                        e.BagId     = itemData.BagId;
                        e.Index     = itemData.Index;
                        e.TableId   = itemData.ItemId;
                        e.ItemIndex = index;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Exemple #6
0
        public void ItemClick()
        {
            var conler   = UIManager.Instance.GetController(UIConfig.BackPackUI);
            var packType = "";

            if (conler != null)
            {
                packType = conler.CallFromOtherClass("GetPackType", null).ToString();
            }

            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);

                    ///时装特殊处理
                    if (tbItem.Type == 10500 || tbItem.Type == 10501 || tbItem.Type == 10502)
                    {
                        var e = new ShiZhuangItemUseEvent();
                        e.ItemData = itemData;
                        EventDispatcher.Instance.DispatchEvent(e);
                        return;
                    }

                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new PackItemClickEvent();
                        e.BagId   = itemData.BagId;
                        e.Index   = itemList.Index;
                        e.TableId = itemData.ItemId;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                    else
                    {
                        if (UIManager.GetInstance().GetController(UIConfig.ChestInfoUI).State == FrameState.Open)
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else if (packType == "Depot")
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else
                        {
                            Debug.Log(packType.ToString());
                            var e = new UIEvent_ClickChest(itemData.ItemId);
                            //e.Args.Tab = itemData.ItemId;
                            e.From         = "Bag";
                            e.BagDataModel = itemData;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                    }

                    //var e = new PackItemClickEvent();
                    //e.BagId = itemData.BagId;
                    //e.Index = itemList.Index;
                    //EventDispatcher.Instance.DispatchEvent(e);
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }