zhaoyang il y a 2 ans
Parent
commit
8ddd40c232

+ 1 - 1
FGUIProject/assets/ClothingDecompose/ClothingDecomposeUI.xml

@@ -27,7 +27,7 @@
     </list>
     <text id="n21_qyr6" name="txtNone" xy="380,736" size="256,49" fontSize="36" color="#cfbf9c" vars="true" text="暂无物品可分解"/>
     <text id="n11_wlc2" name="txtShow" xy="301,1150" size="478,44" fontSize="32" color="#917960" align="center" ubb="true" autoSize="none" text="分解0件凡品可获得"/>
-    <text id="n30_lrpa" name="n30" xy="300,1190" size="480,39" fontSize="28" color="#da826e" align="center" ubb="true" text="(未合成的套装材料不会被分解哦!)"/>
+    <text id="n30_lrpa" name="n30" xy="300,1190" size="480,39" visible="false" fontSize="28" color="#da826e" align="center" ubb="true" text="(未合成的套装材料不会被分解哦!)"/>
     <list id="n12_wlc2" name="listReward" xy="36,1238" size="1008,242" layout="row" colGap="70" defaultItem="ui://h9mv1l71wlc24" align="center" autoClearItems="true">
       <item/>
       <item/>

+ 29 - 4
GameClient/Assets/Game/HotUpdate/Data/DecomposeDataManager.cs

@@ -5,13 +5,14 @@ namespace GFGGame
     public class DecomposeDataManager : SingletonBase<DecomposeDataManager>
     {
         Dictionary<int, List<int>> _decomposeData = new Dictionary<int, List<int>>();//所有数量大于1的换装部件数据
-        Dictionary<int, List<int>> _suitSyntheticMaterias = new Dictionary<int, List<int>>();//suitId,materiasId
+        Dictionary<int, List<int>> _suitSyntheticMaterials = new Dictionary<int, List<int>>();//materiasId,Lsit<suitId>
         List<int> _rewardList = new List<int>();
 
         public const int MaxCount = 999;
         public void Clear()
         {
             _decomposeData.Clear();
+            _suitSyntheticMaterials.Clear();
         }
         public void Add(int itemId)
         {
@@ -74,15 +75,39 @@ namespace GFGGame
             suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(1)));
             suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(2)));
             suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(3)));
+
             for (int i = 0; i < suitCfgs.Count; i++)
             {
+                int suitId = suitCfgs[i].id;
+                for (int j = 0; j < suitCfgs[i].partsArr.Length; j++)
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(suitCfgs[i].partsArr[j]);
 
+                    for (int k = 0; k < itemCfg.syntheticMateriarsArr.Length; k++)
+                    {
+                        int materialId = itemCfg.syntheticMateriarsArr[k][0];
+                        if (!_suitSyntheticMaterials.ContainsKey(materialId))
+                        {
+                            _suitSyntheticMaterials[materialId] = new List<int>();
+                        }
+                        if (_suitSyntheticMaterials[materialId].IndexOf(suitId) < 0) _suitSyntheticMaterials[materialId].Add(suitId);
+                    }
+                }
             }
         }
-        public bool CheckIsSyntheticMaterias()
+        /// <summary>
+        /// 检测物品对应的套装是否全部合成
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <returns></returns>
+        public bool CheckIsItemForSuitSynthetic(int itemId)
         {
-
-            return false;
+            if (!_suitSyntheticMaterials.ContainsKey(itemId)) return true;
+            for (int i = 0; i < _suitSyntheticMaterials[itemId].Count; i++)
+            {
+                if (!DressUpMenuSuitDataManager.CheckHaveSuit(_suitSyntheticMaterials[itemId][i])) return false;
+            }
+            return true;
         }
     }
 }

+ 7 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -62,6 +62,8 @@ namespace GFGGame
             _ui.m_listReward.itemRenderer = ListRewardItemRander;
             _ui.m_listReward.onClickItem.Add(OnClickListRewardItem);
 
+            // DecomposeDataManager.Instance.InitSuitSyntheticMaterias();
+
 
         }
 
@@ -147,7 +149,7 @@ namespace GFGGame
                 PromptController.Instance.ShowFloatTextPrompt("已达到单次可分解上限,请分批操作");
                 return;
             }
-            // if ()
+            // if (!DecomposeDataManager.Instance.CheckIsItemForSuitSynthetic(itemId))
             // {
             //     PromptController.Instance.ShowFloatTextPrompt("这是套装合成材料,先别分解了吧!");
             //     return;
@@ -208,6 +210,10 @@ namespace GFGGame
             for (int i = 0; i < _clothingDatas.Count; i++)
             {
                 int itemId = _clothingDatas[i];
+                // if (!DecomposeDataManager.Instance.CheckIsItemForSuitSynthetic(itemId))
+                // {
+                //     continue;
+                // }
                 long itemHasCount = DecomposeDataManager.Instance.ItemCanDecomposeCount(itemId);
                 long itemLastCount = _decomposeData.ContainsKey(itemId) ? itemHasCount - _decomposeData[itemId] : itemHasCount;
 

BIN
GameClient/Assets/ResIn/UI/ClothingDecompose/ClothingDecompose_fui.bytes