Browse Source

商城物品来源

zhaoyang 2 years ago
parent
commit
3eaa15cde8

+ 90 - 34
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -19,7 +19,7 @@ namespace GFGEditor
         public static void startScan()
         public static void startScan()
         {
         {
             ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
             ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
-            GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetStoryLevelApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckGiftBagApproach, CheckShopExchangeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, GetZhaiXingApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach };
+            GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetStoryLevelApproach, CheckStoreApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, GetZhaiXingApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach };
             Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
             Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
             int suitPartTotalCount = 0;
             int suitPartTotalCount = 0;
             foreach (ItemCfg cfg in dataArray)
             foreach (ItemCfg cfg in dataArray)
@@ -41,7 +41,7 @@ namespace GFGEditor
                 //套装
                 //套装
                 foreach (var a in suitDic)
                 foreach (var a in suitDic)
                 {
                 {
-                    if(a.Key.isHide <= 0)
+                    if (a.Key.isHide <= 0)
                     {
                     {
                         suitPartTotalCount += a.Value.Count;
                         suitPartTotalCount += a.Value.Count;
                     }
                     }
@@ -80,7 +80,7 @@ namespace GFGEditor
             {
             {
                 return;
                 return;
             }
             }
-            if(itemCfg.itemType == ConstItemType.DRESS_UP)
+            if (itemCfg.itemType == ConstItemType.DRESS_UP)
             {
             {
                 suitDic.TryGetValue(suitCfg, out var partsList);
                 suitDic.TryGetValue(suitCfg, out var partsList);
                 if (partsList == null)
                 if (partsList == null)
@@ -95,6 +95,10 @@ namespace GFGEditor
 
 
         private static void HandleItemApproch(ItemCfg cfg, GetApproachCall[] actions)
         private static void HandleItemApproch(ItemCfg cfg, GetApproachCall[] actions)
         {
         {
+            if (cfg.id == 3000001 || cfg.id == 3000002 || cfg.id == 3000003)
+            {
+                ET.Log.Debug("");
+            }
             List<string> approachs = new List<string>();
             List<string> approachs = new List<string>();
             foreach (GetApproachCall action in actions)
             foreach (GetApproachCall action in actions)
             {
             {
@@ -265,7 +269,7 @@ namespace GFGEditor
             {
             {
                 return null;
                 return null;
             }
             }
-            if(itemCfg.itemType != ConstItemType.DRESS_UP)
+            if (itemCfg.itemType != ConstItemType.DRESS_UP)
             {
             {
                 return null;
                 return null;
             }
             }
@@ -407,44 +411,86 @@ namespace GFGEditor
             return false;
             return false;
         }
         }
         /// <summary>
         /// <summary>
-        /// 检测商城-礼包是否产出该物品
+        /// 检测商城-金卡是否产出该物品
         /// </summary>
         /// </summary>
         /// <param name="itemId"></param>
         /// <param name="itemId"></param>
         /// <returns></returns>
         /// <returns></returns>
-        private static string CheckGiftBagApproach(int itemId)
+        private static string CheckStoreApproach(int itemId)
         {
         {
-            // GiftBagCfgArray manager = GiftBagCfgArray.Instance;
-            // GiftBagCfg[] dataArray = manager.dataArray;
-            // for (int i = 0; i < dataArray.Length; i++)
-            // {
-            //     for (int j = 0; j < dataArray[i].itemsArr.Length; j++)
-            //     {
-            //         if (dataArray[i].itemsArr[j][0] == itemId)
-            //         {
-            //             return ConstFunctionId.SHOP_GIFT_BAG + "=1";
-            //         }
-            //     }
-            // }
+            List<string> approachs = new List<string>();
+            List<ShopCfg> goldShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD);
+            for (int i = 0; i < goldShopCfgs.Count; i++)
+            {
+                if (CheckIsHasItem(itemId, goldShopCfgs[i].itemId))
+                {
+                    approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_MONTH_CARD + "=" + ConstStoreSubId.STORE_MONTH_GOLD_CARD);
+                    break;
+                }
+            }
+
+            List<ShopCfg> blackShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD);
+            for (int i = 0; i < blackShopCfgs.Count; i++)
+            {
+                if (CheckIsHasItem(itemId, blackShopCfgs[i].itemId))
+                {
+                    approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_MONTH_CARD + "=" + ConstStoreSubId.STORE_MONTH_BLACK_CARD);
+                    break;
+                }
+            }
+
+            List<ShopCfg> itemShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_TIME_LIMIT);
+            for (int i = 0; i < itemShopCfgs.Count; i++)
+            {
+                if (CheckIsHasItem(itemId, itemShopCfgs[i].itemId))
+                {
+                    approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_GIFT_BAG + "=" + ConstStoreSubId.STORE_GIFT_BAG_TIME_LIMIT);
+                    break;
+                }
+            }
+
+
+            List<ShopCfg> greatestShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_GREATEST);
+            for (int i = 0; i < greatestShopCfgs.Count; i++)
+            {
+                if (CheckIsHasItem(itemId, greatestShopCfgs[i].itemId))
+                {
+                    approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_GIFT_BAG + "=" + ConstStoreSubId.STORE_GIFT_BAG_GREATEST);
+                    break;
+                }
+            }
+
+            List<ShopCfg> exchangetShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_EXCHANGE_LEAGUE);
+            for (int i = 0; i < exchangetShopCfgs.Count; i++)
+            {
+                if (CheckIsHasItem(itemId, exchangetShopCfgs[i].itemId))
+                {
+                    approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_EXCHANGE + "=" + ConstStoreSubId.STORE_EXCHANGE_LEAGUE);
+                    break;
+                }
+            }
+            if (approachs.Count > 0)
+            {
+                return string.Join(";", approachs);
+            }
             return null;
             return null;
         }
         }
-        /// <summary>
-        /// 检测商城-道具兑换是否产出该物品
-        /// </summary>
-        /// <param name="itemId"></param>
-        /// <returns></returns>
-        private static string CheckShopExchangeApproach(int itemId)
+        private static bool CheckIsHasItem(int itemId, int checkId)
         {
         {
-            // ShopExchangeCfgArray manager = ShopExchangeCfgArray.Instance;
-            // ShopExchangeCfg[] dataArray = manager.dataArray;
-            // for (int i = 0; i < dataArray.Length; i++)
-            // {
-            //     if (dataArray[i].itemId == itemId)
-            //     {
-            //         return ConstFunctionId.SHOP_EXCHANGE + "=2";
-            //     }
-            // }
-            return null;
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(checkId);
+            if (itemCfg.itemType == ConstItemType.USEABLE)
+            {
+                for (int i = 0; i < itemCfg.itemsArr.Length; i++)
+                {
+                    if (itemCfg.itemsArr[i][0] == itemId) return true;
+                }
+            }
+            else if (checkId == itemId)
+            {
+                return true;
+            }
+            return false;
         }
         }
+
         /// <summary>
         /// <summary>
         /// 检测服装升级是否产出该物品
         /// 检测服装升级是否产出该物品
         /// </summary>
         /// </summary>
@@ -504,6 +550,11 @@ namespace GFGEditor
 
 
             return null;
             return null;
         }
         }
+        /// <summary>
+        /// 检测雅集福利是否产出该物品
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <returns></returns>
         private static string GetLeaguePrayApproach(int itemId)
         private static string GetLeaguePrayApproach(int itemId)
         {
         {
             LeaguePrayCfg[] prayCfgs = LeaguePrayCfgArray.Instance.dataArray;
             LeaguePrayCfg[] prayCfgs = LeaguePrayCfgArray.Instance.dataArray;
@@ -526,6 +577,11 @@ namespace GFGEditor
             }
             }
             return null;
             return null;
         }
         }
+        /// <summary>
+        /// 检测雅集答题是否产出该物品
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <returns></returns>
         private static string GetLeagueAnswerApproach(int itemId)
         private static string GetLeagueAnswerApproach(int itemId)
         {
         {
             LeagueQuestionCfg[] questionCfgs = LeagueQuestionCfgArray.Instance.dataArray;
             LeagueQuestionCfg[] questionCfgs = LeagueQuestionCfgArray.Instance.dataArray;

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Constant/ConstStoreSubId.cs

@@ -7,8 +7,8 @@ namespace GFGGame
         public const int STORE_MONTH_GOLD_CARD = 0;//金卡
         public const int STORE_MONTH_GOLD_CARD = 0;//金卡
         public const int STORE_MONTH_BLACK_CARD = 1;//黑金卡
         public const int STORE_MONTH_BLACK_CARD = 1;//黑金卡
         public const int STORE_GIFT_BAG_ACTIVITY = 0;//活动
         public const int STORE_GIFT_BAG_ACTIVITY = 0;//活动
-        public const int STORE_GIFT_BAG_TIME_LIMIT = 1;//限时活动
-        public const int STORE_GIFT_BAG_GREATEST = 2;//精选
+        public const int STORE_GIFT_BAG_TIME_LIMIT = 1;//珍珠商城
+        public const int STORE_GIFT_BAG_GREATEST = 2;//材料商城
         public const int STORE_GIFT_BAG_HOT = 3;//热销
         public const int STORE_GIFT_BAG_HOT = 3;//热销
         public const int STORE_EXCHANGE_GALLERY = 0;//画廊商城
         public const int STORE_EXCHANGE_GALLERY = 0;//画廊商城
         public const int STORE_EXCHANGE_LEAGUE = 1;//雅集商城
         public const int STORE_EXCHANGE_LEAGUE = 1;//雅集商城

+ 14 - 0
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -125,6 +125,13 @@ namespace GFGGame
                     listItem.m_txtSourceName.text = "服装店";
                     listItem.m_txtSourceName.text = "服装店";
                 }
                 }
             }
             }
+            else if (functionId == ConstFunctionId.STORE)
+            {
+                int storeTabId = int.Parse(infos[1]);
+                int storeSubId = int.Parse(infos[2]);
+
+                listItem.m_txtSourceName.text = StoreTabCfgArray.Instance.GetCfg(storeTabId).subTabArr[storeSubId][0];
+            }
             else
             else
             {
             {
                 listItem.m_txtSourceName.text = gameFunctionCfg.name;
                 listItem.m_txtSourceName.text = gameFunctionCfg.name;
@@ -165,6 +172,13 @@ namespace GFGGame
                     // this.Hide();
                     // this.Hide();
                     isJump = ViewManager.Show<ClothingDecomposeView>(null, _fromeViewDatas);
                     isJump = ViewManager.Show<ClothingDecomposeView>(null, _fromeViewDatas);
                     break;
                     break;
+                case ConstFunctionId.STORE:
+
+                    int storeTabId = int.Parse(infos[1]);
+                    int storeSubId = int.Parse(infos[2]);
+
+                    isJump = ViewManager.Show<StoreView>(new object[] { storeTabId, storeSubId });
+                    break;
                 // case ConstFunctionId.SHOP_GIFT_BAG:
                 // case ConstFunctionId.SHOP_GIFT_BAG:
                 //     // this.Hide();
                 //     // this.Hide();
                 //     int giftBagValue = int.Parse(infos[1]);
                 //     int giftBagValue = int.Parse(infos[1]);