Browse Source

合成红点

zhaoyang 2 years ago
parent
commit
36f8c48c66

+ 46 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -371,7 +371,53 @@ namespace GFGGame
             }
             }
             return false;
             return false;
         }
         }
+        /// <summary>
+        /// 服装合成红点
+        /// </summary>
+        /// <returns></returns>
+        public bool GetClothingSyntheticRed()
+        {
+            return GetClothingSyntheticTabRed(1) || GetClothingSyntheticTabRed(2) || GetClothingSyntheticTabRed(3);
+        }
+        /// <summary>
+        /// 服装合成页签红点
+        /// </summary>
+        /// <param name="tab"></param>
+        /// <returns></returns>
+        public bool GetClothingSyntheticTabRed(int tab)
+        {
+            List<SuitCfg> suitCfgs = SuitCfgArray.Instance.GetCfgsBysyntheticType(tab);
+            for (int i = 0; i < suitCfgs.Count; i++)
+            {
+                bool isLevelPass = InstanceZonesDataManager.CheckLevelPass(suitCfgs[i].syntheticStoryLevelId);
+                if (!isLevelPass) continue;
+                if (GetClothingSyntheticRed(suitCfgs[i].id)) return true;
+            }
+            return false;
+        }
 
 
+        public bool GetClothingSyntheticRed(int suitId)
+        {
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
+            if (suitCfg == null) return false;
+            for (int i = 0; i < suitCfg.partsArr.Length; i++)
+            {
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(suitCfg.partsArr[i]);
+                if (ItemDataManager.GetItemNum(itemCfg.syntheticCostID) < itemCfg.syntheticCostNum) continue;
+
+                bool isEnough = true;
+                for (int j = 0; j < itemCfg.syntheticMateriarsArr.Length; j++)
+                {
+                    if (ItemDataManager.GetItemNum(itemCfg.syntheticMateriarsArr[j][0]) < itemCfg.syntheticMateriarsArr[j][1])
+                    {
+                        isEnough = false;
+                        break;
+                    }
+                }
+                if (isEnough) return true;
+            }
+            return false;
+        }
         /// <summary>
         /// <summary>
         /// 商城
         /// 商城
         /// </summary>
         /// </summary>

+ 12 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/SuitSyntheticView.cs

@@ -43,6 +43,7 @@ namespace GFGGame
         {
         {
             base.AddEventListener();
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.SUIT_BOX_STATUS_CHANGED, UpdateSuitBoxStatus);
             EventAgent.AddEventListener(ConstMessage.SUIT_BOX_STATUS_CHANGED, UpdateSuitBoxStatus);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -57,6 +58,7 @@ namespace GFGGame
             }
             }
             // _ui.m_listMenu.GetChildAt(1).visible = false;
             // _ui.m_listMenu.GetChildAt(1).visible = false;
             UpdateSuitList();
             UpdateSuitList();
+            UpdateRedDot();
             Timers.inst.AddUpdate(CheckGuide);
             Timers.inst.AddUpdate(CheckGuide);
         }
         }
 
 
@@ -70,6 +72,7 @@ namespace GFGGame
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.SUIT_BOX_STATUS_CHANGED, UpdateSuitBoxStatus);
             EventAgent.RemoveEventListener(ConstMessage.SUIT_BOX_STATUS_CHANGED, UpdateSuitBoxStatus);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         private void OnClickBtnBack()
         private void OnClickBtnBack()
         {
         {
@@ -168,6 +171,7 @@ namespace GFGGame
                     ViewManager.Show(ViewName.CLOTHING_SYNTHETIC_VIEW, new object[] { suitId }, new object[] { ViewName.SUIT_SYNTHETIC_LIST_VIEW, suitId });
                     ViewManager.Show(ViewName.CLOTHING_SYNTHETIC_VIEW, new object[] { suitId }, new object[] { ViewName.SUIT_SYNTHETIC_LIST_VIEW, suitId });
                 }
                 }
             });
             });
+            RedDotController.Instance.SetComRedDot(listItem.target, RedDotDataManager.Instance.GetClothingSyntheticRed(suitId), "", 0, 0);
             UI_SuitListItem.ProxyEnd();
             UI_SuitListItem.ProxyEnd();
         }
         }
 
 
@@ -206,6 +210,14 @@ namespace GFGGame
                 RedDotController.Instance.SetComRedDot(listItem.target, false, "", -20, 670);
                 RedDotController.Instance.SetComRedDot(listItem.target, false, "", -20, 670);
             }
             }
         }
         }
+
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(0).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(1), "", 0, 0);
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(1).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(2), "", 0, 0);
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(2).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(3), "", 0, 0);
+        }
+
         private void CheckGuide(object param)
         private void CheckGuide(object param)
         {
         {
             if (GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_SYNTHETIC) <= 0)
             if (GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_SYNTHETIC) <= 0)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -1024,7 +1024,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnBag, RedDotDataManager.Instance.GetMainBagGiftRed());
             RedDotController.Instance.SetComRedDot(_btnBag, RedDotDataManager.Instance.GetMainBagGiftRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnActivityDay7.target, RedDotDataManager.Instance.GetActivityDay7Red());
             RedDotController.Instance.SetComRedDot(_ui.m_btnActivityDay7.target, RedDotDataManager.Instance.GetActivityDay7Red());
 
 
-            RedDotController.Instance.SetComRedDot(_ui.m_btnXiuFang.target, RedDotDataManager.Instance.GetClothingFosterRed(), "", -10, 20);
+            RedDotController.Instance.SetComRedDot(_ui.m_btnXiuFang.target, RedDotDataManager.Instance.GetClothingFosterRed() || RedDotDataManager.Instance.GetClothingSyntheticRed(), "", -10, 20);
         }
         }
 
 
         private void CheckGuide(object param)
         private void CheckGuide(object param)

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/XiuFang/XiuFangView.cs

@@ -123,6 +123,7 @@ namespace GFGGame
         private void UpdateRedDot()
         private void UpdateRedDot()
         {
         {
             RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnClothingUpgrade.target, RedDotDataManager.Instance.GetClothingFosterRed(), "", 0, 200);
             RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnClothingUpgrade.target, RedDotDataManager.Instance.GetClothingFosterRed(), "", 0, 200);
+            RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnSuitSynthetic.target, RedDotDataManager.Instance.GetClothingSyntheticRed(), "", 0, 200);
         }
         }
 
 
         protected override void UpdateToCheckGuide(object param)
         protected override void UpdateToCheckGuide(object param)