Browse Source

章节从上到下定位问题

zhangyuqian 1 year ago
parent
commit
3a638012b3

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ArenaDataManager.cs

@@ -267,7 +267,7 @@ namespace GFGGame
             List<int> itemList = new List<int>();
             List<int> itemList = new List<int>();
             foreach (int subType in itemListDic.Keys)
             foreach (int subType in itemListDic.Keys)
             {
             {
-                DressUpMenuItemDataManager.SortItemListByHighScore(itemListDic[subType]);
+                //DressUpMenuItemDataManager.SortItemListByHighScore(itemListDic[subType]);
                 if (subType == ConstDressUpItemType.TE_SHU)
                 if (subType == ConstDressUpItemType.TE_SHU)
                 {
                 {
                     int max = Math.Min(itemListDic[subType].Count, 5);
                     int max = Math.Min(itemListDic[subType].Count, 5);

+ 11 - 15
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -129,8 +129,9 @@ namespace GFGGame
 
 
             StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
             StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
             newIndex = StoryUtil.GetChapterOrder(chapterCfg.id);
             newIndex = StoryUtil.GetChapterOrder(chapterCfg.id);
-            indexY = 115.0f * (float)StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterCfg.type, chapterCfg.subType, chapterCfg.id).Count;
+            indexY = 111.0f * Mathf.Max(0, (float)StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterCfg.type, chapterCfg.subType, chapterCfg.id).Count - 5);
             gamey = GameObject.Find("Stage/GRoot/Window - StoryChapterUI/ContentPane/CompChapter/Container/Container");
             gamey = GameObject.Find("Stage/GRoot/Window - StoryChapterUI/ContentPane/CompChapter/Container/Container");
+            _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = false;
 
 
             Timers.inst.StartCoroutine(InitChapter());
             Timers.inst.StartCoroutine(InitChapter());
 
 
@@ -141,16 +142,6 @@ namespace GFGGame
             _ui.target.touchable = true;
             _ui.target.touchable = true;
 
 
             Timers.inst.AddUpdate(CheckGuide);
             Timers.inst.AddUpdate(CheckGuide);
-
-            int chapterNum = StoryChapterCfgArray.Instance.GetCfgsBysubType(currentDifficulty).Count;
-            if (MainStoryDataManager.CurrentChapterOrder == chapterNum)
-            {
-                _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = false;
-            }
-            else
-            {
-                _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
-            }
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -231,7 +222,12 @@ namespace GFGGame
             float starPosY = _ui.m_chapter.m_compChapterScroll.m_imgBegin.y;
             float starPosY = _ui.m_chapter.m_compChapterScroll.m_imgBegin.y;
             int lineGap = 4500 / list.Count;
             int lineGap = 4500 / list.Count;
 
 
-            _comEff.visible = false;
+            StoryLevelCfg lastLevelCfg = list[list.Count - 1];
+            if (lastLevelCfg != null && MainStoryDataManager.CheckLevelUnlock(lastLevelCfg.id))
+            {
+                _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
+            }
+                _comEff.visible = false;
             _effFirst.visible = false;
             _effFirst.visible = false;
             for (int i = 0; i < 20; i++)
             for (int i = 0; i < 20; i++)
             {
             {
@@ -349,15 +345,15 @@ namespace GFGGame
             }
             }
             yield return new WaitForEndOfFrame();
             yield return new WaitForEndOfFrame();
 
 
-            _ui.m_chapter.m_compChapterScroll.target.y =Mathf.Max(1 , _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height);
+            _ui.m_chapter.m_compChapterScroll.target.y = 0; //Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height);
 
 
-            if(gamey != null)
+            if (gamey != null)
                 gamey.transform.position = new Vector3(0, indexY, 0);
                 gamey.transform.position = new Vector3(0, indexY, 0);
         }
         }
 
 
         private void SetContainerY(object param = null)
         private void SetContainerY(object param = null)
         {
         {
-            _ui.m_chapter.m_compChapterScroll.target.y = Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height - 1);
+            _ui.m_chapter.m_compChapterScroll.target.y = 1; //Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height - 1);
         }
         }
 
 
         private void HideEffect(object param = null)
         private void HideEffect(object param = null)

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

@@ -298,7 +298,7 @@ namespace GFGGame
             for (int i = 0; i < _chapterCfgs.Count; i++)
             for (int i = 0; i < _chapterCfgs.Count; i++)
             {
             {
                 StoryChapterCfg chapterCfg = _chapterCfgs[i];
                 StoryChapterCfg chapterCfg = _chapterCfgs[i];
-                if (i == _chapterCfgs.Count - 1)
+                if (i == _chapterCfgs.Count - 1 && MainStoryDataManager.CheckChapterUnlock(chapterCfg.id))
                 {
                 {
                     ViewManager.Show<StoryChapterView>(new object[] { chapterCfg.id, 0 });
                     ViewManager.Show<StoryChapterView>(new object[] { chapterCfg.id, 0 });
                     isOpen = false;
                     isOpen = false;

BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes