Explorar el Código

章节列表添加红点

zhaoyang hace 3 años
padre
commit
7c701ac03c

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

@@ -74,5 +74,22 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 根据章节Id判断是否有奖励可领
+        /// </summary>
+        /// <returns></returns>
+        public bool GetChapterRed(int chapterId)
+        {
+            for (int i = 0; i < 3; i++)
+            {
+                int state = MainStoryDataManager.GetChapterBonusStatus(chapterId, i);
+                if (state == ConstBonusStatus.CAN_GET)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
     }
 }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -43,7 +43,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gxhd_bjbj");
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("fuben_bjbj");
 
             subType = 0;//MainStoryDataManager.GetChapterSubType(MainStoryDataManager.currentChapterCfgId);
             if (this.viewData != null)
@@ -118,6 +118,7 @@ namespace GFGGame
             }
             listItem.target.data = chapterCfg.id;
             listItem.m_content.target.data = chapterCfg.id;
+            RedDotController.Instance.SetComRedDot(listItem.m_content.target, RedDotDataManager.Instance.GetChapterRed(chapterCfg.id), "", 0, 8, 0, (int)listItem.m_content.m_txtProgress.y - 20);
         }
 
         private void UpdateList()