Browse Source

章节补充提交

zhangyuqian 1 year ago
parent
commit
12d57f3c8b

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Data/MainStoryDataManager.cs

@@ -203,5 +203,7 @@ namespace GFGGame
             }
             return false;
         }
+        //关卡当前难度类型
+        public static int currentChapterType = 0;
     }
 }

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

@@ -79,6 +79,8 @@ namespace GFGGame
                 subType = (int)(this.viewData as object[])[0];
                 chapterIndex = Mathf.Max(1, (int)(this.viewData as object[])[1]);
             }
+            subType = MainStoryDataManager.currentChapterType;
+            CheckChapterIndex();
             _ui.m_listType.selectedIndex = subType;
             _ui.m_listChapter.touchable = false;
             UpdateList();
@@ -118,6 +120,7 @@ namespace GFGGame
         private void OnClickListTypeItem()
         {
             this.subType = _ui.m_listType.selectedIndex;
+            MainStoryDataManager.currentChapterType = _ui.m_listType.selectedIndex;
             UpdateList(true);
         }
         private void OnClickListChapterItem(EventContext context)
@@ -486,6 +489,18 @@ namespace GFGGame
                 item.y = -_ui.m_listChapter.height * distanceX;
             }
         }
-        
+        private void CheckChapterIndex()
+        {
+            chapterIndex = 0;
+            List<StoryChapterCfg> storyChapterList = StoryChapterCfgArray.Instance.GetCfgsBysubType(MainStoryDataManager.currentChapterType);
+            foreach (StoryChapterCfg item in storyChapterList)
+            {  
+                if (!MainStoryDataManager.CheckChapterUnlock(item.id))
+                {
+                    return;
+                }
+                chapterIndex++;
+            }
+        }
       }
 }

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

@@ -392,6 +392,7 @@ namespace GFGGame
         }
         private void OnClickBtnMain()
         {
+            MainStoryDataManager.currentChapterType = 0;
             isOpen = MainControllerr.GotoStoryChapter(isOpen);
         }