Selaa lähdekoodia

扫荡按钮展示优化

zhaoyang 3 vuotta sitten
vanhempi
commit
c7691c0b67

+ 4 - 14
GameClient/Assets/Game/HotUpdate/Data/InstanceZonesDataManager.cs

@@ -271,24 +271,14 @@ namespace GFGGame
         {
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
             times = (int)Math.Floor((float)RoleDataManager.power / levelCfg.power);//体力次数
+            times = Math.Min(GameConst.MAX_COUNT_FIGHT_QUICKLY, times);
             title = "";
-            if (type == ConstInstanceZonesType.Story && subType == ConstInstanceZonesSubType.Normal)
-            {
-                times = Math.Min(GameConst.MAX_COUNT_FIGHT_QUICKLY, times);
-                title = string.Format("挑战{0}次", times == 0 ? "十" : NumberUtil.GetChiniseNumberText(GameConst.MAX_COUNT_FIGHT_QUICKLY));
-            }
-            else if (type == ConstInstanceZonesType.Story && subType == ConstInstanceZonesSubType.Hard)
-            {
-                times = Math.Min(GameConst.MAX_COUNT_FIGHT_QUICKLY, times);
-                title = string.Format("挑战{0}次", times == 0 ? "十" : NumberUtil.GetChiniseNumberText(times));
-
-            }
-            else if (type == ConstInstanceZonesType.Studio)
+            if (type == ConstInstanceZonesType.Studio)
             {
                 StudioData studioData = StudioDataManager.Instance.GetStudioDataById(levelCfg.chapterId);
-                times = Math.Min(Math.Min(GameConst.MAX_COUNT_FIGHT_QUICKLY, times), studioData.TotalPlayTimes - studioData.PlayTimes);
-                title = string.Format("挑战{0}次", times == 0 ? "十" : NumberUtil.GetChiniseNumberText(times));
+                times = Math.Min(times, studioData.TotalPlayTimes - studioData.PlayTimes);
             }
+            title = string.Format("挑战{0}次", NumberUtil.GetChiniseNumberText(times));
         }
         public static void GetTotalProgress(out int count, out int totalCount)
         {

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Utils/NumberUtil.cs

@@ -11,6 +11,10 @@ namespace GFGGame
             int numInTen = 0;
             string strInUnit = "";
             string strInTen = "";
+            if (num == 0)
+            {
+                return "零";
+            }
             if (num <= 10)
             {
                 return GameConst.CHINESE_NUMBER[num - 1];

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

@@ -82,17 +82,34 @@ namespace GFGGame
         private void StartFight()
         {
             InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
-
-            if (_storyType == ConstInstanceZonesSubType.Normal && times < _fightType)
+            if (times == 0)
             {
-                ItemUtil.AddPower("体力不足", () => { StartFight(); });
+                StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
+
+                if (levelCfg.type == ConstInstanceZonesType.Story)
+                {
+                    ItemUtil.AddPower("体力不足", StartFight);
+                }
+                else if (levelCfg.type == ConstInstanceZonesType.Studio)
+                {
+                    StudioData studioData = StudioDataManager.Instance.GetStudioDataById(levelCfg.chapterId);
+                    if (studioData.TotalPlayTimes - studioData.PlayTimes == 0)
+                    {
+                        PromptController.Instance.ShowFloatTextPrompt("挑战次数不足");
+                        ViewManager.Show<StudioBuyNumView>(levelCfg.chapterId);
+                    }
+                    else
+                    {
+                        ItemUtil.AddPower("体力不足", StartFight);
+                    }
+                }
                 return;
             }
+
             this.clickBlankToClose = false;
 
             // _ui.m_t0.Play(() =>
             // {
-
             _ui.m_btnExit.visible = false;
             _ui.m_btnFightTimes.visible = false;
             _ui.m_txtPowerDesc.visible = false;
@@ -100,7 +117,6 @@ namespace GFGGame
             InstanceZonesDataManager.isQuicklyFighting = true;
             InstanceZonesSProxy.FinishStoryFightQuickly(_levelID, _fightType == 1 ? 1 : times).Coroutine();
             this.clickBlankToClose = true;
-
             // });
         }
 
@@ -168,13 +184,8 @@ namespace GFGGame
                 InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
                 _ui.m_btnFightTimes.title = _fightType == 1 ? "挑战一次" : title;
                 _ui.m_btnFightTimes.visible = times > 0;
-                if (_type == ConstInstanceZonesType.Story && _storyType == ConstInstanceZonesSubType.Normal)
-                {
-                    _ui.m_btnFightTimes.visible = true;
-                    times = _fightType == 1 ? 1 : GameConst.MAX_COUNT_FIGHT_QUICKLY;
-                }
-                _ui.m_txtPowerDesc.visible = _ui.m_btnFightTimes.visible;
 
+                _ui.m_txtPowerDesc.visible = _ui.m_btnFightTimes.visible;
                 if (_ui.m_txtPowerDesc.visible)
                 {
                     int power = times * levelCfg.power;

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

@@ -91,7 +91,6 @@ namespace GFGGame
 
                 if (RoleDataManager.power < levelCfg.power)
                 {
-
                     ItemUtil.AddPower("体力不足", OnClickBtnStart);
                 }
                 else
@@ -128,12 +127,9 @@ namespace GFGGame
             }
             else
             {
-                // var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
-
                 if (RoleDataManager.power < levelCfg.power)
                 {
-
-                    ItemUtil.AddPower("体力不足", OnClickBtnStart);
+                    ItemUtil.AddPower("体力不足", OnClickBtnFightOnce);
                 }
                 else
                 {
@@ -148,37 +144,14 @@ namespace GFGGame
                 }
             }
         }
+
         private void OnClickBtnFightTimes()
         {
-            int starCount = InstanceZonesDataManager.GetStarCountHistory(_levelID);
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
-            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-
-            if (starCount < fightCfg.quickFightStart)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("挑战星数不足");
-                return;
-            }
+            //只要按钮显示说明一定可以速刷多次
             InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
+            ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, times, new object[] { typeof(StoryLevelInfoView).FullName, this.viewData });
+            this.Hide();
 
-            if (_type == ConstInstanceZonesType.Story && _storyType == ConstInstanceZonesSubType.Normal)
-            {
-                if (times < GameConst.MAX_COUNT_FIGHT_QUICKLY)
-                {
-                    ItemUtil.AddPower("体力不足", OnClickBtnFightTimes);
-                }
-                else
-                {
-                    ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, times, new object[] { typeof(StoryLevelInfoView).FullName, this.viewData });
-                    this.Hide();
-                }
-            }
-            else
-            {
-                ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, times, new object[] { typeof(StoryLevelInfoView).FullName, this.viewData });
-                this.Hide();
-
-            }
         }
 
         private void UpdateBonusItem(int index, GObject item)
@@ -198,16 +171,9 @@ namespace GFGGame
 
         private void UpdateBtnFightTimes()
         {
-            if (_ui.m_groupPass.visible)
-            {
-                InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
-                _ui.m_btnFightTimes.title = title;
-                _ui.m_btnFightTimes.visible = times > 0;
-                if (_type == ConstInstanceZonesType.Story && _storyType == ConstInstanceZonesSubType.Normal)
-                {
-                    _ui.m_btnFightTimes.visible = true;
-                }
-            }
+            InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
+            _ui.m_btnFightTimes.title = title;
+            _ui.m_btnFightTimes.visible = times > 1;
         }
 
         private void UpdateView()

BIN
GameClient/Assets/ResIn/UI/ClothingSynthetic/ClothingSynthetic_fui.bytes