瀏覽代碼

摘星抽奖活动次数刷新

huangxiaoyue 1 年之前
父節點
當前提交
a02ecab98c

+ 7 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivitySProxy.cs

@@ -12,7 +12,13 @@ namespace GFGGame
     {
         protected override async ETTask Run(Session session, S2C_NoticeTimeLimitLuckyBoxDropOutCount message)
         {
-            ActivityDataManager.Instance.lastDrawCount = message.Count;
+            var activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(message.ActivityId);
+
+            if (activityOpenCfg.type == ConstLimitTimeActivityType.ActLimitLuckyBox)
+                ActivityDataManager.Instance.lastDrawCount = message.Count;
+            else if (activityOpenCfg.type == ConstLimitTimeActivityType.ActLimitTsy)
+                ActivityDataManager.Instance.lastTsyDrawCount = message.Count;
+
             EventAgent.DispatchEvent(ConstMessage.ACTIVITY_LUCKY_BOX);
             await ETTask.CompletedTask;
         }

+ 10 - 5
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -93,6 +93,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateListItemData);
             EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_FREE_TIME_CHANGED, UpdateFreeInfo);
             EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD, UpdateBtnReward);
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateBtnReward);
         }
         protected override void OnShown()
         {
@@ -303,14 +304,17 @@ namespace GFGGame
             UI_ComBox1.ProxyEnd();
             UpdateListItemData();
             UpdateFreeInfo();
-            UpdateBtnReward();
         }
 
         private void UpdateBtnReward()
         {
-            GObject obj = _ui.m_listBg.GetChildAt(1);
-            UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
-            RedDotController.Instance.SetComRedDot(comBox.m_btnReward, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy));
+            if (_curIndex == 1) { 
+                GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
+                UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
+                RedDotController.Instance.SetComRedDot(comBox.m_btnReward, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy));
+
+                comBox.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastTsyDrawCount.ToString()).FlushVars();
+            }
         }
 
         private void OnClikcBtnReward()
@@ -370,6 +374,7 @@ namespace GFGGame
                     comBox.m_btnGiftBag.visible = true;
                 }
             }
+            UpdateBtnReward();
         }
 
         //限时礼包按钮点击执行方法
@@ -533,7 +538,6 @@ namespace GFGGame
                 {
                     ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxView).FullName, boxId });
                     LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
-                    UpdateBtnReward();
                 }
             });
         }
@@ -562,6 +566,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateListItemData);
             EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_FREE_TIME_CHANGED, UpdateFreeInfo);
             EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_ACTIVITY_REWARD, UpdateBtnReward);
+            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateBtnReward);
         }
 
         private void OnClickBtnBack()