瀏覽代碼

茶话会计算匹配度,和界面修改

huangxiaoyue 1 年之前
父節點
當前提交
0cc01b242f
共有 24 個文件被更改,包括 80 次插入23 次删除
  1. 1 3
      GameClient/Assets/Game/HotUpdate/Data/InstanceZonesDataManager.cs
  2. 34 0
      GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs
  3. 0 3
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_comTeaPartyOverItem.cs
  4. 29 10
      GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs
  5. 4 1
      GameClient/Assets/Game/HotUpdate/Views/Field/FieldView.cs
  6. 8 5
      GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyView.cs
  7. 4 1
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs
  8. 二進制
      GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes
  9. 二進制
      GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes
  10. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0!a.png
  11. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0.png
  12. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_1!a.png
  13. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_1.png
  14. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_3!a.png
  15. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_3.png
  16. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_4!a.png
  17. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_4.png
  18. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_5!a.png
  19. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_5.png
  20. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_6!a.png
  21. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_6.png
  22. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_7!a.png
  23. 二進制
      GameClient/Assets/ResIn/UI/League/League_atlas0_7.png
  24. 二進制
      GameClient/Assets/ResIn/UI/League/League_fui.bytes

+ 1 - 3
GameClient/Assets/Game/HotUpdate/Data/InstanceZonesDataManager.cs

@@ -82,7 +82,6 @@ namespace GFGGame
         //获取玩家战斗数据
         private static FightData GetMyFightRoleData()
         {
-
             _roleData.name = RoleDataManager.roleName;
             _roleData.scoreType = InstanceZonesDataManager.currentScoreType;
             _roleData.baseScore = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).baseScore;
@@ -92,9 +91,8 @@ namespace GFGGame
             CardData cardData = CardDataManager.GetCardDataById(_roleData.cardId);
             _roleData.cardScore = _roleData.cardId <= 0 || cardData == null ? 0 : cardData.scores[_roleData.scoreType];//词牌对应主题的属性分数
 
-
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
-            if (!string.IsNullOrEmpty(levelCfg.fightID))
+            if (levelCfg != null && !string.IsNullOrEmpty(levelCfg.fightID))
             {
                 StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
                 _roleData.tags = fightCfg.needTagsArr;////本次战斗要求的标签

+ 34 - 0
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -34,6 +34,7 @@ namespace GFGGame
         public int TeaPartyStatus = 0; // 0未开启 1集结中 2已集结
         public RoleTeapartyInfoProto RoleTeapartyInfoProto = new RoleTeapartyInfoProto(); // 玩家本期茶话会参与信息
         public List<RoleContainerProto> RoleContainerList = new List<RoleContainerProto>(); // 茶会每个扮演角色坑位信息
+        public int ChooseTeaPartId = 0; // 选择的茶话会类型
 
 
         public void Clear()
@@ -259,5 +260,38 @@ namespace GFGGame
             }
             return giftBuyDatas;
         }
+
+
+        //茶话会匹配度计算
+        public int GetTeaPartyMatchedValue(FightData roleData)
+        {
+            int matchedValue = 0;
+
+            var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
+            string[] tags = teapartyRoleCfg[ChooseTeaPartId - 1].tagArr;
+
+            for (int i = 0; i < roleData.itemList.Count; i++)
+            {
+                int itemId = roleData.itemList[i];
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+                if (itemCfg == null)
+                {
+                    ET.Log.Error("物品:" + itemId + "不存在");
+                    return matchedValue;
+                }
+                for (int t = 0; t < itemCfg.tagsArr.Length; t++)
+                {
+                    for (int j = 0; j < tags.Length; j++)
+                    {
+                        if (itemCfg.tagsArr[t][0] == tags[j])
+                        {
+                            matchedValue += 1;
+                        }
+                    }
+                }
+            }
+
+            return matchedValue;
+        }
     }
 }

+ 0 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_comTeaPartyOverItem.cs

@@ -8,7 +8,6 @@ namespace UI.League
     {
         public GComponent target;
         public GLoader m_iconRole;
-        public GTextField m_txtRoleName;
         public const string URL = "ui://tw70qm9dic4otq5";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "comTeaPartyOverItem";
@@ -57,12 +56,10 @@ namespace UI.League
         private void Init(GComponent comp)
         {
             m_iconRole = (GLoader)comp.GetChild("iconRole");
-            m_txtRoleName = (GTextField)comp.GetChild("txtRoleName");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_iconRole = null;
-            m_txtRoleName = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 29 - 10
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -8,6 +8,12 @@ using System.Collections;
 
 namespace GFGGame
 {
+    public class DressUpFightType
+    {
+        public int levelID;
+        public int teaPartID;
+    }
+
     public class DressUpFightView : BaseView
     {
         private UI_DressUpFightUI _ui;
@@ -27,6 +33,7 @@ namespace GFGGame
         private StoryLevelCfg _levelCfg;
         private StoryFightCfg _fightCfg;
         private int scoreType = 0;  //目标分数类型保存
+        private bool IsTeaPart = false;
 
         private const int SORT_BY_HIGH_SCORE = 0;
         private const int SORT_BY_LOW_SCORE = 1;
@@ -142,8 +149,12 @@ namespace GFGGame
         {
             base.OnShown();
 
-            _levelID = (int)viewData;
-            if(_levelID > 0)
+            var objData = (DressUpFightType)this.viewData;
+            if (objData.teaPartID > 0)
+                IsTeaPart = true;
+
+            _levelID = objData.levelID;
+            if (!IsTeaPart)
                 _ui.m_c1.selectedIndex = 0;
             else
                 _ui.m_c1.selectedIndex = 2;
@@ -159,7 +170,7 @@ namespace GFGGame
             _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
             _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
 
-            if (_levelID > 0) { 
+            if (!IsTeaPart) { 
                 InstanceZonesDataManager.currentLevelCfgId = _levelID;
                 _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
                 _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
@@ -225,8 +236,13 @@ namespace GFGGame
             UpdateStepBtn(true);
             UpdateScore();
 
-            if (_levelID > 0)
+            if (!IsTeaPart)
                 SendLog();
+            else
+            {
+                var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
+                _ui.m_txtTeaPartyName.text = teapartyRoleCfg[objData.teaPartID - 1].name;
+            }
 
             Timers.inst.AddUpdate(CheckGuide);
         }
@@ -954,7 +970,7 @@ namespace GFGGame
             typeItem.m_txtname.text = item1.name;
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
             typeItem.target.data = item1.id;
-            if (_levelID > 0)
+            if (!IsTeaPart)
             {
                 typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
                 typeItem.m_itemType.selectedIndex = 0;
@@ -975,7 +991,7 @@ namespace GFGGame
             typeItem.m_txtname.text = item2.name;
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
             typeItem.target.data = item2.id;
-            if (_levelID > 0) { 
+            if (!IsTeaPart) { 
                 typeItem.m_itemType.selectedIndex = 0;
                 var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
                 typeItem.m_imgNeed.visible = subType == item2.type;
@@ -995,7 +1011,8 @@ namespace GFGGame
             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.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];
             UI_ComTagItem.ProxyEnd();
@@ -1025,7 +1042,7 @@ namespace GFGGame
                 iconRes = itemCfg.res;
                 partName = itemCfg.name;
                 listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
-                if (_levelID > 0)
+                if (!IsTeaPart)
                     listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
                 else {
                     if (listItem.m_ListTag.data == null)
@@ -1054,7 +1071,7 @@ namespace GFGGame
                 _listLongPress.Add(longPressGesture);
             }
 
-            if (_levelID > 0)
+            if (!IsTeaPart)
                 listItem.m_itemType.selectedIndex = 0;
             else
                 listItem.m_itemType.selectedIndex = 1;
@@ -1211,9 +1228,11 @@ namespace GFGGame
 
         private void UpdateScore()
         {
-            if (_levelID > 0)
+            if (!IsTeaPart)
                 _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
             // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
+            else
+                _ui.m_txtMatch.text = "" + LeagueDataManager.Instance.GetTeaPartyMatchedValue(InstanceZonesDataManager.roleData);
         }
 
         private void OnClickBtnSearch()

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

@@ -187,7 +187,10 @@ namespace GFGGame
         {
             LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.TIAN_YE_DIAO_CHA, 2);
             int curLevelId = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_curCfg.type, 0, _curCfg.id)[0].id;
-            ViewManager.Show<DressUpFightView>(curLevelId, new object[] { typeof(FieldView).FullName, this.viewData }, true);
+            DressUpFightType dressUpFightType = new DressUpFightType();
+            dressUpFightType.levelID = curLevelId;
+            dressUpFightType.teaPartID = 0;
+            ViewManager.Show<DressUpFightView>(dressUpFightType, new object[] { typeof(FieldView).FullName, this.viewData }, true);
             InstanceZonesDataManager.currentLevelCfgId = curLevelId;
         }
         private void OnBtnTaskClick()

+ 8 - 5
GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyView.cs

@@ -49,6 +49,7 @@ namespace GFGGame
             UI_comTeaPartyItem itemObj = UI_comTeaPartyItem.Proxy(obj);
 
             itemObj.m_btnDetail.onClick.Add(OnBtnDetailClick);
+            itemObj.m_iconRole.data = index;
             itemObj.m_iconRole.onClick.Add(OnBtnIconRoleClick);
             itemObj.m_txtRoleName.text = teapartyRoleCfg[index].name;
 
@@ -126,12 +127,14 @@ namespace GFGGame
             _ui.m_teaPartyItemTips.target.visible = false;
         }
 
-        private void OnBtnIconRoleClick()
+        private void OnBtnIconRoleClick(EventContext context)
         {
-            FieldCfg _curCfg;
-            _curCfg = FieldCfgArray.Instance.dataArray[FieldDataManager.Instance.difficulty];
-            int curLevelId = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_curCfg.type, 0, _curCfg.id)[0].id;
-            ViewManager.Show<DressUpFightView>(0, new object[] { typeof(LeagueTeaPartyView).FullName, null }, true);
+            GObject obj = context.sender as GObject;
+            LeagueDataManager.Instance.ChooseTeaPartId = (int)obj.data + 1;
+            DressUpFightType dressUpFightType = new DressUpFightType();
+            dressUpFightType.levelID = 0;
+            dressUpFightType.teaPartID = LeagueDataManager.Instance.ChooseTeaPartId;
+            ViewManager.Show<DressUpFightView>(dressUpFightType, new object[] { typeof(LeagueTeaPartyView).FullName, null }, true);
         }
     }
 }

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

@@ -90,7 +90,10 @@ namespace GFGGame
             InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
             if (times > 0)
             {
-                ViewManager.Show<DressUpFightView>(_levelID, null, true);
+                DressUpFightType dressUpFightType = new DressUpFightType();
+                dressUpFightType.levelID = _levelID;
+                dressUpFightType.teaPartID = 1;
+                ViewManager.Show<DressUpFightView>(dressUpFightType, null, true);
             }
             else
             {

二進制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


二進制
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_1!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_1.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_3!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_3.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_4!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_4.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_5!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_5.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_6!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_6.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_7!a.png


二進制
GameClient/Assets/ResIn/UI/League/League_atlas0_7.png


二進制
GameClient/Assets/ResIn/UI/League/League_fui.bytes