Browse Source

打开从背包使用物品的逻辑

hexiaojie 1 năm trước cách đây
mục cha
commit
2491d350bf
1 tập tin đã thay đổi với 18 bổ sung7 xóa
  1. 18 7
      GameClient/Assets/Game/HotUpdate/Views/Bag/BagView.cs

+ 18 - 7
GameClient/Assets/Game/HotUpdate/Views/Bag/BagView.cs

@@ -32,6 +32,7 @@ namespace GFGGame
                 _ui.Dispose();
                 _ui = null;
             }
+
             base.Dispose();
         }
 
@@ -107,10 +108,10 @@ namespace GFGGame
             item.m_txtName.text = itemCfg.name;
             //是礼包就加入红点
             if (((itemCfg.itemType == ConstItemType.USEABLE &&
-                 itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_SELECTABLE) ||
-                (itemCfg.itemType == ConstItemType.USEABLE &&
-                 itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_RANDOM))
-                 && itemData.id != 6003001 && itemData.id != 6003002)
+                  itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_SELECTABLE) ||
+                 (itemCfg.itemType == ConstItemType.USEABLE &&
+                  itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_RANDOM))
+                && itemData.id != 6003001 && itemData.id != 6003002)
             {
                 RedDotController.Instance.SetComRedDot(item.target, true);
             }
@@ -118,6 +119,7 @@ namespace GFGGame
             {
                 RedDotController.Instance.SetComRedDot(item.target, false);
             }
+
             UI_ComItem.ProxyEnd();
         }
 
@@ -141,9 +143,18 @@ namespace GFGGame
             }
             else
             {
-                object[] sourceDatas = new object[]
-                    { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
-                GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
+                var bagExchangeCfg = BagExchangeCfgArray.Instance.GetCfg(itemCfg.id);
+                if (bagExchangeCfg != null)
+                {
+					//从背包使用物品
+                    ViewManager.Show<BagExchangeView>(itemCfg.id);
+                }
+                else
+                {
+                    object[] sourceDatas = new object[]
+                        { itemCfg.id, new object[] { typeof(BagView).FullName, this.viewData } };
+                    GoodsItemTipsController.ShowItemTips(itemCfg.id, sourceDatas);
+                }
             }
         }