Browse Source

工作室副本

zhaoyang 3 years ago
parent
commit
710e5e4844

+ 4 - 2
GameClient/Assets/Game/HotUpdate/Data/FunctionOpenDataManager.cs

@@ -85,7 +85,9 @@ namespace GFGGame
             {
             {
                 return true;
                 return true;
             }
             }
-            if (showTips) PromptController.Instance.ShowFloatTextPrompt("功能暂未开启,敬请期待");
+            StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(cfg.storyLevelId);
+            StoryChapterCfg storyChapterCfg = StoryChapterCfgArray.Instance.GetCfg(storyLevelCfg.chapterId);
+            if (showTips) PromptController.Instance.ShowFloatTextPrompt(string.Format("通关主线{0}-{1}解锁", storyChapterCfg.order, storyLevelCfg.order));
             return false;
             return false;
         }
         }
 
 
@@ -96,7 +98,7 @@ namespace GFGGame
             {
             {
                 return true;
                 return true;
             }
             }
-            if (showTips) PromptController.Instance.ShowFloatTextPrompt("功能暂未开启,敬请期待");
+            if (showTips) PromptController.Instance.ShowFloatTextPrompt(string.Format("角色达到{0}级解锁", cfg.lv));
             return false;
             return false;
         }
         }
     }
     }

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

@@ -54,19 +54,20 @@ namespace GFGGame
             }
             }
         }
         }
 
 
-        public void IsCanFight(StoryLevelCfg[] storyLevelCfgs, StoryLevelCfg storyLevelCfg, out bool canFight, out string content)
+        public void IsCanFight(StoryLevelCfg[] storyLevelCfgs, int index, out bool canFight, out string content)
         {
         {
+            StoryLevelCfg storyLevelCfg = storyLevelCfgs[index];
             bool isPass = InstanceZonesDataManager.CheckLevelPass(storyLevelCfg.needStoryLevelId);
             bool isPass = InstanceZonesDataManager.CheckLevelPass(storyLevelCfg.needStoryLevelId);
             bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
             bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
             bool isLastPast = true;
             bool isLastPast = true;
-            int index = Array.IndexOf(storyLevelCfgs, storyLevelCfg);
+
             if (index > 0)
             if (index > 0)
             {
             {
-                isLastPast = InstanceZonesDataManager.CheckLevelPass(storyLevelCfgs[index - 1].needStoryLevelId);
+                isLastPast = InstanceZonesDataManager.CheckLevelPass(storyLevelCfgs[index - 1].id);
             }
             }
             content = "";
             content = "";
             if (!isRoleLv) content = string.Format("主角等级达到{0}级解锁", storyLevelCfg.order);
             if (!isRoleLv) content = string.Format("主角等级达到{0}级解锁", storyLevelCfg.order);
-            if (!isLastPast) content = "需通关前置关卡";
+            if (!isLastPast) content = string.Format("需通关{0}", storyLevelCfgs[index - 1].name);
             StoryLevelCfg needStoryLevelCfg = StoryLevelCfgArray.Instance.GetCfg(storyLevelCfg.needStoryLevelId);
             StoryLevelCfg needStoryLevelCfg = StoryLevelCfgArray.Instance.GetCfg(storyLevelCfg.needStoryLevelId);
             if (!isPass) content = string.Format("完成主线{0}-{1}解锁", needStoryLevelCfg.chapterId, needStoryLevelCfg.order);
             if (!isPass) content = string.Format("完成主线{0}-{1}解锁", needStoryLevelCfg.chapterId, needStoryLevelCfg.order);
             canFight = isPass && isRoleLv && isLastPast;
             canFight = isPass && isRoleLv && isLastPast;

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

@@ -50,7 +50,7 @@ namespace GFGGame
 
 
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-            _type = levelCfg.chapterId;
+            _type = levelCfg.type;
             _storyType = levelCfg.subType;
             _storyType = levelCfg.subType;
             _expAdd = fightCfg.exp;
             _expAdd = fightCfg.exp;
             _power = levelCfg.power;
             _power = levelCfg.power;

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

@@ -15,6 +15,7 @@ namespace GFGGame
         protected StudioCfg studioCfg;
         protected StudioCfg studioCfg;
         protected StoryLevelCfg[] storyLevelCfgs;
         protected StoryLevelCfg[] storyLevelCfgs;
         protected StudioData studioData;
         protected StudioData studioData;
+        private int curIndex = 0;
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -38,7 +39,7 @@ namespace GFGGame
             _ui.m_btnBuy.onClick.Add(OnCliclBtnBuy);
             _ui.m_btnBuy.onClick.Add(OnCliclBtnBuy);
 
 
             EventAgent.AddEventListener(ConstMessage.BUY_STUDIO_PLAY_TIMES, UpdateView);
             EventAgent.AddEventListener(ConstMessage.BUY_STUDIO_PLAY_TIMES, UpdateView);
-            // EventAgent.AddEventListener(ConstMessage.NOTICE_STUDIO_PLAY_TIMES, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_STUDIO_PLAY_TIMES, UpdateView);
 
 
         }
         }
 
 
@@ -46,6 +47,7 @@ namespace GFGGame
         {
         {
             base.OnShown();
             base.OnShown();
             _valueBarController.OnShown();
             _valueBarController.OnShown();
+            _ui.m_list.ScrollToView(curIndex);
             UpdateView();
             UpdateView();
             Timers.inst.Add(1, 0, UpdateShowTime);
             Timers.inst.Add(1, 0, UpdateShowTime);
 
 
@@ -59,10 +61,12 @@ namespace GFGGame
             storyLevelCfgs = null;
             storyLevelCfgs = null;
             studioData = null;
             studioData = null;
             Timers.inst.Remove(UpdateShowTime);
             Timers.inst.Remove(UpdateShowTime);
+            EventAgent.RemoveEventListener(ConstMessage.BUY_STUDIO_PLAY_TIMES, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_STUDIO_PLAY_TIMES, UpdateView);
         }
         }
         private void UpdateView()
         private void UpdateView()
         {
         {
-            _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", this.studioData.TotalPlayTimes - this.studioData.PlayTimes, this.studioData.TotalPlayTimes);
+            _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", this.studioData.TotalPlayTimes - this.studioData.PlayTimes, studioCfg.num);
         }
         }
         private void UpdateShowTime(object param)
         private void UpdateShowTime(object param)
         {
         {
@@ -71,23 +75,23 @@ namespace GFGGame
         private void ListItemRender(int index, GObject obj)
         private void ListItemRender(int index, GObject obj)
         {
         {
             UI_ListItem item = UI_ListItem.Proxy(obj);
             UI_ListItem item = UI_ListItem.Proxy(obj);
-            StudioDataManager.Instance.IsCanFight(storyLevelCfgs, storyLevelCfgs[index], out bool canFight, out string content);
+            StudioDataManager.Instance.IsCanFight(storyLevelCfgs, index, out bool canFight, out string content);
 
 
             ItemData itemData = StoryBonusDataCache.GetBonusData(storyLevelCfgs[index].id).bonusBase[0];
             ItemData itemData = StoryBonusDataCache.GetBonusData(storyLevelCfgs[index].id).bonusBase[0];
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
-
             item.m_star.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(storyLevelCfgs[index].id);
             item.m_star.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(storyLevelCfgs[index].id);
-
             item.m_imgLock.visible = canFight ? false : true;
             item.m_imgLock.visible = canFight ? false : true;
-            item.m_txtTitle.text = canFight ? string.Format("{0}{1}", studioCfg.name, index + 1) : content;
-            item.target.data = storyLevelCfgs[index];
+            item.m_txtTitle.text = canFight ? storyLevelCfgs[index].name : content;
+            if (canFight) curIndex = index;
+            item.target.data = index;
         }
         }
         private void OnCliclListItem(EventContext context)
         private void OnCliclListItem(EventContext context)
         {
         {
             UI_ListItem item = UI_ListItem.Proxy(context.data as GObject);
             UI_ListItem item = UI_ListItem.Proxy(context.data as GObject);
-            StoryLevelCfg storyLevelCfg = item.target.data as StoryLevelCfg;
-            StudioDataManager.Instance.IsCanFight(storyLevelCfgs, storyLevelCfg, out bool canFight, out string content);
+            int index = (int)item.target.data;
+            StoryLevelCfg storyLevelCfg = storyLevelCfgs[index];
+            StudioDataManager.Instance.IsCanFight(storyLevelCfgs, index, out bool canFight, out string content);
             if (!canFight)
             if (!canFight)
             {
             {
                 PromptController.Instance.ShowFloatTextPrompt(content);
                 PromptController.Instance.ShowFloatTextPrompt(content);
@@ -97,15 +101,6 @@ namespace GFGGame
         }
         }
 
 
 
 
-        private bool GetCanFight(StoryLevelCfg storyLevelCfg)
-        {
-            bool isPass = InstanceZonesDataManager.CheckLevelPass(storyLevelCfg.needStoryLevelId);
-            bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
-            return isPass && isRoleLv;
-        }
-
-
-
         private void OnCliclBtnBuy()
         private void OnCliclBtnBuy()
         {
         {
             ViewManager.Show<StudioBuyNumView>(this.studioCfg.id);
             ViewManager.Show<StudioBuyNumView>(this.studioCfg.id);

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioView.cs

@@ -53,14 +53,17 @@ namespace GFGGame
 
 
         private void OnClickComMetal()
         private void OnClickComMetal()
         {
         {
+            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, true)) return;
             ViewManager.Show<StudioMetalView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
             ViewManager.Show<StudioMetalView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
         }
         }
         private void OnCliclComFabric()
         private void OnCliclComFabric()
         {
         {
+            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, true)) return;
             ViewManager.Show<StudioFabricView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
             ViewManager.Show<StudioFabricView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
         }
         }
         private void OnComProperty()
         private void OnComProperty()
         {
         {
+            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, true)) return;
             ViewManager.Show<StudioPropertyView>(new object[] { 1, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
             ViewManager.Show<StudioPropertyView>(new object[] { 1, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
         }
         }
         private void OnClickComFilling()
         private void OnClickComFilling()