瀏覽代碼

章节问题修改

zhangyuqian 1 年之前
父節點
當前提交
0494ca3b24

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Controller/MainController.cs

@@ -18,6 +18,7 @@ namespace GFGGame
                 StoryChapterCfg chapterCfg = _chapterCfgs[i];
                 if (i == _chapterCfgs.Count - 1 && MainStoryDataManager.CheckChapterUnlock(chapterCfg.id))
                 {
+                    MainStoryDataManager.currentChapterCfgId = chapterCfg.id;
                     ViewManager.Show<StoryChapterView>(new object[] { chapterCfg.id, 0 });
                     isOpen = false;
                     return isOpen;
@@ -37,6 +38,7 @@ namespace GFGGame
                     }
                     if (StoryController.CheckSuitGot(chaptersuitCfg.suitId))
                     {
+                        MainStoryDataManager.currentChapterCfgId = chapterCfg.id - 1;
                         ViewManager.Show<StoryChapterView>(new object[] { chapterCfg.id - 1, 0 });
                         isOpen = false;
                         return isOpen;

+ 0 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityMain/UI_ActivityMainTipsUI.cs

@@ -11,7 +11,6 @@ namespace UI.ActivityMain
         public GLoader m_icon;
         public GTextField m_activityDesc;
         public GLoader m_notTips;
-        public GTextField m_activityTime;
         public GLoader m_backBtn;
         public Transition m_t0;
         public Transition m_t1;
@@ -67,7 +66,6 @@ namespace UI.ActivityMain
             m_icon = (GLoader)comp.GetChild("icon");
             m_activityDesc = (GTextField)comp.GetChild("activityDesc");
             m_notTips = (GLoader)comp.GetChild("notTips");
-            m_activityTime = (GTextField)comp.GetChild("activityTime");
             m_backBtn = (GLoader)comp.GetChild("backBtn");
             m_t0 = comp.GetTransition("t0");
             m_t1 = comp.GetTransition("t1");
@@ -79,7 +77,6 @@ namespace UI.ActivityMain
             m_icon = null;
             m_activityDesc = null;
             m_notTips = null;
-            m_activityTime = null;
             m_backBtn = null;
             m_t0 = null;
             m_t1 = null;

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityMainTips/ActivityMainTipsView.cs

@@ -75,7 +75,6 @@ namespace GFGGame
                 return;
             }
             long curTime = TimeHelper.ServerNow();
-            _ui.m_activityTime.text = string.Format("剩余{0}", TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime));
             _ui.m_icon.url = ResPathUtil.GetActivityPath(showActivity[0].ActivityNotice,"png");
             _ui.m_activityDesc.visible = false;
         }

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

@@ -289,6 +289,7 @@ namespace GFGGame
                             //从战斗换装必需品来源跳转到剧情界面,在剧情界面点返回后直接返回章节界面,无需返回换装界面
                             _fromViewDatas = null;
                         }
+                        MainStoryDataManager.currentChapterCfgId = levelCfg.chapterId;
                         isJump = ViewManager.Show<StoryChapterView>(levelCfg.chapterId, false);
                         StoryController.ShowLevelView(levelCfgId, _itemId, _needCount);
                         break;

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

@@ -41,7 +41,7 @@ namespace GFGGame
                 }
                 //, new object[] { typeof(StoryChapterView).FullName, MainStoryDataManager.currentChapterCfgId }
                 bool skipable = MainStoryDataManager.CheckCurrentLevelPass();
-                ViewManager.Show<StoryDialogView>(new object[] { levelCfg.storyStartID, skipable, new OnCompleteStoryDialogCall(OnCompleteChapterStoryDialog),null,false }, true);
+                ViewManager.Show<StoryDialogView>(new object[] { levelCfg.storyStartID, skipable, new OnCompleteStoryDialogCall(OnCompleteChapterStoryDialog),null,false }, true,false);
             }
         }
 

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

@@ -131,7 +131,8 @@ namespace GFGGame
                     //}
                     //else
                     //{
-                        ViewManager.Show<StoryChapterView>(new object[] { chapterID, _ui.m_listType.selectedIndex });
+                    MainStoryDataManager.currentChapterCfgId = chapterID;
+                    ViewManager.Show<StoryChapterView>(new object[] { chapterID, _ui.m_listType.selectedIndex });
                         this.Hide();
                     //}
 

+ 56 - 38
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -115,6 +115,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+
             _ui.target.touchable = false;
             SuitFosterProxy.SendGetSuitInfos().Coroutine();
             MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
@@ -127,8 +128,53 @@ namespace GFGGame
             {
                 _chapterID = (int)this.viewData;
             }
-            MainStoryDataManager.currentChapterCfgId = _chapterID;
 
+            if (!backRefresh && MainStoryDataManager.currentChapterCfgId != _chapterID)
+            {
+                _chapterID = MainStoryDataManager.currentChapterCfgId;
+            }
+            else { 
+                 MainStoryDataManager.currentChapterCfgId = _chapterID;
+            }
+            //_chapterID = MainStoryDataManager.currentChapterCfgId;
+
+            _valueBarController.OnShown();
+            _ui.m_t0.SetHook("canHit", () => { _ui.target.touchable = true; });
+            _ui.m_t0.Play();
+            Timers.inst.AddUpdate(CheckGuide);
+
+            UpdateView();
+
+
+            //
+
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            _unPasslevelItem = null;
+            _endLevelItem = null;
+            // _ui.m_chapter.RemoveChildren(0, 0, true);
+            GRoot.inst.touchable = true;
+            _valueBarController.OnHide();
+            Timers.inst.Remove(SetContainerY);
+            Timers.inst.Remove(CheckGuide);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
+        }
+        private void OnClickBtnBack()
+        {
+            ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
+            //GameController.GoBackToMainView();
+        }
+
+        private void UpdateView()
+        {
             //由于这里会切换特效,所以切换界面时进行清空
             EffectUIPool.Recycle(_effectUI2);
             _effectUI2 = null;
@@ -150,8 +196,6 @@ namespace GFGGame
             //Timers.inst.Add(0.2f, 1, SetContainerY);
             _ui.m_chapter.m_compChapterScroll.target.y = 1;
 
-            _valueBarController.OnShown();
-
             //招财进宝活动
             if (chapterCfg.subType == 2)
             {
@@ -176,38 +220,9 @@ namespace GFGGame
                 _ui.m_bonusBox.visible = true;
                 _ui.m_ActivityZCJB.visible = false;
             }
-            //
-            _ui.m_t0.SetHook("canHit",()=> { _ui.target.touchable = true; });
-            _ui.m_t0.Play();
-            
-
-            Timers.inst.AddUpdate(CheckGuide);
-
         }
 
-        protected override void OnHide()
-        {
-            base.OnHide();
-            _unPasslevelItem = null;
-            _endLevelItem = null;
-            // _ui.m_chapter.RemoveChildren(0, 0, true);
-            GRoot.inst.touchable = true;
-            _valueBarController.OnHide();
-            Timers.inst.Remove(SetContainerY);
-            Timers.inst.Remove(CheckGuide);
-        }
 
-        protected override void RemoveEventListener()
-        {
-            base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
-        }
-        private void OnClickBtnBack()
-        {
-            ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
-            //GameController.GoBackToMainView();
-        }
-        
         private void OnClickSwitchBack()
         {
             Timers.inst.Remove(SetContainerY);
@@ -216,7 +231,7 @@ namespace GFGGame
         private void OnClickGotoView()
         {
             StoryChapterCfg chapterSuitCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
-            ViewManager.Show<ClothingSyntheticView>(new object[] { chapterSuitCfg.suitId});
+            ViewManager.Show<ClothingSyntheticView>(new object[] { chapterSuitCfg.suitId}, false, false);
         }
 
         private void OnClickBtnHome()
@@ -230,18 +245,21 @@ namespace GFGGame
             if (MainStoryDataManager.CheckChapterUnlock(_chapterID+1) && StoryController.CheckSuitGot(chapterSuitCfg.suitId))
             {
                 Timers.inst.Remove(SetContainerY);
-                ViewManager.Show<StoryChapterView>(new object[] { _chapterID+1, currentDifficulty });
+                _chapterID += 1;
+                MainStoryDataManager.currentChapterCfgId = _chapterID;
+                //ViewManager.Show<StoryChapterView>(new object[] { (_chapterID+1), currentDifficulty });
+                UpdateView();
             }
             else
             {
                 StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID + 1);
-                if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
+                if(!StoryController.CheckSuitGot(chapterSuitCfg.suitId))
                 {
-                    PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级开启",chapterCfg.lvl));
+                    PromptController.Instance.ShowFloatTextPrompt("需集齐所需套装");
                 }
-                else
+                else if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
                 {
-                    PromptController.Instance.ShowFloatTextPrompt("需集齐所需套装");
+                    PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级开启",chapterCfg.lvl));
                 }
                 
             }

+ 18 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs

@@ -1,3 +1,8 @@
+using System.Collections.Generic;
+using UnityEngine;
+using System.Collections;
+using ET;
+
 namespace GFGGame
 {
     //主线剧情专用类
@@ -46,7 +51,19 @@ namespace GFGGame
                     }
                     else
                     {
-                        ViewManager.Show<StoryChapterListView>(new object[] { index, nextStoryChapterCfg.order }, true);
+                        //ViewManager.Show<StoryChapterListView>(new object[] { index, nextStoryChapterCfg.order }, true);
+                        StoryChapterCfg previousChapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId);
+                        StoryChapterCfg nextChapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId + 1);
+                        bool lv = nextChapterCfg.lvl < GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+                        if (CheckSuitGot(previousChapterCfg.suitId) && MainStoryDataManager.CheckChapterUnlock(levelCfg.chapterId) && lv)
+                        {
+                            ViewManager.Show<StoryChapterListView>(new object[] { index, nextStoryChapterCfg.order }, true);
+                        }
+                        else
+                        {
+                            MainStoryDataManager.currentChapterCfgId = previousChapterCfg.id;
+                            ViewManager.Show<StoryChapterView>(new object[] { previousChapterCfg.id, 0 }, true);
+                        }
                     }
                     
                 }

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

@@ -93,7 +93,7 @@ namespace GFGGame
                 DressUpFightType dressUpFightType = new DressUpFightType();
                 dressUpFightType.levelID = _levelID;
                 dressUpFightType.teaPartID = 0;
-                ViewManager.Show<DressUpFightView>(dressUpFightType,true);
+                ViewManager.Show<DressUpFightView>(dressUpFightType,true,false);
                 this.Hide();
             }
             else

二進制
GameClient/Assets/ResIn/UI/ActivityMain/ActivityMain_fui.bytes