Răsfoiți Sursa

茶话会增加显示套装属性结算

huangxiaoyue 1 an în urmă
părinte
comite
49f1b1c9bd

+ 26 - 0
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuSuitDataManager.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using ET;
 
@@ -235,5 +236,30 @@ namespace GFGGame
             return suitCfg != null && ResPathUtil.CheckDressUpAnimationResExist(suitCfg.aniRes);
         }
 
+        //从配置表中累加计算出套装分数
+        public static Dictionary<int,Dictionary<string, int>> GetSuitTagCfgArray(int suitId)
+        {
+            var suitIDList = new List<int>(SuitCfgArray.Instance.GetSuitItems(suitId, true));
+            Dictionary<string, int> tagsArr = new Dictionary<string, int>();
+            Dictionary<int,Dictionary<string, int>> tagsSuitArr = new Dictionary<int, Dictionary<string, int>>();
+            int index = 0;
+            foreach (var id in suitIDList) {
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
+                for (int i = 0; i< itemCfg.tagsArr.Length;i ++){
+                    if (!tagsArr.ContainsKey(itemCfg.tagsArr[i][0]))
+                        tagsArr[itemCfg.tagsArr[i][0]] = Convert.ToInt32(itemCfg.tagsArr[i][1]);
+                    else 
+                        tagsArr[itemCfg.tagsArr[i][0]] += Convert.ToInt32(itemCfg.tagsArr[i][1]);
+                }
+            }
+            foreach (var info in tagsArr.Keys)
+            {
+                Dictionary<string, int> suitArr  = new Dictionary<string, int>();
+                suitArr.Add(info, tagsArr[info]);
+                tagsSuitArr[index] = suitArr;
+                index += 1;
+            }
+            return tagsSuitArr;
+        }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -298,7 +298,7 @@ namespace GFGGame
 
         public bool CheckTeaPartyPersonRewardCanGet(int targetScore)
         {
-            return CheckTeaPartyPersonRewardStatu(targetScore) == ConstBonusStatus.CAN_GET;
+            return CheckTeaPartyPersonRewardStatu(targetScore) == ConstBonusStatus.CAN_GET && LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo;
         }
 
         //茶话会个人奖励当前状态

+ 2 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -31,6 +31,7 @@ namespace GFGGame
         protected override async ETTask Run(Session session, S2C_LeagueScore message)
         {
             LeagueDataManager.Instance.RoleTeapartyInfo.LeagueScore = message.LeagueScore;
+            LeagueDataManager.Instance.RoleTeapartyInfo.LeagueAwardStatusVs = message.LeagueAwardStatusVs;
             await ETTask.CompletedTask;
         }
     }
@@ -948,7 +949,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
-                    //LeagueDataManager.Instance.RoleContainerList = response.PerScore;
+                    //LeagueDataManager.Instance.RoleTeapartyInfo.PerAwardStatusVs = response.PerAwardStatusVs;
                     EventAgent.DispatchEvent(ConstMessage.TEA_PARTY_REWARD);
                     return true;
                 }
@@ -967,7 +968,6 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
-                    //LeagueDataManager.Instance.RoleContainerList = response.PerScore;
                     EventAgent.DispatchEvent(ConstMessage.TEA_PARTY_REWARD);
                     return true;
                 }

+ 70 - 14
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -242,7 +242,7 @@ namespace GFGGame
                 SendLog();
             else
             {
-                var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
+                var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
                 _ui.m_txtTeaPartyName.text = teapartyRoleCfg[objData.teaPartID - 1].name;
             }
 
@@ -1043,13 +1043,34 @@ namespace GFGGame
             ItemCfg itemCfg = (ItemCfg)item.parent.data;
             UI_ComTagItem listItem = UI_ComTagItem.Proxy(item);
             string name = itemCfg.tagsArr[index][0].ToString();
+            string score = itemCfg.tagsArr[index][1];
             int tagType = TagCfgArray.Instance.GetCfg(name).type;
             UI.CommonGame.UI_ComTag itemTag = UI.CommonGame.UI_ComTag.Proxy(listItem.m_loaTag);
             itemTag.m_txtTag.text = name;
             itemTag.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
             itemTag.m_loaTag.scale = new Vector2(0.8f, 0.8f);
             UI.CommonGame.UI_ComTag.ProxyEnd();
-            listItem.m_txtScore.text = itemCfg.tagsArr[index][1];
+            listItem.m_txtScore.text = score;
+            UI_ComTagItem.ProxyEnd();
+        }
+
+        private void ListSuitTagItem(int index, GObject item)
+        {
+            Dictionary<int, Dictionary<string, int>> tagsArr = (Dictionary<int, Dictionary<string, int>>)item.parent.data;
+            UI_ComTagItem listItem = UI_ComTagItem.Proxy(item);
+            string name = "";
+            string score = "";
+            foreach (var info in tagsArr[index].Keys) { 
+                name = info;
+                score = tagsArr[index][info].ToString();
+            }
+            int tagType = TagCfgArray.Instance.GetCfg(name).type;
+            UI.CommonGame.UI_ComTag itemTag = UI.CommonGame.UI_ComTag.Proxy(listItem.m_loaTag);
+            itemTag.m_txtTag.text = name;
+            itemTag.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
+            itemTag.m_loaTag.scale = new Vector2(0.8f, 0.8f);
+            UI.CommonGame.UI_ComTag.ProxyEnd();
+            listItem.m_txtScore.text = score;
             UI_ComTagItem.ProxyEnd();
         }
 
@@ -1066,7 +1087,22 @@ namespace GFGGame
                 iconRes = suitCfg.res;
                 partName = suitCfg.name;
                 listItem.m_iconSelected.visible = false;
-                listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
+                if (!IsTeaPart)
+                {
+                    listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
+                    listItem.m_itemType.selectedIndex = 0;
+                }
+                else
+                {
+                    if (listItem.m_ListTag.data == null)
+                        listItem.m_ListTag.itemRenderer = ListSuitTagItem;
+
+                    var tagCfg = DressUpMenuSuitDataManager.GetSuitTagCfgArray(id);
+                    listItem.m_ListTag.data = tagCfg;
+                    listItem.m_ListTag.numItems = tagCfg.Count;
+                    listItem.m_itemType.selectedIndex = 1;
+                }
+
                 RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
                 listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
                 listItem.m_imgNew.visible = false;
@@ -1077,15 +1113,17 @@ namespace GFGGame
                 iconRes = itemCfg.res;
                 partName = itemCfg.name;
                 listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
-                if (!IsTeaPart)
+                if (!IsTeaPart) {
                     listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
+                    listItem.m_itemType.selectedIndex = 0;
+                }
                 else {
                     if (listItem.m_ListTag.data == null)
-                    {
                         listItem.m_ListTag.itemRenderer = ListTagItem;
-                    }
+
                     listItem.m_ListTag.data = itemCfg;
                     listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
+                    listItem.m_itemType.selectedIndex = 1;
                 }
 
                 listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
@@ -1106,11 +1144,6 @@ namespace GFGGame
                 _listLongPress.Add(longPressGesture);
             }
 
-            if (!IsTeaPart)
-                listItem.m_itemType.selectedIndex = 0;
-            else
-                listItem.m_itemType.selectedIndex = 1;
-
             listItem.m_btnAni.visible = false;
             listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
             listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
@@ -1139,6 +1172,18 @@ namespace GFGGame
             iconRes = itemCfg.res;
             partName = itemCfg.name;
             listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
+
+            if (!IsTeaPart)
+                listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
+            else
+            {
+                if (listItem.m_ListTag.data == null)
+                    listItem.m_ListTag.itemRenderer = ListTagItem;
+
+                listItem.m_ListTag.data = itemCfg;
+                listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
+            }
+
             listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
             RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
             ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
@@ -1148,8 +1193,10 @@ namespace GFGGame
             // int mainValuel;
             // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
             listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + scoreType);
-            if (!IsTeaPart)
+            if (!IsTeaPart) {
                 listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
+                listItem.m_itemType.selectedIndex = 0;
+            }
             else
             {
                 if (listItem.m_ListTag.data == null)
@@ -1158,8 +1205,9 @@ namespace GFGGame
                 }
                 listItem.m_ListTag.data = itemCfg;
                 listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
+                listItem.m_itemType.selectedIndex = 1;
             }
-           
+
             listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
             listItem.m_txtTitle.text = partName;
             listItem.target.data = id;
@@ -1260,7 +1308,15 @@ namespace GFGGame
         {
             _ui.m_btnClose.visible = true;
             _ui.m_grpTips.visible = true;
-            _ui.m_txtHint.text = _levelCfg.hint;
+            string str = "";
+            if (!IsTeaPart)
+                str = _levelCfg.hint;
+            else { 
+                var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
+                str = teapartyRoleCfg[_TeaPartyID - 1].hint;
+            }
+            _ui.m_txtHint.text = str;
+
             if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
             {
                 this._ui.m_txtHint.align = AlignType.Left;

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

@@ -87,7 +87,7 @@ namespace GFGGame
         private void OnBtnTeaPartyClick()
         {
             Hide();
-            if (LeagueDataManager.Instance.TeaPartyStatus == 2 && !LeagueDataManager.Instance.RoleTeapartyInfo.IsComplete && LeagueDataManager.Instance.RoleTeapartyInfo.Status)
+            if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo && !LeagueDataManager.Instance.RoleTeapartyInfo.IsComplete && LeagueDataManager.Instance.RoleTeapartyInfo.Status)
                 ViewManager.Show<LeagueTeaPartyShowView>();
             else
                 ViewManager.Show<LeagueTeaPartyView>();

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

@@ -197,12 +197,12 @@ namespace GFGGame
             // 0未开启 1集结中 2已集结
             _ui.m_btnParty.m_showText.selectedIndex = 0;
             string text = "";
-            if (LeagueDataManager.Instance.TeaPartyStatus == 0)
+            if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.NotOpen)
             {
                 text = "未开启";
                 _ui.m_btnParty.m_showText.selectedIndex = 1;
             }
-            else if (LeagueDataManager.Instance.TeaPartyStatus == 1)
+            else if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesOpen)
             {
                 text = "集结中";
                 _ui.m_btnParty.m_showText.selectedIndex = 1;