From 4c6112ff6aa931c75d2b51591af598d4e9f008eb Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 08 九月 2025 18:00:07 +0800
Subject: [PATCH] 7 【武将】武将系统-测试bug记录

---
 Main/System/HeroUI/HeroLVBreakWin.cs              |    4 
 Main/Utility/UIHelper.cs                          |   17 ++-
 Main/System/HeroUI/HeroGiftEatWin.cs              |   56 +++++++++--
 Main/System/HeroUI/HeroCollectionWin.cs.meta      |   11 ++
 Main/System/HeroUI/HeroCollectionCardCell.cs      |   87 +++++++++++++++++
 Main/System/HeroUI/HeroCollectionCardCell.cs.meta |   11 ++
 Main/System/HeroUI/HeroCollectionLineCell.cs      |   23 ++++
 Main/System/HeroUI/HeroGiftRoleListCell.cs        |    2 
 Main/System/HeroUI/GiftBaseCell.cs                |    2 
 Main/System/HeroUI/HeroCollectionLineCell.cs.meta |   11 ++
 Main/System/HeroUI/HeroCollectionWin.cs           |   27 +++++
 Main/System/HeroUI/HeroTrainWin.cs                |   34 ++++--
 12 files changed, 252 insertions(+), 33 deletions(-)

diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs
index 3180fdd..c7fcd0a 100644
--- a/Main/System/HeroUI/GiftBaseCell.cs
+++ b/Main/System/HeroUI/GiftBaseCell.cs
@@ -139,7 +139,7 @@
         {
             var giftConfig = HeroTalentConfig.Get(giftID);
             SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
-            Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
+            Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV)));
             UIManager.Instance.OpenWindow<SmallTipWin>();
 
         }
diff --git a/Main/System/HeroUI/HeroCollectionCardCell.cs b/Main/System/HeroUI/HeroCollectionCardCell.cs
new file mode 100644
index 0000000..3c05118
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionCardCell.cs
@@ -0,0 +1,87 @@
+using UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+
+public class HeroCollectionCardCell : MonoBehaviour
+{
+    [SerializeField] Button heroCardBtn;
+    [SerializeField] Image heroCardBG;
+    [SerializeField] Material glowMaterial; // 娴佸厜鏁堟灉鏉愯川
+    [SerializeField] Text lvText;
+    [SerializeField] Image countryImg;
+    [SerializeField] Image jobImg;
+    [SerializeField] UIHeroController heroModel;
+    [SerializeField] Image onStateImg;
+    [SerializeField] RedpointBehaviour redpoint;
+    [SerializeField] Image trainStateImg;
+    [SerializeField] Text nameText;
+    [SerializeField] Image awakeImg;
+    [SerializeField] Text awakeLVText;
+    [SerializeField] List<Image> starImgList;
+
+    string guid;
+    public void Display(int index)
+    {
+        guid = HeroUIManager.Instance.heroSortList[index];
+        var hero = HeroManager.Instance.GetHero(guid);
+        if (hero == null)
+        {
+            this.gameObject.SetActive(false);
+            return;
+        }
+
+        this.gameObject.SetActive(true);
+        heroCardBG.SetSprite("herocardbg" + hero.Quality);
+        if (glowMaterial != null)
+        {
+            heroCardBG.material = glowMaterial;
+        }
+        lvText.text = Language.Get("L1094") + hero.heroLevel.ToString();
+        var heroConfig = hero.heroConfig;
+        countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
+        jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
+        heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
+        onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
+
+        redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
+        var funcState = hero.funcState;
+        if (funcState > 0)
+        {
+            trainStateImg.SetActive(true);
+            trainStateImg.SetSprite("herofuncstate" + hero.funcState);
+        }
+        else
+        {
+            trainStateImg.SetActive(false);
+        }
+        nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel);
+        awakeImg.SetActive(hero.awakeLevel > 0);
+        awakeLVText.text = hero.awakeLevel.ToString();
+
+        for (int i = 0; i < starImgList.Count; i++)
+        {
+            if (hero.heroStar == 0 && i == 0)
+            {
+                // 鏃犳槦绾� 鐗规畩澶勭悊
+                starImgList[i].SetActive(true);
+                starImgList[i].SetSprite("herostar" + hero.heroStar);
+            }
+            else if ((hero.heroStar - 1) % starImgList.Count >= i)
+            {
+                starImgList[i].SetActive(true);
+                starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count);
+            }
+            else
+            {
+                starImgList[i].SetActive(false);
+            }
+        }
+
+        heroCardBtn.AddListener(() =>
+        {
+            HeroUIManager.Instance.selectHeroGuid = guid;
+            UIManager.Instance.OpenWindow<HeroTrainWin>();
+        });
+    }
+}
+
diff --git a/Main/System/HeroUI/HeroCollectionCardCell.cs.meta b/Main/System/HeroUI/HeroCollectionCardCell.cs.meta
new file mode 100644
index 0000000..e40d10c
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionCardCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 13346ce9b4f57a64a9219a266123d91f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/HeroUI/HeroCollectionLineCell.cs b/Main/System/HeroUI/HeroCollectionLineCell.cs
new file mode 100644
index 0000000..6f727c2
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionLineCell.cs
@@ -0,0 +1,23 @@
+锘縰sing UnityEngine;
+
+public class HeroCollectionLineCell : CellView
+{
+    [SerializeField] HeroCardCell[] cardList;
+
+    public void Display(int index)
+    { 
+        for (int i = 0; i < cardList.Length; i++)
+        {
+            if (i + index < HeroUIManager.Instance.heroSortList.Count)
+            {
+                cardList[i].SetActive(true);
+                cardList[i].Display(index + i);
+            }
+            else
+            {
+                cardList[i].SetActive(false);
+            }
+        }
+    }
+}
+
diff --git a/Main/System/HeroUI/HeroCollectionLineCell.cs.meta b/Main/System/HeroUI/HeroCollectionLineCell.cs.meta
new file mode 100644
index 0000000..7f944d7
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionLineCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1e06f8c655ff0c44cbc7cfe7ea09b808
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/HeroUI/HeroCollectionWin.cs b/Main/System/HeroUI/HeroCollectionWin.cs
new file mode 100644
index 0000000..6624ec1
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionWin.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鍥鹃壌鐣岄潰
+/// </summary>
+public class HeroCollectionWin : UIBase
+{
+
+
+    protected override void InitComponent()
+    {
+
+    }
+
+    protected override void OnPreOpen()
+    {
+
+    }
+
+    protected override void OnPreClose()
+    {
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroCollectionWin.cs.meta b/Main/System/HeroUI/HeroCollectionWin.cs.meta
new file mode 100644
index 0000000..f4af327
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2cde85a874c704d438bc433ea5bbbabd
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/HeroUI/HeroGiftEatWin.cs b/Main/System/HeroUI/HeroGiftEatWin.cs
index 240b519..df50c3a 100644
--- a/Main/System/HeroUI/HeroGiftEatWin.cs
+++ b/Main/System/HeroUI/HeroGiftEatWin.cs
@@ -26,15 +26,9 @@
 
     protected override void InitComponent()
     {
-        addHeroBtn.AddListener(() =>
-        {
-            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
-        });
+        addHeroBtn.AddListener(OpenSelectWin);
 
-        addHeroGo.AddListener(() =>
-        {
-            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
-        });
+        addHeroGo.AddListener(OpenSelectWin);
 
         eatBtn.AddListener(EatHero);
     }
@@ -94,14 +88,14 @@
 
         var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
         //娲楃偧鍜岃閱掔殑澶╄祴鏈鐞嗕笉鍙悶鍣�
-        if (hero.talentRandomIDList.Count > 0 )
-        { 
+        if (hero.talentRandomIDList.Count > 0)
+        {
             SysNotifyMgr.Instance.ShowTip("HeroGift4");
             return;
         }
 
         if (hero.talentAwakeRandomIDList.Count > 0)
-        { 
+        {
             SysNotifyMgr.Instance.ShowTip("HeroGift5");
             return;
         }
@@ -109,6 +103,22 @@
         var eatHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid);
         if (hero == null || eatHero == null)
             return;
+
+
+        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
+        {
+            CloseWindow();
+            SysNotifyMgr.Instance.ShowTip("HeroGift7");
+            return;
+        }
+
+        if (hero.IsFullStar())
+        {
+            CloseWindow();
+            SysNotifyMgr.Instance.ShowTip("HeroGift1");
+            return;
+        }
+
 
         var pack = new CB231_tagCSHeroStarUP();
         pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
@@ -129,4 +139,28 @@
         };
     }
 
+    void OpenSelectWin()
+    {
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
+        if (hero == null)
+        {
+            CloseWindow();
+            return;
+        }
+
+        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
+        {
+            CloseWindow();
+            SysNotifyMgr.Instance.ShowTip("HeroGift7");
+            return;
+        }
+
+        if (hero.IsFullStar())
+        {
+            CloseWindow();
+            SysNotifyMgr.Instance.ShowTip("HeroGift1");
+            return;
+        }
+        UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
+    }
 }
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroGiftRoleListCell.cs b/Main/System/HeroUI/HeroGiftRoleListCell.cs
index 1f6d0ea..c016d95 100644
--- a/Main/System/HeroUI/HeroGiftRoleListCell.cs
+++ b/Main/System/HeroUI/HeroGiftRoleListCell.cs
@@ -24,7 +24,7 @@
     {
         var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroEatList[index]);
         //涓婇樀 閿佸畾 瑙夐啋 鐨勬儏鍐�
-        if (hero.awakeLevel > 0 || hero.breakLevel > 0)
+        if (hero.awakeLevel > 0)
         {
             SysNotifyMgr.Instance.ShowTip("HeroReborn1");
             return;
diff --git a/Main/System/HeroUI/HeroLVBreakWin.cs b/Main/System/HeroUI/HeroLVBreakWin.cs
index 833d6d7..a385d36 100644
--- a/Main/System/HeroUI/HeroLVBreakWin.cs
+++ b/Main/System/HeroUI/HeroLVBreakWin.cs
@@ -64,8 +64,8 @@
             hero.qualityConfig.BreakLVAddPer * (hero.breakLevel + 1));
         }
 
-        moneyIcon.SetOrgSprite(ItemConfig.Get(nextBreakLVConfig.UPCostItem[0]).IconKey);
-        moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], nextBreakLVConfig.UPCostItem[1]);
+        moneyIcon.SetOrgSprite(ItemConfig.Get(hero.qualityBreakConfig.UPCostItem[0]).IconKey);
+        moneyText.text = UIHelper.ShowUseItem(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], hero.qualityBreakConfig.UPCostItem[1]);
 
         var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1);
         if (nextQualityBreakConfig == null)
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 103df78..e905dd1 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -164,6 +164,7 @@
         PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
         HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
         UIManager.Instance.OnCloseWindow += OnCloseWindow;
+        HeroUIManager.Instance.OnTeamPosChangeEvent += TeamPosChangeEvent;
         guid = HeroUIManager.Instance.selectHeroGuid;
         hero = HeroManager.Instance.GetHero(guid);
         unfoldState = false;
@@ -177,6 +178,7 @@
         PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
         HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
         UIManager.Instance.OnCloseWindow -= OnCloseWindow;
+        HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamPosChangeEvent;
     }
 
     private void OnCloseWindow(UIBase closeUI)
@@ -520,7 +522,6 @@
 
         list.Sort();
 
-        string allAttrStr = string.Empty;
         for (int i = 0; i < list.Count; i++)
         {
             var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, i + 1);
@@ -540,7 +541,7 @@
                 var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID);
                 if (skill != null)
                 {
-                    attrStrArr.Add(skill.Description);
+                    attrStrArr.Add(Language.Get("equipQualityFormat", skill.SkillName) + skill.Description);
                 }
                 else
                 {
@@ -564,7 +565,7 @@
             {
                 //缃伆
                 nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1));
-                descText.text = UIHelper.AppendColor(TextColType.NavyGray, string.Join(Language.Get("L1112"), attrStrArr));
+                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join(Language.Get("L1112"), attrStrArr)));
             }
         }
 
@@ -574,7 +575,7 @@
     void RefreshFetter()
     {
         if (hero.heroConfig.FetterIDList.Length == 0)
-        { 
+        {
             fetterGo.SetActive(false);
             return;
         }
@@ -626,11 +627,6 @@
             starUPBtnText.text = Language.Get("HeroGift7");
             starUPBtn.SetInteractable(false);
         }
-        else if (hero.IsFullStar())
-        {
-            starUPBtnText.text = Language.Get("HeroGift3");
-            starUPBtn.SetInteractable(true);
-        }
         else
         {
             starUPBtnText.text = Language.Get("HeroGift3");
@@ -659,6 +655,12 @@
 
     void Wash()
     {
+        if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
+        {
+            SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel);
+            return;
+        }
+
         HeroUIManager.Instance.selectWashHeroGUID = hero.itemHero.guid;
         UIManager.Instance.OpenWindow<HeroGiftWashWin>();
 
@@ -698,14 +700,15 @@
             }
             else if (type == 2)
             {
-                awakeStr = SkillConfig.Get(config.SkillID).Description;
+                var skill = SkillConfig.Get(config.SkillID);
+                awakeStr = Language.Get("equipQualityFormat", skill.SkillName) + skill.Description;
             }
             else
             {
                 for (int k = 0; k < config.AttrIDList.Length; k++)
                 {
-                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k]) +
-                        (k == config.AttrIDList.Length - 1 ? "" : "\n");
+                    awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k],  "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"))
+                    + (k == config.AttrIDList.Length - 1 ? "" : "\n");
                 }
             }
 
@@ -718,8 +721,13 @@
             {
                 //缃伆
                 nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard12", i) + Language.Get("L1096"));
-                descText.text = UIHelper.AppendColor(TextColType.NavyGray, awakeStr);
+                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(awakeStr));
             }
         }
     }
+
+    void TeamPosChangeEvent(List<int> posList, int flyFrom, Vector3 startPos)
+    { 
+        fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculatePower());
+    }
 }
\ No newline at end of file
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index dfdf1ac..db04251 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -75,7 +75,7 @@
             _image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey);
         }
         else
-        { 
+        {
             Debug.LogError("MoneyDisplayModel 涓洪厤缃揣甯佺被鍨嬶細" + moneyType);
         }
     }
@@ -753,7 +753,7 @@
                 return StringUtility.Contact("<color=#dfbbed>", msg, "</color>");
             case TextColType.itembuxiu:
                 // 5eeff2 涓嶆溄
-                return  StringUtility.Contact("<color=#5eeff2>", msg, "</color>");
+                return StringUtility.Contact("<color=#5eeff2>", msg, "</color>");
             case TextColType.itemyonghen:
                 // f5b4ea 姘告亽
                 return StringUtility.Contact("<color=#f5b4ea>", msg, "</color>");
@@ -762,7 +762,7 @@
     }
 
     public static string AppendColor(Color color, string msg)
-    { 
+    {
         return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>");
     }
 
@@ -927,7 +927,7 @@
     }
     #endregion
 
-    
+
 
     #region 寰楀埌閲戦挶鏁伴噺鏍规嵁閲戦挶绫诲瀷
 
@@ -1141,7 +1141,7 @@
     #endregion
 
     #region 寰楀埌瑁呭浣嶆垨鑰呯绂忔爲鍝佽川鍚嶇О 甯﹂鑹�
-    public static string GetQualityNameWithColor(int quality, string format="{0}")
+    public static string GetQualityNameWithColor(int quality, string format = "{0}")
     {
         return AppendColor(quality, string.Format(format, Language.Get("equipQuality" + quality)), true, 1);
     }
@@ -1325,4 +1325,11 @@
         return money / scale;
     }
 
+
+    public static string RemoveColor(string content)
+    { 
+        content = WordAnalysis.Color_Start_Regex.Replace(content, string.Empty);
+        content = WordAnalysis.Color_End_Regex.Replace(content, string.Empty);
+        return content;
+    }
 }

--
Gitblit v1.8.0