|
@@ -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++;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|