From 7475947c2ab18c21973e2d796094f96e27b2929d Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 25 八月 2025 00:32:44 +0800
Subject: [PATCH] 0312 武将羁绊

---
 Main/System/HeroUI/HeroTrainWin.cs |   69 ++++++++++++++++++++++++++++++++--
 1 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 215c2c7..08b9b17 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -7,7 +7,7 @@
 /// <summary>
 /// 姝﹀皢鍩瑰吇鐣岄潰
 /// </summary>
-public partial class HeroTrainWin : UIBase
+public class HeroTrainWin : UIBase
 {
     [SerializeField] Button showFuncBtn;    //鍙樉绀虹珛缁樻椂鐐瑰嚮锛屾樉绀哄姛鑳�
     [SerializeField] Transform funcForm;
@@ -39,6 +39,7 @@
     [SerializeField] Image countryImg;
     [SerializeField] Text awakeLVText;
 
+    //灞炴�у尯
     [SerializeField] Button attrBtn;
     [SerializeField] Image unfoldImg; //灞曞紑鏃舵寜閽殑鍥炬爣
     [SerializeField] Image foldImg; //鏀惰捣鏃舵寜閽殑鍥炬爣
@@ -59,6 +60,10 @@
     [SerializeField] LongPressButton lvupBtn;
     [SerializeField] Button allAttrBtn;
     [SerializeField] Text allPotentialText; //娼滆兘
+    [SerializeField] Text[] fetterText;   //缇佺粖
+    [SerializeField] Text[] fetterNameText;   //缇佺粖
+
+
     string guid;
     HeroInfo hero;
 
@@ -84,7 +89,7 @@
             ChangeHero(-1);
         });
 
-        lockBtn.AddListener(()=> { hero.ChangeLockState(); });
+        lockBtn.AddListener(() => { hero.ChangeLockState(); });
         resetBtn.AddListener(ResetBtnClick);
         deleteBtn.AddListener(DeleteHero);
         awakeBtn.AddListener(() =>
@@ -178,6 +183,7 @@
         RefreshFoldState();
         RefreshAttr();
         RefreshAllPotential();
+        RefreshFetter();
     }
 
     void RefreshItemLockEvent(PackType type, string guid, bool lockState)
@@ -259,7 +265,7 @@
         {
 
             if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount)
-            { 
+            {
                 SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax");
                 return;
             }
@@ -293,7 +299,7 @@
         GameNetSystem.Instance.SendInfo(pack);
 
         HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
-            
+
     }
 
     void DeleteHero()
@@ -484,13 +490,26 @@
             List<string> attrStrArr = new List<string>();
             for (int j = 0; j < nextQualityBreakConfig.AttrIDList.Length; j++)
             {
+                if (nextQualityBreakConfig.AttrIDList[j] == 0)
+                    continue;
                 string format = i < hero.breakLevel ? "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}") : "{0}+{1}";
                 attrStrArr.Add(PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[j], nextQualityBreakConfig.AttrValueList[j], format));
             }
+
             if (nextQualityBreakConfig.SkillID != 0)
             {
-                attrStrArr.Add(SkillConfig.Get(nextQualityBreakConfig.SkillID)?.Description);
+                var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID);
+                if (skill != null)
+                {
+                    attrStrArr.Add(skill.Description);
+                }
+                else
+                {
+                    Debug.LogError("鏈厤缃妧鑳�" + nextQualityBreakConfig.SkillID);
+                }
             }
+
+
             if (i < hero.breakLevel)
             {
                 allAttrStr += Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr)) + "\n";
@@ -506,5 +525,45 @@
 
     }
 
+    //缇佺粖
+    void RefreshFetter()
+	{
+        for (int i = 0; i < fetterText.Length; i++)
+        {
+            if (i < hero.heroConfig.FetterIDList.Length)
+            {
+                fetterText[i].SetActive(true);
+                var fetterID = hero.heroConfig.FetterIDList[i];
+                HeroFetterConfig fetterConfig = HeroFetterConfig.Get(fetterID);
+                List<string> heroNames = new List<string>();
+                bool isAllCollect = true; //鏄惁鍏ㄦ敹闆�
+                foreach (var tmpHeroID in fetterConfig.HeroIDList)
+                {
+                    heroNames.Add(HeroConfig.Get(tmpHeroID).Name);
+                    if (HeroManager.Instance.GetHeroCountByID(tmpHeroID) == 0)
+                    {
+                        isAllCollect = false;
+                    }
+                }
+                var attrStr = string.Join(Language.Get("SplitString1"), heroNames) + Language.Get("herocard38");
 
+                for (int j = 0; j < fetterConfig.AttrIDList.Length; j++)
+                {
+                    string format = !isAllCollect ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}");
+                    attrStr += Language.Get("L1112") + PlayerPropertyConfig.GetFullDescription(fetterConfig.AttrIDList[j], fetterConfig.AttrValueList[j], format);
+                }
+                fetterText[i].text = attrStr;
+                fetterText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray);
+                fetterNameText[i].text = fetterConfig.FetterName;
+                fetterNameText[i].color = UIHelper.GetUIColor(isAllCollect ? TextColType.NavyBrown : TextColType.Gray);
+
+            }
+            else
+            {
+                fetterText[i].SetActive(false);
+            }
+        }
+
+
+	}
 }
\ No newline at end of file

--
Gitblit v1.8.0