Browse Source

添加头像框红点判断

leiyasi 1 year ago
parent
commit
975847187a
1 changed files with 17 additions and 0 deletions
  1. 17 0
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/ChangeHeadView.cs

+ 17 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/ChangeHeadView.cs

@@ -12,6 +12,7 @@ namespace GFGGame
         private List<ItemCfg> _headBorderCfgs = new List<ItemCfg>();
         private int _selectHeadId = 0;
         private int _selectHeadBorderId = 0;
+        private bool showHeadBorderRedDot = false;
 
         public override void Dispose()
         {
@@ -56,6 +57,10 @@ namespace GFGGame
             OnTabChange();
             // _ui.m_list.selectedIndex = 0;
             // _ui.m_listBorder.selectedIndex = 0;
+
+            // 头像框红点显示
+            showHeadBorderRedDot = RedDotDataManager.Instance.GetHeadBorderRed();
+            UpdateRedDot();
         }
 
         protected override void OnHide()
@@ -158,10 +163,17 @@ namespace GFGGame
             if (_ui.m_c1.selectedIndex == 0)
             {
                 _ui.m_list.numItems = _headCfgs.Count;
+                _ui.m_list.scrollPane.ScrollTop();
             }
             else
             {
+                if (showHeadBorderRedDot)
+                {
+                    showHeadBorderRedDot = false;
+                    UpdateRedDot();
+                }
                 _ui.m_listBorder.numItems = _headBorderCfgs.Count;
+                _ui.m_listBorder.scrollPane.ScrollTop();
             }
             UpdateView();
         }
@@ -195,5 +207,10 @@ namespace GFGGame
             });
             return list;
         }
+
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_btnTab1, showHeadBorderRedDot, "", -33, 0);
+        }
     }
 }