Browse Source

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

guodong 1 year ago
parent
commit
06a23dd222

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -314,14 +314,14 @@ namespace GFGGame
 
         public bool RedBtnRight(int curIndex)
         {
-            int index = curIndex + 1;
-            for (int i = index; i < BOX_ID_3; i++) {
-                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[i];
+            var luckyBoxIds = LuckyBoxDataManager.Instance.luckyBoxIds;
+            for (int i = curIndex + 1; i < luckyBoxIds.Count; i++) {
+                int boxId = luckyBoxIds[i];
                 long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
                 if (freeTime > 0 && freeTime - TimeHelper.ServerNow() < 0)
                     return true;
 
-                if (index == 1 && RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy))
+                if (curIndex == 1 && RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy))
                     return true;
             }
 

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Data/PhotographSceneManager.cs

@@ -24,6 +24,12 @@ namespace GFGGame
         public void AddBorderItem(ItemCfg itemCfg)
         {
             Transform tf = sceneObject.transform.Find("Border/BorderRes");
+
+            // 刷新父节点Border的数据
+            tf.parent.position = Vector3.zero;
+            tf.parent.eulerAngles = Vector3.zero;
+            tf.parent.localScale = Vector3.one;
+
             string resPath;
 
             if (itemCfg.id != ConstItemID.BORDERID)

+ 5 - 1
GameClient/Assets/Game/HotUpdate/Data/PhotographUtil.cs

@@ -42,14 +42,18 @@ namespace GFGGame
         //设置物体中心点
         public async Task SetGameObjectCenter(GameObject parentObj)
         {
+            // 先隐藏,不然位置会出现闪一下
+            parentObj.SetActive(false);
             await Task.Delay(5);
+            parentObj.SetActive(true);
             Transform parent = parentObj.transform;  // 2.选中技算
             Vector3 postion = parent.position;
             Quaternion rotation = parent.rotation;
-            Vector3 scale = parent.localScale;
+           
             parent.position = Vector3.zero;
             parent.rotation = Quaternion.Euler(Vector3.zero);
             parent.localScale = Vector3.one;
+            Vector3 scale = parent.localScale;
             Vector3 center = Vector3.zero;
             int index = 0;
             foreach (Transform t in parent)

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

@@ -89,13 +89,12 @@ namespace GFGGame
             _arenaCfg = ArenaOpenCfgArray.Instance.GetCfg(_dataManager.SeasonId);
             _valueBarController.OnShown();
             _dataManager.SetMineFightAttrs();
-
             if (_dataManager.DressupList.Count == 0) return;
             InstanceZonesDataManager.FightScene = ConstInstanceZonesType.Arena;
+            _dataManager.CurFightIndex = 0;
             if (_targetData == null)
             {
                 _dataManager.SelectTargetIndex = -1;
-                _dataManager.CurFightIndex = 0;
                 _dataManager.myScore.Clear();
                 _dataManager.targetScore.Clear();
                 _dataManager.myFightPower.Clear();
@@ -105,6 +104,7 @@ namespace GFGGame
             }
             else
             {
+                Debug.LogError($"_targetData {_targetData.FightDatas.Count}");
                 _ui.m_c1.selectedIndex = 1;
             }
 

+ 6 - 2
GameClient/Assets/Game/HotUpdate/Views/Card/CardUpView.cs

@@ -159,6 +159,9 @@ namespace GFGGame
         private void RenderListCardPropertyItem(int index, GObject obj)
         {
             UI_ListScoreItem2 listItem = UI_ListScoreItem2.Proxy(obj);
+            if (_cardStarCfg == null)
+                ET.Log.Error("RenderListCardPropertyItemd _cardStarCfg is null");
+
             int typeIndex = 1;
             if (_cardStarCfg.score1 > 0)
                 typeIndex = 1;
@@ -168,8 +171,9 @@ namespace GFGGame
                 typeIndex = 3;
             else if (_cardStarCfg.score4 > 0)
                 typeIndex = 4;
-            if(_scores.ContainsKey(typeIndex))
-                listItem.m_txtProperty.text = _scores[typeIndex].ToString();
+
+            _scores.TryGetValue(typeIndex, out var scoresValue);
+            listItem.m_txtProperty.text = scoresValue.ToString();
             listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + typeIndex);
             UI_ListScoreItem2.ProxyEnd();
         }

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

@@ -257,7 +257,7 @@ namespace GFGGame
 
         private void ChangeModelAlphaAnim(int index, float start, float end, Action action = null)
         {
-            Ease ease = start < end ? Ease.InQuad : Ease.OutQuad;
+            Ease ease = Ease.OutQuad;
             DOTween.To(() => start, (value) =>
             {
                 ChangeModelAlpha(index, value);

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -194,6 +194,12 @@ namespace GFGGame
                 _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
                 UpdateNeedClothesState();
             }
+            //判断日志,后续解决飞花令需要删除
+            if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena && _levelID != 0)
+            {
+                Debug.LogError($"text :_levelID: {_levelID}");
+            }
+
             InstanceZonesDataManager.currentScoreType = scoreType;
             //一级菜单
             _ui.m_comListType1.m_listType.RemoveChildrenToPool();

+ 72 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -51,6 +51,10 @@ namespace GFGGame
         private PinchGesture pinchGesture;
         private RotationGesture rotationGesture;
 
+        // 以下两个属于单选,单独保存
+        private int lastChooseBorder;       // 上一次选择的边框
+        private int lastChooseBg;           // 上一次选择的背景
+
         public override void Dispose()
         {
             if (_sceneObject != null)
@@ -78,7 +82,7 @@ namespace GFGGame
 
             _ui.m_btnBg.onClick.Add(OnClickBtnBg);
 
-            _ui.m_btnChoose.onClick.Add(SetUIView);
+            _ui.m_btnChoose.onClick.Add(OnClickBtnChoose);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnPhotograph.onClick.Add(OnClickBtnPhotograph);
             _ui.m_btnGalleryJoin.onClick.Add(OnClickBtnGalleryJoin);
@@ -136,6 +140,7 @@ namespace GFGGame
             RefreshList(EnumPhotographType.BG);
             SetUIView();
             PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(MyDressUpHelper.dressUpObj.bgId));
+            SetListScrollByID(MyDressUpHelper.dressUpObj.bgId);
             PhotographSceneManager.Instance.AddBodyItem();
             UpdateScene();
             PhotographUtil.Instance.SetLayer(null, "refresh");
@@ -144,23 +149,63 @@ namespace GFGGame
 
             Timers.inst.AddUpdate(CheckGuide);
         }
+
         /************************************************************UI界面*********************************************************/
         private void OnContorllerChanged(EventContext context)
         {
             int index = _ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex;
             RefreshList((EnumPhotographType)index);
         }
+
         private void RefreshList(EnumPhotographType index)
         {
             _ui.m_ComSelectRes.m_list.numItems = 0;
 
             _listData = PhotographDataManager.Instance.GetListData(index);
             _ui.m_ComSelectRes.m_list.numItems = _listData.Count;
-            if (index == EnumPhotographType.BORDER || index == EnumPhotographType.EFFECT)
+
+            bool setTop = false;
+            switch (index)
             {
-                _ui.m_ComSelectRes.m_list.selectedIndex = 0;
+                case EnumPhotographType.BORDER:
+                    _ui.m_ComSelectRes.m_list.selectedIndex = lastChooseBorder;
+                    break;
+
+                case EnumPhotographType.BG:
+                    _ui.m_ComSelectRes.m_list.selectedIndex = lastChooseBg;
+                    break;
+                default:
+                    setTop = true;
+                    break;
+            }
+
+            if (!setTop)
+            {
+                _ui.m_ComSelectRes.m_list.ScrollToView(_ui.m_ComSelectRes.m_list.selectedIndex);
+            }
+            else
+            {
+                _ui.m_ComSelectRes.m_list.scrollPane.ScrollTop();
+            }
+            //if (index == EnumPhotographType.BORDER || index == EnumPhotographType.EFFECT)
+            //{
+            //    _ui.m_ComSelectRes.m_list.selectedIndex = 0;
+            //}
+        }
+
+        private void SetListScrollByID(int id)
+        {
+            for(int i = 0; i < _listData.Count; i++)
+            {
+                if(id == _listData[i])
+                {
+                    _ui.m_ComSelectRes.m_list.selectedIndex = i;
+                    _ui.m_ComSelectRes.m_list.ScrollToView(_ui.m_ComSelectRes.m_list.selectedIndex);
+                    lastChooseBg = i;
+                }
             }
         }
+
         private void RenderListItem(int index, GObject obj)
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listData[index]);
@@ -172,6 +217,7 @@ namespace GFGGame
             item.m_txtName.text = itemCfg.name;
             UI_ListItem.ProxyEnd();
         }
+
         private void OnListItemClick(EventContext context)
         {
             EnumPhotographType type = (EnumPhotographType)_ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex;
@@ -180,9 +226,22 @@ namespace GFGGame
                 PromptController.Instance.ShowFloatTextPrompt("最多穿戴" + MAX_COUNT + "件物品");
                 return;
             }
+
+            switch (type)
+            {
+                case EnumPhotographType.BORDER:
+                    lastChooseBorder = _ui.m_ComSelectRes.m_list.selectedIndex;
+                    break;
+
+                case EnumPhotographType.BG:
+                    lastChooseBg = _ui.m_ComSelectRes.m_list.selectedIndex;
+                    break;
+            }
+
             int itemID = (int)((context.data as GObject).data);
             ChangeItem(itemID);
         }
+
         private void ChangeItem(int itemID)
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
@@ -512,6 +571,8 @@ namespace GFGGame
             _ui.m_comSelectBox.target.visible = false;
             hitGameObj = null;
             memoryHitGameObj = null;
+            lastChooseBorder = 0;
+            lastChooseBg = 0;
             _ui.m_ComSelectRes.m_comBtnTab.target.scrollPane.SetPercX(0, false);
             _ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex = 0;
             if (_ui.m_ComSelectRes.m_list.numItems > 0)
@@ -521,6 +582,14 @@ namespace GFGGame
             }
         }
 
+        private void OnClickBtnChoose()
+        {
+            _ui.m_ComSelectRes.target.visible = true;
+            _ui.m_comSelectBox.target.visible = false;
+            hitGameObj = null;
+            memoryHitGameObj = null;
+        }
+
         private void OnClickBtnUp()
         {
 

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Views/Field/FieldView.cs

@@ -132,8 +132,10 @@ namespace GFGGame
             // UpdateView();
             OnClickBtnGo();
 
-            if (GuideDataManager.IsGuideFinish(ConstGuideId.FIELD) <= 0)
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.FIELD) <= 0) {
+                GuideController.TryCompleteGuideIndex(ConstGuideId.FIELD,1);
                 GuideController.TryCompleteGuide(ConstGuideId.FIELD, 1);
+            }
         }
         private void UpdateView()
         {

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

@@ -150,8 +150,12 @@ namespace GFGGame
 
         private void RenderListDressUpItem(int index, GObject item)
         {
-            UI_ListDressUpPartsItem listItem = UI_ListDressUpPartsItem.Proxy(item);
+            if(index >= _itemIdList.Count)
+            {
+                return;
+            }
 
+            UI_ListDressUpPartsItem listItem = UI_ListDressUpPartsItem.Proxy(item);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemIdList[index]);
             listItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg.res, "png");
             listItem.m_txtTitle.text = itemCfg.name;
@@ -159,7 +163,6 @@ namespace GFGGame
             listItem.m_unlockMask.visible = !DressUpMenuItemDataManager.CheckHasItem(itemCfg.id);
             RarityIconController.UpdateRarityIcon(listItem.m_rarity, _itemIdList[index], false);
             listItem.target.data = _itemIdList[index];
-
             UI_ListDressUpPartsItem.ProxyEnd();
         }
 

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerRankView.cs

@@ -84,7 +84,8 @@ namespace GFGGame
         }
         private void UpdateView()
         {
-            _ui.m_list.numItems = LeagueDataManager.Instance.ListAnswerRankDatas[_ui.m_c1.selectedIndex].Count;
+            if (!LeagueDataManager.Instance.ListAnswerRankDatas.ContainsKey(_ui.m_c1.selectedIndex))
+                _ui.m_list.numItems = LeagueDataManager.Instance.ListAnswerRankDatas[_ui.m_c1.selectedIndex].Count;
             UpdateItem(_myIndex, _ui.m_comMine.target, true);
         }
 

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

@@ -241,7 +241,12 @@ namespace GFGGame
             if (roleType == FightRoleType.MINE)
             {
                 if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
-                { 
+                {
+                    //添加容错,这里回合数是按照主题个数来的,下标0开始
+                    if (ArenaDataManager.Instance.CurFightIndex >= ArenaDataManager.Instance.ThemeList.Count)
+                    {
+                        ArenaDataManager.Instance.CurFightIndex = ArenaDataManager.Instance.CurFightIndex % ArenaDataManager.Instance.ThemeList.Count;
+                    }
                     Dictionary<int, Dictionary<int ,List<PassivitySkillLvlCfg>>> dic = new Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>>();
                     Dictionary<int, List<PassivitySkillLvlCfg>> dic1 = new Dictionary<int, List<PassivitySkillLvlCfg>>();
                     //vaildSkills = ArenaDataManager.Instance.vaildSkills[ArenaDataManager.Instance.CurFightIndex][_partId][_currentTime];
@@ -276,6 +281,11 @@ namespace GFGGame
             {
                 if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
                 {
+                    //添加容错,这里回合数是按照主题个数来的,下标0开始
+                    if (ArenaDataManager.Instance.CurFightIndex >= ArenaDataManager.Instance.ThemeList.Count)
+                    {
+                        ArenaDataManager.Instance.CurFightIndex = ArenaDataManager.Instance.CurFightIndex % ArenaDataManager.Instance.ThemeList.Count;
+                    }
                     Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>> dic = new Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>>();
                     Dictionary<int, List<PassivitySkillLvlCfg>> dic1 = new Dictionary<int, List<PassivitySkillLvlCfg>>();
                     ArenaDataManager.Instance.targetVaildSkills.TryGetValue(ArenaDataManager.Instance.CurFightIndex, out dic);