فهرست منبع

主界面自动打开界面优化

guodong 1 سال پیش
والد
کامیت
99c171e649

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -184,8 +184,8 @@ namespace GFGGame
         //通知阿福赠礼活动状态的更新
         public const string AFU_GIFT_CHANGED = "AFU_GIFT_CHANGED";
 
-        //七日签到界面关闭
-        public const string SEVEN_DAY_LOGIN_VIEW_CLOSED = "SEVEN_DAY_LOGIN_VIEW_CLOSED";
+        //界面关闭
+        public const string VIEW_CLOSED = "VIEW_CLOSED";
 
         //第二部分游戏数据获取数据完毕
         public const string AFTER_DATA_INITED = "AFTER_DATA_INITED";

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/SevenDayLoginView.cs

@@ -63,7 +63,6 @@ namespace GFGGame
             base.OnHide();
             _ui.m_list.numItems = 0;
             ViewManager.SetMaskAlpha(0.6f);
-            EventAgent.DispatchEvent(ConstMessage.SEVEN_DAY_LOGIN_VIEW_CLOSED);
         }
         private void ListItemRender(int index, GObject obj)
         {

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

@@ -151,7 +151,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.SEVEN_DAY_LOGIN_VIEW_CLOSED, CheckAutoShowViews);
+            EventAgent.AddEventListener(ConstMessage.VIEW_CLOSED, CheckAutoShowViews);
             EventAgent.AddEventListener(ConstMessage.AFTER_DATA_INITED, OnFaterDataInited);
         }
 
@@ -163,7 +163,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, OnRedDotChanged);
             EventAgent.RemoveEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
             EventAgent.RemoveEventListener(ConstMessage.AFU_GIFT_CHANGED, ChangeAfuActivityState);
-            EventAgent.RemoveEventListener(ConstMessage.SEVEN_DAY_LOGIN_VIEW_CLOSED, CheckAutoShowViews);
+            EventAgent.RemoveEventListener(ConstMessage.VIEW_CLOSED, CheckAutoShowViews);
             EventAgent.RemoveEventListener(ConstMessage.AFTER_DATA_INITED, OnFaterDataInited);
         }
 
@@ -234,6 +234,10 @@ namespace GFGGame
             {
                 GameController.AfterShowMainUI();
             }
+            else
+            {
+                OnRedDotChanged();
+            }
         }
 
         private void OnFaterDataInited()
@@ -843,6 +847,7 @@ namespace GFGGame
 
         private void OnRedDotChanged()
         {
+            LogHelper.LogEditor($"MainUIView OnRedDotChanged GameGlobal.AfterDataInited {GameGlobal.AfterDataInited} AutoShowCompleted {AutoShowCompleted}");
             //暂时用这种方法优化下,红点的实现要重构!!!
             //LogHelper.LogEditor("MainUIView UpdateRedDot OnRedDotChanged");
             if (!GameGlobal.AfterDataInited) return;
@@ -854,7 +859,7 @@ namespace GFGGame
         private void UpdateRedDot()
         {
             if (redPointUpdateFrame < 0) return;
-            LogHelper.LogEditor("MainUIView UpdateRedDot");
+            LogHelper.LogEditor($"MainUIView UpdateRedDot redPointUpdateFrame {redPointUpdateFrame}");
             if (redPointUpdateFrame == 0)
                 _valueBarController.UpdateRedPoint();
             if (redPointUpdateFrame == 1)
@@ -1024,13 +1029,16 @@ namespace GFGGame
         private void ResetDailyData()
         {
             CheckFunOpen();
-            redPointUpdateFrame = 0;
+            OnRedDotChanged();
             UpdateHead();
             UpdateBtnFirstRecharge();
             CheckAutoShowViews();
         }
         private void CheckAutoShowViews()
         {
+            if (AutoShowCompleted) return;
+            if (!GameGlobal.AfterDataInited) return;
+            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
             //if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
             if (GameGlobal.AutoSevenDayLoginView)
             {

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

@@ -140,6 +140,7 @@ namespace GFGGame
             closeTime = TimeHelper.ClientNowSeconds();
             DoHideAnimation();
             ViewManager.HideWin(this.viewName);
+            EventAgent.DispatchEvent(ConstMessage.VIEW_CLOSED);
         }
 
         virtual protected void OnShown()