Browse Source

换新道具来源跳转

zhaoyang 3 years ago
parent
commit
a2a3ad1749

+ 1 - 1
FGUIProject/assets/CommonGame/ApproachOfItemUI.xml

@@ -7,7 +7,7 @@
     <text id="n3_lwri" name="txtName" xy="253,124" size="167,41" fontSize="30" color="#9c8872" vars="true" text="* {v1=物品名称 }*">
       <relation target="" sidePair="center-center"/>
     </text>
-    <list id="n4_lwri" name="listApproach" xy="196,200" size="285,237" overflow="scroll" lineGap="25" defaultItem="ui://eg2y0ldplwri5y" align="center" autoClearItems="true">
+    <list id="n4_lwri" name="listApproach" xy="184,200" size="310,237" overflow="scroll" lineGap="25" defaultItem="ui://eg2y0ldplwri5y" align="center" autoClearItems="true">
       <item/>
       <item/>
       <item/>

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

@@ -61,7 +61,7 @@ namespace GFGGame
             bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
             bool isLastPast = true;
 
-            if (index > 0)
+            if (index > 0 && index < storyLevelCfgs.Count)
             {
                 isLastPast = InstanceZonesDataManager.CheckLevelPass(storyLevelCfgs[index - 1].id);
             }
@@ -73,6 +73,31 @@ namespace GFGGame
             canFight = isPass && isRoleLv && isLastPast;
         }
 
+
+        public void IsCanFight(int levelId, out bool canFight, out string content)
+        {
+
+            StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(levelId);
+            bool isPass = InstanceZonesDataManager.CheckLevelPass(storyLevelCfg.needStoryLevelId);
+            bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
+            bool isLastPast = true;
+
+            List<StoryLevelCfg> storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(storyLevelCfg.type, storyLevelCfg.subType, storyLevelCfg.chapterId);
+            if (storyLevelCfg.order > 1 && storyLevelCfg.order <= storyLevelCfgs.Count)
+            {
+
+                isLastPast = InstanceZonesDataManager.CheckLevelPass(storyLevelCfgs[storyLevelCfg.order].id);
+
+            }
+            content = "";
+            if (!isRoleLv) content = string.Format("主角等级达到{0}级解锁", storyLevelCfg.order);
+            if (!isLastPast) content = string.Format("需通关{0}", storyLevelCfgs[storyLevelCfg.order - 1].name);
+            StoryLevelCfg needStoryLevelCfg = StoryLevelCfgArray.Instance.GetCfg(storyLevelCfg.needStoryLevelId);
+            if (!isPass) content = string.Format("完成主线{0}-{1}解锁", needStoryLevelCfg.chapterId, needStoryLevelCfg.order);
+            canFight = isPass && isRoleLv && isLastPast;
+        }
+
+
         public void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
         {
             ViewManager.Show(VIEW_NAME, new object[] { TYPE_SELECT_INDEX, PROPERTY_SELECT_INDEX }, ViewManager.GetGoBackDatas(VIEW_NAME));

+ 32 - 6
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachOfItemView.cs

@@ -1,6 +1,7 @@
 using UI.CommonGame;
 using System.Collections.Generic;
 using FairyGUI;
+using System;
 
 namespace GFGGame
 {
@@ -89,8 +90,9 @@ namespace GFGGame
                 else if (levelCfg.type == ConstInstanceZonesType.Studio)
                 {
                     var studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
-                    listItem.target.text = studioCfg.name;
+                    listItem.target.text = levelCfg.name;
                 }
+
             }
             else
             {
@@ -120,13 +122,19 @@ namespace GFGGame
                     string value = infos[1];
                     var levelCfgId = int.Parse(value);
                     var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
-                    if (!MainStoryDataManager.CheckLevelUnlock(levelCfgId))
-                    {
-                        PromptController.Instance.ShowFloatTextPrompt("关卡未开启");
-                        break;
-                    }
+
                     if (levelCfg.type == ConstInstanceZonesType.Story)
                     {
+                        if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(ViewName.STORY_CHAPTER_VIEW))
+                        {
+                            break;
+                        }
+                        if (!MainStoryDataManager.CheckLevelUnlock(levelCfgId))
+                        {
+                            PromptController.Instance.ShowFloatTextPrompt("关卡未开启");
+                            break;
+                        }
+
                         if ((string)_fromeViewDatas[0] == ViewName.DRESS_UP_FIGHT_VIEW)
                         {
                             //从战斗换装必需品来源跳转到剧情界面,在剧情界面点返回后直接返回章节界面,无需返回换装界面
@@ -136,7 +144,25 @@ namespace GFGGame
                     }
                     else if (levelCfg.type == ConstInstanceZonesType.Studio)
                     {
+                        StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
+
+                        if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(studioCfg.funId))
+                        {
+                            break;
+                        }
                         //TO DO
+                        List<StoryLevelCfg> storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(studioCfg.type, studioCfg.subType, studioCfg.id);
+                        StudioDataManager.Instance.IsCanFight(levelCfg.id, out bool canFight, out string content);
+                        if (!canFight)
+                        {
+                            PromptController.Instance.ShowFloatTextPrompt("关卡未开启");
+                            break;
+                        }
+                        this.Hide();
+                        int type = studioCfg.name == typeof(StudioPropertyView).Name ? 1 : 0;
+                        string viewName = "GFGGame." + studioCfg.funId;
+                        ViewManager.Show(viewName, new object[] { type, 0 }, _fromeViewDatas);
+
                     }
                     StoryController.ShowLevelView(levelCfgId);
                     break;

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

@@ -125,7 +125,7 @@ namespace GFGGame
             UpdateRoleLvl();
             _valueBarController.OnShown();
 
-            CheckFunOpen();
+            // CheckFunOpen();
             // UpdateToCheckGuide();
             Timers.inst.AddUpdate(Update);
         }
@@ -309,6 +309,7 @@ namespace GFGGame
 
         private void Update(object param)
         {
+            CheckFunOpen();
             UpdateRedDot();
             ShowExitAlert();
         }

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

@@ -17,6 +17,7 @@ namespace GFGGame
         protected override void OnInit()
         {
             base.OnInit();
+            packageName = UI_StudioEctypeUI.PACKAGE_NAME;
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
 
         }