Эх сурвалжийг харах

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong 1 жил өмнө
parent
commit
d03a277451

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Arena/ArenaFightRecordView.cs

@@ -96,7 +96,7 @@ namespace GFGGame
             ArenaTargetData targetData = historyData.targetData;
             if (targetData.Type == FightTargetType.ROBOT)
             {
-                PromptController.Instance.ShowFloatTextPrompt("玩家不在线");
+                PromptController.Instance.ShowFloatTextPrompt("玩家不在线,无法查看搭配");
                 return;
             }
             bool result = await ArenaSproxy.ReqArenaFightAttr(targetData.RoleInfo.roleId, targetData.FightDatas);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Arena/ArenaRankView.cs

@@ -328,7 +328,7 @@ namespace GFGGame
             ArenaTargetData targetData = (context.sender as GObject).data as ArenaTargetData;
             if (targetData == null || targetData.Type == FightTargetType.ROBOT)
             {
-                PromptController.Instance.ShowFloatTextPrompt("玩家不在线");
+                PromptController.Instance.ShowFloatTextPrompt("玩家不在线,无法查看搭配");
                 return;
             }
             if (_rankType == ArenaRankType.LAST_SEASON)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Arena/ArenaView.cs

@@ -443,7 +443,7 @@ namespace GFGGame
             ArenaTargetData targetData = (context.sender as GObject).data as ArenaTargetData;
             if (targetData.Type == FightTargetType.ROBOT)
             {
-                PromptController.Instance.ShowFloatTextPrompt("玩家不在线");
+                PromptController.Instance.ShowFloatTextPrompt("玩家不在线,无法查看搭配");
                 return;
             }
             ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.TAEGET, 0, targetData.FightDatas, "" }, new object[] { typeof(ArenaView).FullName, this.viewData }, true);

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/LuckyBoxController.cs

@@ -195,9 +195,10 @@ namespace GFGGame
         {
             _index ^= 1;
         }
+
         private bool InitModel(int index)
         {
-            if (_dressUpObjUIs[index].sceneObject == null)
+            if (index >= _dressUpObjUIs.Count || _dressUpObjUIs[index].sceneObject == null)
             {
                 return false;
             }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -271,7 +271,7 @@ namespace GFGGame
                 case ConstItemID.LUCKYBOX_COST_1:
                 case ConstItemID.LUCKYBOX_COST_2:
                     // ItemUtil.ExchangeItemById(itemId, 10, true, null, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED, true);
-                    BuyItemConteoller.Show(itemId, 10, ConstBuyType.TYPE_ITEM, null, true, false, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
+                    BuyItemConteoller.Show(itemId, 1, ConstBuyType.TYPE_ITEM, null, true, false, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
                     break;
                 case ConstItemID.LUCKYBOX_ACTIVITY_STORE_COST_2:
                     OnClickLuckyBoxActivityProp();

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySignView.cs

@@ -76,9 +76,13 @@ namespace GFGGame
         {
             base.OnShown();
             _ui.m_proSign.m_holder.visible = false;
+            GRoot.inst.touchable = false;
+            _ui.m_t0.SetHook("touch", () => { GRoot.inst.touchable = true; });
             _ui.m_t0.Play(() =>
             {
                 _ui.m_proSign.m_holder.visible = true;
+                //不知道sethook会不会出问题,在这里也加一个
+                GRoot.inst.touchable = true;
                 if (m_holderSign != null)
                 {
                     m_holderSign.visible = true;

+ 9 - 5
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/DressUpGuideView.cs

@@ -86,11 +86,11 @@ namespace GFGGame
 
             if (DressUpMenuItemDataManager.isLoading)
             {
-                //ViewManager.Show<ModalStatusView>("加载中...");
                 ViewManager.Show<LoadingView>();
+                LoadingView.Instance.SetDesc("正在加载服装数据...");
                 DressUpConfigUtil.LoadCount = 0;
-                DressUpMenuItemDataManager.GetAllDressUpGuideIdListBySubTypeAsync();
                 Timers.inst.StartCoroutine(UpdateLoadProgress());
+                DressUpMenuItemDataManager.GetAllDressUpGuideIdListBySubTypeAsync();
             }
             else
             {
@@ -139,13 +139,19 @@ namespace GFGGame
 
         private IEnumerator UpdateLoadProgress()
         {
-            LoadingView.Instance.SetDesc("正在加载服装数据...");
             while (DressUpMenuItemDataManager.isLoading)
             {
                 int sum = GlobalCfgArray.globalCfg.ClothingPartsCount;
                 LoadingView.Instance.SetProgress(FieldGuideView.ProgressCalculate(DressUpConfigUtil.LoadCount, sum));
                 yield return new WaitForEndOfFrame();
             }
+
+            LoadingView.Instance.SetProgress(100, () =>
+            {
+                ViewManager.Hide<LoadingView>();
+            }
+            );
+            
         }
 
         private void RenderListDressUpItem(int index, GObject item)
@@ -362,8 +368,6 @@ namespace GFGGame
         {
             UpdateItemIdListByType1(0);
             UpdateItemListUI();
-            //ViewManager.Hide<ModalStatusView>();
-            ViewManager.Hide<LoadingView>();
         }
     }
 }

+ 89 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -5,6 +5,8 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
 using System;
+using YooAsset;
+using GFGGame.Launcher;
 
 namespace GFGGame
 {
@@ -109,6 +111,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+
+            // 初始化
             MusicManager.Instance.Stop();
             MusicManager.Instance.SetNormalVolumn(0.6f);
             MusicManager.Instance.SetVolume(0);
@@ -150,9 +154,6 @@ namespace GFGGame
             }
 
             _ui.m_btnSkip.visible = skipable;
-
-            ShowNextStep(_storyStartID);
-
             _ui.m_c1.selectedIndex = 0;
             _ui.m_btnAutoPlay.selected = false;
 
@@ -173,6 +174,9 @@ namespace GFGGame
             _ui.m_btnBack.visible = InstanceZonesDataManager.CheckLevelPass(100001001);
             StoryDialogDataManager.Instance.Clear();
 
+            InitStepListById(_storyStartID);
+            // 检查资源的初始化
+            Timers.inst.StartCoroutine(CheckResLoad());
         }
 
         protected override void OnHide()
@@ -912,5 +916,87 @@ namespace GFGGame
             PrefabManager.Instance.Restore(cg);
             OnStepComplete();
         }
+
+        /// <summary>
+        /// 检查资源加载是否完成
+        /// </summary>
+        private IEnumerator CheckResLoad()
+        {
+            List<string> resList = new List<string>();
+
+            for (int i = 0; i < _stepListToRead.Count; i++)
+            {
+                StoryDialogCfg cfg = _stepListToRead[i];
+
+                if (cfg.bgRes.Length > 0)
+                {
+                    string bgRes = ResPathUtil.GetSceneBgPath(cfg.bgRes);
+                    if (!resList.Contains(bgRes))
+                    {
+                        resList.Add(bgRes);
+                    }
+                }
+
+                if (cfg.aniRes.Length > 0)
+                {
+                    string res = cfg.aniRes.Split('/')[1];
+                    string aniRes = ResPathUtil.GetStoryDialogCGPath(cfg.aniRes, res);
+                    if (!resList.Contains(aniRes))
+                    {
+                        resList.Add(aniRes);
+                    }
+                }
+            }
+
+            ResourceDownloaderOperation downloaderOperation = YooAssets.CreateBundleDownloader(resList.ToArray(), 3, 3);
+            if (downloaderOperation.TotalDownloadCount == 0)
+            {
+                ShowNextStep(_storyStartID);
+                yield break;
+            }
+
+            // 开始加载资源
+            ViewManager.Show<LoadingView>();
+            LoadingView.Instance.SetDesc("正在加载剧情资源...");
+
+            downloaderOperation.OnDownloadErrorCallback =
+            (fileName, error) =>
+            {
+                Debug.LogError($"加载{fileName}失败 {error}");
+            };
+
+            downloaderOperation.OnDownloadProgressCallback =
+            (totalDownloadCount, currentDownloadCount, totalDownloadSizeBytes, currentDownloadSizeBytes) =>
+            {
+                string currentSizeMB = (currentDownloadSizeBytes / 1048576f).ToString("f1");
+                string totalSizeMB = (totalDownloadSizeBytes / 1048576f).ToString("f1");
+                var progress = (float)currentDownloadSizeBytes / totalDownloadSizeBytes;
+                //LauncherView.Instance.SetDesc($"正在下载资源,{currentDownloadCount}/{totalDownloadCount}", $"{currentSizeMB}MB/{totalSizeMB}MB", true);
+                LoadingView.Instance.SetProgress((int)(progress * 100));
+            };
+
+            downloaderOperation.BeginDownload();
+            yield return downloaderOperation;
+
+            // 检测下载结果
+            if (downloaderOperation.Status != EOperationStatus.Succeed)
+            {
+                Alert.Show("下载失败!请检查网络状态后重试。")
+                    .SetLeftButton(true, "返回", (data) =>
+                    {
+                        ViewManager.Hide<LoadingView>();
+                        Hide();
+                    });
+                yield break;
+            }
+
+            // 加载完成
+            LoadingView.Instance.SetProgress(100, () =>
+                {
+                    ViewManager.Hide<LoadingView>();
+                    ShowNextStep(_storyStartID);
+                }
+            );
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/Arena/Arena_fui.bytes


BIN
GameClient/Assets/ResIn/UI/DailyWelfare/DailyWelfare_fui.bytes