瀏覽代碼

博物图鉴

zhaoyang 2 年之前
父節點
當前提交
a5599e408d

+ 15 - 10
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/ChapterItemGuideView.cs

@@ -8,7 +8,7 @@ namespace GFGGame
     {
     {
 
 
         private UI_ChapterItemGuideUI _ui;
         private UI_ChapterItemGuideUI _ui;
-        private List<StoryChapterCfg> _storychapterDatas = new List<StoryChapterCfg>();
+        private CulturalRelicCfg[] culturalRelicCfg;
         public override void Dispose()
         public override void Dispose()
         {
         {
             if (_ui != null)
             if (_ui != null)
@@ -30,6 +30,9 @@ namespace GFGGame
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_list.itemRenderer = RenderListItem;
             _ui.m_list.itemRenderer = RenderListItem;
             _ui.m_list.onClickItem.Add(OnListItemClick);
             _ui.m_list.onClickItem.Add(OnListItemClick);
+
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
+
         }
         }
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
@@ -38,9 +41,8 @@ namespace GFGGame
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
-            _storychapterDatas = StoryChapterCfgArray.Instance.GetCfgsBysubType(ConstInstanceZonesSubType.Normal);
-            _ui.m_list.numItems = _storychapterDatas.Count - 1;
+            culturalRelicCfg = CulturalRelicCfgArray.Instance.dataArray;
+            _ui.m_list.numItems = culturalRelicCfg.Length;
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -58,18 +60,21 @@ namespace GFGGame
 
 
         private void RenderListItem(int index, GObject obj)
         private void RenderListItem(int index, GObject obj)
         {
         {
-            StoryChapterCfg cfg = _storychapterDatas[index + 1];
+            CulturalRelicCfg cfg = culturalRelicCfg[index];
+            StoryChapterCfg storyChapterCfg = StoryChapterCfgArray.Instance.GetCfg(cfg.chapterId);
             UI_ChapterGuideItem item = UI_ChapterGuideItem.Proxy(obj);
             UI_ChapterGuideItem item = UI_ChapterGuideItem.Proxy(obj);
-            item.m_loaIcon.url = string.Format("ui://FieldGuide/chapter_{0}", cfg.order);
-            bool isPass = InstanceZonesDataManager.CheckChapterPass(cfg.type, cfg.subType, cfg.id, cfg.levelCount);
+            item.m_loaIcon.url = string.Format("ui://FieldGuide/{0}", cfg.iconRes);
+            bool isPass = InstanceZonesDataManager.CheckChapterPass(storyChapterCfg.type, storyChapterCfg.subType, storyChapterCfg.id, storyChapterCfg.levelCount);
             item.m_grpLock.visible = !isPass;
             item.m_grpLock.visible = !isPass;
-            item.m_txtDesc.text = string.Format("通关主线第{0}章解锁", NumberUtil.GetChiniseNumberText(cfg.order));
+            item.m_txtDesc.text = string.Format("通关主线第{0}章解锁", NumberUtil.GetChiniseNumberText(storyChapterCfg.order));
             item.target.data = cfg;
             item.target.data = cfg;
         }
         }
         private void OnListItemClick(EventContext context)
         private void OnListItemClick(EventContext context)
         {
         {
-            StoryChapterCfg cfg = (context.data as GObject).data as StoryChapterCfg;
-            bool isPass = InstanceZonesDataManager.CheckChapterPass(cfg.type, cfg.subType, cfg.id, cfg.levelCount);
+            CulturalRelicCfg cfg = (context.data as GObject).data as CulturalRelicCfg;
+            StoryChapterCfg storyChapterCfg = StoryChapterCfgArray.Instance.GetCfg(cfg.chapterId);
+
+            bool isPass = InstanceZonesDataManager.CheckChapterPass(storyChapterCfg.type, storyChapterCfg.subType, storyChapterCfg.id, storyChapterCfg.levelCount);
             if (!isPass)
             if (!isPass)
             {
             {
                 PromptController.Instance.ShowFloatTextPrompt("暂未解锁");
                 PromptController.Instance.ShowFloatTextPrompt("暂未解锁");

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/ChapterItemShowView.cs

@@ -8,7 +8,7 @@ namespace GFGGame
     public class ChapterItemShowView : BaseWindow
     public class ChapterItemShowView : BaseWindow
     {
     {
         private UI_ChapterItemShowUI _ui;
         private UI_ChapterItemShowUI _ui;
-        private StoryChapterCfg _cfg;
+        private CulturalRelicCfg _cfg;
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -36,7 +36,7 @@ namespace GFGGame
             base.OnShown();
             base.OnShown();
 
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tjtj_bjbj");
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tjtj_bjbj");
-            _cfg = this.viewData as StoryChapterCfg;
+            _cfg = this.viewData as CulturalRelicCfg;
             UpdateView();
             UpdateView();
         }
         }
         protected override void AddEventListener()
         protected override void AddEventListener()

二進制
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes