Browse Source

查阅建档

zhaoyang 2 years ago
parent
commit
af3d6ef2fb

+ 5 - 1
GameClient/Assets/Game/HotUpdate/Data/StudioDataManager.cs

@@ -108,9 +108,13 @@ namespace GFGGame
         }
         }
 
 
 
 
-        public void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
+        public void OnFinishStudioStoryLevel(int levelCfgId, bool firstPass, bool success)
         {
         {
             ViewManager.Show(VIEW_NAME, new object[] { TYPE_SELECT_INDEX, PROPERTY_SELECT_INDEX }, ViewManager.GetGoBackDatas(VIEW_NAME));
             ViewManager.Show(VIEW_NAME, new object[] { TYPE_SELECT_INDEX, PROPERTY_SELECT_INDEX }, ViewManager.GetGoBackDatas(VIEW_NAME));
         }
         }
+        public void OnFinishFilingStoryLevel(int levelCfgId, bool firstPass, bool success)
+        {
+            ViewManager.Show<StudioFilingView>(MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName), true);
+        }
     }
     }
 }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -213,7 +213,7 @@ namespace GFGGame
 
 
                         ViewManager.Show(viewName, new object[] { type, 0 }, _fromeViewDatas);
                         ViewManager.Show(viewName, new object[] { type, 0 }, _fromeViewDatas);
                         StudioDataManager.Instance.VIEW_NAME = viewName;
                         StudioDataManager.Instance.VIEW_NAME = viewName;
-                        InstanceZonesController.ShowLevelView(levelCfgId, StudioDataManager.Instance.OnFinishStoryLevel, _itemId, _needCount);
+                        InstanceZonesController.ShowLevelView(levelCfgId, StudioDataManager.Instance.OnFinishStudioStoryLevel, _itemId, _needCount);
                         isJump = true;
                         isJump = true;
                         break;
                         break;
                     }
                     }

+ 5 - 6
GameClient/Assets/Game/HotUpdate/Views/MainStory/InstanceZonesController.cs

@@ -43,11 +43,6 @@ namespace GFGGame
             }
             }
         }
         }
 
 
-        public static void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
-        {
-            _onFinishStoryLevelCall?.Invoke(levelCfgId, firstPass, success);
-
-        }
 
 
 
 
         public static async ETTask CheckStoryFightResult()
         public static async ETTask CheckStoryFightResult()
@@ -76,7 +71,7 @@ namespace GFGGame
             }
             }
         }
         }
 
 
-        private static void OnCompleteChapterStoryDialog(bool isSkip, object param)
+        public static void OnCompleteChapterStoryDialog(bool isSkip, object param)
         {
         {
             if (!MainStoryDataManager.CheckCurrentLevelPass())
             if (!MainStoryDataManager.CheckCurrentLevelPass())
             {
             {
@@ -88,5 +83,9 @@ namespace GFGGame
             }
             }
         }
         }
 
 
+        public static void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
+        {
+            _onFinishStoryLevelCall?.Invoke(levelCfgId, firstPass, success);
+        }
     }
     }
 }
 }

+ 25 - 15
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs

@@ -7,21 +7,6 @@ namespace GFGGame
         {
         {
             InstanceZonesController.ShowLevelView(levelCfgId, OnFinishStoryLevel);
             InstanceZonesController.ShowLevelView(levelCfgId, OnFinishStoryLevel);
         }
         }
-
-        public static void ShowCardStoryDialog(CardStoryCfg cardStoryCfg, CardData cardData)
-        {
-            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { cardStoryCfg.storyStartID, true, new OnCompleteStoryDialogCall(OnCompleteCardStoryDialog), cardData }, null, true);
-        }
-        public static void ShowFilingStoryDialog(string levelCfgId)
-        {
-            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { levelCfgId, false, new OnCompleteStoryDialogCall(OnCompleteFilingStoryDialog) }, null, true);
-        }
-        public static void ShowPriorStoryDialog()
-        {
-            InstanceZonesDataManager.currentLevelCfgId = 100001001;
-            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { MainStoryDataManager.priorId, false, new OnCompleteStoryDialogCall(OnCompletePriorStoryDialog) }, null, true);
-        }
-
         public static void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
         public static void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
         {
         {
             if (success)
             if (success)
@@ -62,6 +47,11 @@ namespace GFGGame
         }
         }
 
 
 
 
+
+        public static void ShowCardStoryDialog(CardStoryCfg cardStoryCfg, CardData cardData)
+        {
+            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { cardStoryCfg.storyStartID, true, new OnCompleteStoryDialogCall(OnCompleteCardStoryDialog), cardData }, null, true);
+        }
         private static void OnCompleteCardStoryDialog(bool isSkip, object param)
         private static void OnCompleteCardStoryDialog(bool isSkip, object param)
         {
         {
             CardData cardData = param as CardData;
             CardData cardData = param as CardData;
@@ -69,12 +59,32 @@ namespace GFGGame
             ViewManager.Show(ViewName.CARD_STORY_VIEW, cardData);
             ViewManager.Show(ViewName.CARD_STORY_VIEW, cardData);
         }
         }
 
 
+
+        public static void ShowPriorStoryDialog()
+        {
+            InstanceZonesDataManager.currentLevelCfgId = 100001001;
+            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { MainStoryDataManager.priorId, false, new OnCompleteStoryDialogCall(OnCompletePriorStoryDialog) }, null, true);
+        }
+
         private static void OnCompletePriorStoryDialog(bool isSkip, object param)
         private static void OnCompletePriorStoryDialog(bool isSkip, object param)
         {
         {
             ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW), true);
             ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW), true);
         }
         }
+
+
+        public static void ShowFilingStoryDialog(StoryLevelCfg storyLevelCfg)
+        {
+
+            InstanceZonesDataManager.currentLevelCfgId = storyLevelCfg.id;
+
+            ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { storyLevelCfg.storyStartID, false, new OnCompleteStoryDialogCall(OnCompleteFilingStoryDialog) }, null, true);
+
+        }
+
         private static void OnCompleteFilingStoryDialog(bool isSkip, object param)
         private static void OnCompleteFilingStoryDialog(bool isSkip, object param)
         {
         {
+            InstanceZonesController.OnCompleteChapterStoryDialog(isSkip, param);
+
             ViewManager.Show<StudioFilingView>(MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName), true);
             ViewManager.Show<StudioFilingView>(MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName), true);
         }
         }
     }
     }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs

@@ -123,7 +123,7 @@ namespace GFGGame
             }
             }
             StudioDataManager.Instance.PROPERTY_SELECT_INDEX = _ui.m_listProperty.selectedIndex;
             StudioDataManager.Instance.PROPERTY_SELECT_INDEX = _ui.m_listProperty.selectedIndex;
             StudioDataManager.Instance.TYPE_SELECT_INDEX = _ui.m_c1.selectedIndex;
             StudioDataManager.Instance.TYPE_SELECT_INDEX = _ui.m_c1.selectedIndex;
-            InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishStoryLevel);
+            InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishStudioStoryLevel);
             UI_ListItem.ProxyEnd();
             UI_ListItem.ProxyEnd();
         }
         }
 
 

+ 12 - 10
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs

@@ -45,7 +45,7 @@ namespace GFGGame
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
             base.AddEventListener();
             base.AddEventListener();
-
+            EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
         }
         }
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -62,6 +62,7 @@ namespace GFGGame
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
 
 
         }
         }
 
 
@@ -86,23 +87,24 @@ namespace GFGGame
             UI_ListLevel item = UI_ListLevel.Proxy(obj);
             UI_ListLevel item = UI_ListLevel.Proxy(obj);
             item.m_c1.selectedIndex = _index % 2;
             item.m_c1.selectedIndex = _index % 2;
             item.m_txtName.text = _storyLevelCfgs[_index].name;
             item.m_txtName.text = _storyLevelCfgs[_index].name;
-            item.m_imgLock.visible = InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[_index].id);
+            item.m_imgLock.visible = _index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[_index - 1].id);
             item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[_index].id);
             item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[_index].id);
-            item.target.data = _storyLevelCfgs[_index];
+            item.target.data = _index;// _storyLevelCfgs[_index];
             UI_ListLevel.ProxyEnd();
             UI_ListLevel.ProxyEnd();
         }
         }
         private void OnListItemClick(EventContext context)
         private void OnListItemClick(EventContext context)
         {
         {
             GObject obj = context.data as GObject;
             GObject obj = context.data as GObject;
-            StoryLevelCfg storyLevelCfg = obj.data as StoryLevelCfg;
-            if (!string.IsNullOrEmpty(storyLevelCfg.storyStartID))
-            {
-                StoryController.ShowFilingStoryDialog(storyLevelCfg.storyStartID);
-            }
-            else
+            int index = (int)obj.data;
+            StoryLevelCfg storyLevelCfg = _storyLevelCfgs[index];
+            if (index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id))
             {
             {
-                InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishStoryLevel);
+                PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
+                return;
             }
             }
+
+            MainStoryDataManager.currentLevelCfgId = storyLevelCfg.id;
+            InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishFilingStoryLevel);
         }
         }
         private void OnBtnChangeClick()
         private void OnBtnChangeClick()
         {
         {