浏览代码

常驻礼包加入红点

何晓捷 2 年之前
父节点
当前提交
3129dab6dc

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

@@ -808,5 +808,47 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 常驻礼包是否有需要领取的金币
+        /// </summary>
+        /// <returns></returns>
+        public bool GetGoldRed()
+        {
+            var shopCfgList = ShopCfgArray.Instance
+                .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_GOLD)
+                .OrderBy(a => a.refreshType).ToList();
+            foreach (var shopCfg in shopCfgList)
+            {
+                var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
+                if (weekGiftBoxState)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+        
+        /// <summary>
+        /// 常驻礼包是否有需要领取的体力
+        /// </summary>
+        /// <returns></returns>
+        public bool GetPowerRed()
+        {
+            var shopCfgList = ShopCfgArray.Instance
+                .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_POWER)
+                .OrderBy(a => a.refreshType).ToList();
+            foreach (var shopCfg in shopCfgList)
+            {
+                var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
+                if (weekGiftBoxState)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
     }
 }

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -173,6 +173,12 @@ namespace GFGGame
             _valueBar.m_list.numItems = itemIds.Count;
         }
 
+        public void UpRead()
+        {
+            RedDotController.Instance.SetComRedDot(_valueBar.m_btnPower.target, RedDotDataManager.Instance.GetPowerRed());
+            RedDotController.Instance.SetComRedDot(_valueBar.m_btnGold.target, RedDotDataManager.Instance.GetGoldRed());
+        }
+
         private void RenderListItem(int index, GObject obj)
         {
             int itemId = (obj.parent.data as List<int>)[index];

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs

@@ -294,6 +294,8 @@ namespace GFGGame
 
                 numItems = childItemCfg.param1Arr.Length;
 
+                //领取加红点
+                RedDotController.Instance.SetComRedDot(item.m_btnCurReceive.target, weekGiftBoxState);
                 //是否需要领取
                 if (weekGiftBoxState)
                 {
@@ -376,6 +378,7 @@ namespace GFGGame
                 GuideController.TryCompleteGuideIndex(ConstGuideId.BUY_POWER, 1);
                 GuideController.TryCompleteGuide(ConstGuideId.BUY_POWER, 1);
             }
+
             GObject sender = context.sender as GObject;
             GObject obj = sender.parent;
             ShopCfg cfg = obj.data as ShopCfg;
@@ -549,10 +552,12 @@ namespace GFGGame
             // Dispose();
             this.Hide();
         }
+
         private void CheckGuide()
         {
             Timers.inst.AddUpdate(CheckGuide);
         }
+
         private void CheckGuide(object param)
         {
             if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_POWER) <= 0)
@@ -570,9 +575,9 @@ namespace GFGGame
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
             if (_itemId == ConstItemID.POWER)
             {
-                GuideController.TryGuide(_ui.m_list.GetChildAt(1).asCom.GetChild("btnCurReceive").asButton, ConstGuideId.BUY_POWER, 1, "花点小钱可以购买体力超值返利包,每天都能领体力哦~");
+                GuideController.TryGuide(_ui.m_list.GetChildAt(1).asCom.GetChild("btnCurReceive").asButton,
+                    ConstGuideId.BUY_POWER, 1, "花点小钱可以购买体力超值返利包,每天都能领体力哦~");
             }
-
         }
     }
 }

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

@@ -1008,6 +1008,7 @@ namespace GFGGame
 
         private void UpdateRedDot()
         {
+            _valueBarController.UpRead();
             RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed());
             RedDotController.Instance.SetComRedDot(_btnRenWu, RedDotDataManager.Instance.GetTaskRed());
             // RedDotController.Instance.SetComRedDot(_ui.m_btnDailyLogin.target,