Эх сурвалжийг харах

七日签到打开方式修改

zhangyuqian 1 жил өмнө
parent
commit
331f86b254

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -183,5 +183,8 @@ namespace GFGGame
 
         //通知阿福赠礼活动状态的更新
         public const string AFU_GIFT_CHANGED = "AFU_GIFT_CHANGED";
+
+        //通知七日签到数据更新
+        public const string SEVENDAY_LOGIN = "SEVENDAYLOGIN";
     }
 }

+ 2 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivitySProxy.cs

@@ -37,6 +37,8 @@ namespace GFGGame
                 {
                     ActivityDataManager.Instance.sevenDayLoginLoginIdList = response.KsBonusId;
                     ActivityDataManager.Instance.sevenDayLoginBonusStatusList = response.VsBonusStatus;
+
+                    EventAgent.DispatchEvent(ConstMessage.SEVENDAY_LOGIN);
                     return true;
                 }
             }

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

@@ -176,6 +176,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
             EventAgent.AddEventListener(ConstMessage.RESET_DAILY_DATA, ResetDailyData);
             EventAgent.AddEventListener(ConstMessage.AFU_GIFT_CHANGED, ChangeAfuActivityState);
+            EventAgent.AddEventListener(ConstMessage.SEVENDAY_LOGIN, SevenDayLoginShow);
         }
 
 
@@ -213,25 +214,7 @@ namespace GFGGame
 
             //long lastTime = GameGlobal.lastLoginTime; // GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
 
-            //if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
-            ET.Log.Debug("zyq"+ GameGlobal.isLogon);
-            if (GameGlobal.isLogon)
-            {
-                ET.Log.Debug("zyq" + GameGlobal.isLogon);
-                ET.Log.Debug("zyq" + ActivityDataManager.Instance.sevenDayLoginBonusStatusList.Count + ":::" + GuideDataManager.currentGuideId);
-                if (ActivityDataManager.Instance.CanGetSevenDayBonus() &&
-                    GuideDataManager.currentGuideId <= 0)
-                {
-                    ViewManager.Show<SevenDayLoginView>();
-                    
-                }
-                else if (RedDotDataManager.Instance.DailySignRed())
-                {
-                    ViewManager.Show<DailySignView>(new object[] { 1 });
-                }
 
-                //GameGlobal.lastLoginTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
-            }
 
             SetPos();
             GetAdIds();
@@ -274,6 +257,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.RemoveEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
             EventAgent.RemoveEventListener(ConstMessage.AFU_GIFT_CHANGED, ChangeAfuActivityState);
+            EventAgent.RemoveEventListener(ConstMessage.SEVENDAY_LOGIN, SevenDayLoginShow);
         }
 
         private void AddEffect()
@@ -1197,5 +1181,25 @@ namespace GFGGame
         {
             _ui.m_btnActivityAfuGift.target.visible = ActivityAfuGiftDataManager.Instance.IsOpen;
         }
+
+      private void SevenDayLoginShow()
+        {
+            //if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
+            if (GameGlobal.isLogon)
+            {
+                if (ActivityDataManager.Instance.CanGetSevenDayBonus() &&
+                    GuideDataManager.currentGuideId <= 0)
+                {
+                    ViewManager.Show<SevenDayLoginView>();
+
+                }
+                else if (RedDotDataManager.Instance.DailySignRed())
+                {
+                    ViewManager.Show<DailySignView>(new object[] { 1 });
+                }
+
+                //GameGlobal.lastLoginTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
+            }
+        }
     }
 }