Browse Source

阳春花蔓添加红点显示

huangxiaoyue 1 year ago
parent
commit
2372fa524f

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

@@ -816,6 +816,21 @@ namespace GFGGame
             }
             return false;
         }
+        /// <summary>
+        /// 限时抽奖剧情奖励
+        /// </summary>
+        /// <returns></returns>
+        public bool GetActLuckyBoxStudioFilingRed()
+        {
+            if (ActivityDataManager.Instance.actLuckyBoxId <= 0) return false;
+            var filingChapterId = StudioDataManager.Instance.GetLuckyBoxActivityID();
+            StudioDataManager.Instance.filingChapterId = filingChapterId;
+            var studioCfg = StudioCfgArray.Instance.GetCfg(filingChapterId);
+            RoleLimitData limitData = RoleLimitDataManager.GetLimitData(studioCfg.limit);
+            if (StudioDataManager.Instance.GetStudioFilingRewardRed() || limitData.TotalPlayMax - limitData.PlayTimes > 0)
+                return true;
+            return false;
+        }
 
         /// <summary>
         /// 开服活动(神都宸游)

+ 14 - 0
GameClient/Assets/Game/HotUpdate/Data/StudioDataManager.cs

@@ -242,5 +242,19 @@ namespace GFGGame
             return luckyBoxFilingChapterId;
         }
 
+
+        public bool GetStudioFilingRewardRed()
+        {
+            var rewardList = StudioDataManager.Instance.GetFilingRewardList(StudioDataManager.Instance.filingChapterId);
+            for (int i = 0; i < rewardList.Count; i++) { 
+                if (i < rewardList.Count && rewardList[i] == ConstBonusStatus.CAN_GET)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
     }
 }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxView.cs

@@ -133,6 +133,7 @@ namespace GFGGame
                 , RedDotDataManager.Instance.GetMeiRiTeHuiRed() || RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitLuckyBox) 
                 || RedDotDataManager.Instance.GetGiftBagRewardRed(), "", -36, 39);
             RedDotController.Instance.SetComRedDot(_ui.m_btnTask.target, RedDotDataManager.Instance.GetActLuckyBoxTaskdRed());
+            RedDotController.Instance.SetComRedDot(_ui.m_btnChapter.target, RedDotDataManager.Instance.GetActLuckyBoxStudioFilingRed());
         }
 
         private void UpdateEffect()

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

@@ -951,7 +951,7 @@ namespace GFGGame
             if (redPointUpdateFrame == 10)
                 RedDotController.Instance.SetComRedDot(_ui.m_btnActivityLuckyBox.target, RedDotDataManager.Instance.GetMeiRiTeHuiRed()
                 || RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitLuckyBox)
-                || RedDotDataManager.Instance.GetActLuckyBoxTaskdRed() || RedDotDataManager.Instance.GetGiftBagRewardRed(), "", -21, 2);
+                || RedDotDataManager.Instance.GetActLuckyBoxTaskdRed() || RedDotDataManager.Instance.GetActLuckyBoxStudioFilingRed() || RedDotDataManager.Instance.GetGiftBagRewardRed(), "", -21, 2);
 
             if (redPointUpdateFrame == 11)
                 RedDotController.Instance.SetComRedDot(_btnBag, RedDotDataManager.Instance.GetMainBagGiftRed(), "", -8);

+ 8 - 6
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioActivityView.cs

@@ -55,7 +55,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.AddEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
             EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
-            //EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
         }
 
@@ -65,7 +65,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
-            //EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             //EventAgent.RemoveEventListener(ConstMessage.STUDIO_FILING_UPDATE, UpdateView);
 
         }
@@ -88,6 +88,11 @@ namespace GFGGame
             _valueBarController.OnHide();
         }
 
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_btnReward, StudioDataManager.Instance.GetStudioFilingRewardRed());
+        }
+
         private void RenderListItem(int index, GObject obj)
         {
             UI_ListLevelItem item = UI_ListLevelItem.Proxy(obj);
@@ -162,15 +167,12 @@ namespace GFGGame
             var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
             _ui.m_loaBg.url = ResPathUtil.GetStudioFilingPicPath(_studioCfg.res); //ResPathUtil.GetBgImgPath(_studioCfg.res);
             _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayMax - limitData.PlayTimes, limitData.MaxStorageCount);
-
             _ui.m_activityTipText.SetVar("name", _studioCfg.name).FlushVars();
             _ui.m_activityTitle.text = _studioCfg.name;
-
-
             _storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_studioCfg.type, _studioCfg.subType, StudioDataManager.Instance.filingChapterId);
             _ui.m_list.numItems = _storyLevelCfgs.Count;
 
-            //UpdateRedDot();
+            UpdateRedDot();
         }
 
         private void UpdateItem()