From 9216ab7322fa164abaa6f9089058746b34bd690a Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 06 九月 2025 21:21:32 +0800
Subject: [PATCH] 117 【武将】武将系统 - 洗炼

---
 Main/System/KnapSack/Logic/ItemModel.cs     |    2 
 Main/System/HeroUI/HeroGiftWashWin.cs.meta  |    2 
 Main/System/Tip/ConfirmCancel.cs            |   15 +
 Main/System/HeroUI/HeroUIManager.Talent.cs  |   37 +++
 Main/System/HeroUI/HeroGiftEatWin.cs        |   15 +
 Main/System/HeroUI/HeroGiftRoleListCell.cs  |    2 
 Main/System/HeroUI/HeroGiftWashCell.cs      |   78 ++++++++
 Main/System/ItemTip/ItemTipUtility.cs       |    1 
 /dev/null                                   |    7 
 Main/System/Hero/HeroInfo.Talent.cs         |   78 ++++++--
 Main/System/HeroUI/HeroGiftWashCell.cs.meta |    2 
 Main/System/HeroUI/HeroGiftWashWin.cs       |  235 ++++++++++++++++++++++++++
 Main/Main.cs                                |   14 +
 Main/System/HeroUI/HeroTrainWin.cs          |   27 --
 Main/System/HeroUI/HeroUIManager.cs         |    1 
 15 files changed, 452 insertions(+), 64 deletions(-)

diff --git a/Main/Component/UI/Effect/UISpineEffect.cs b/Main/Component/UI/Effect/UISpineEffect.cs
deleted file mode 100644
index e7340d4..0000000
--- a/Main/Component/UI/Effect/UISpineEffect.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-
-using UnityEngine;
-
-public class UISpineEffect : MonoBehaviour
-{
-    public Material material;
-}
diff --git a/Main/Main.cs b/Main/Main.cs
index 78c3ffe..9fa15eb 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -38,8 +38,8 @@
 #endif
         StageManager.Instance.ToLoginScene();
 
-        DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
-        DTC0102_tagCDBPlayer.isAfterPlayerDataInitialize = false;
+        ClearGameData();
+
     }
 
     public static async UniTask InitManagers()
@@ -117,14 +117,20 @@
 
         managers.Clear();
     }
-    
+
     /// <summary>
     /// 鎵撳紑鐧诲綍鐣岄潰
     /// </summary>
     private static void OpenLoginUI()
     {
+    }
 
 
-
+    //杩欓噷娓呯悊鏃舵満涓�瀹氭槸閲嶆柊鐧诲綍/鍒囨崲璐﹀彿锛岃�屼笉鏄煭鏆傜殑鏂嚎閲嶈繛
+    static void ClearGameData()
+    {
+        DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
+        DTC0102_tagCDBPlayer.isAfterPlayerDataInitialize = false;
+        ConfirmCancel.toggleCheckDict.Clear();
     }
 }
\ No newline at end of file
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index 7f31b92..668862d 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -16,16 +16,14 @@
 		}
 	}
 
-	// 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
-	// 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
-	// 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
+
 	// 71 # 鑻遍泟澶╄祴ID鍒楄〃
 	public List<int> talentIDList
 	{
 		get
 		{
 			if (itemHero == null)
-				return null;
+				return new List<int>();
 			return itemHero.GetUseData(71);
 		}
 	}
@@ -36,22 +34,37 @@
 		get
 		{
 			if (itemHero == null)
-				return null;
+				return new List<int>();
 			return itemHero.GetUseData(73);
 		}
 	}
 
 	// 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
-	public List<int> talentLockList
+	// 娲楃偧閿佸畾瀹㈡埛绔紦瀛樹负鍑嗭紝閲嶇櫥浼氭竻闄わ紝濡傛灉闇�瑕侀噸鐧绘樉绀洪攣瀹氬垯鍐嶅鐞�
+	// 瀛樺偍鐨勬槸绱㈠紩涓嶆槸 鏄惁閿佸畾
+	public List<int> talentLockList = new List<int>();
+
+	// 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
+	public List<int> talentRandomIDList
 	{
 		get
 		{
 			if (itemHero == null)
-				return null;
-			return itemHero.GetUseData(75);
+				return new List<int>();
+			return itemHero.GetUseData(77);
 		}
 	}
 
+	// 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
+	public List<int> talentAwakeRandomIDList
+	{
+		get
+		{
+			if (itemHero == null)
+				return new List<int>();
+			return itemHero.GetUseData(79);
+		}
+	}
 
 	Dictionary<int, int> talentAttrDic = new Dictionary<int, int>();   //灞炴�D : 澶╄祴灞炴�у��
 
@@ -102,17 +115,17 @@
 	public bool IsFullStar()
 	{
 		if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null)
-        {
-            return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
-        }
+		{
+			return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
+		}
 
-        //鏍规嵁瑙夐啋绱鎻愬崌鏄熶笂闄�
-        int addStarCount = 0;
-        for (int i = 1; i <= awakeLevel; i++)
-        {
-            addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
-        }
-        return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
+		//鏍规嵁瑙夐啋绱鎻愬崌鏄熶笂闄�
+		int addStarCount = 0;
+		for (int i = 1; i <= awakeLevel; i++)
+		{
+			addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
+		}
+		return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
 	}
 
 	public bool IsFullGift()
@@ -125,8 +138,33 @@
 
 	public int GetTalentLockCount()
 	{
-		//talentLockList閲岀殑鍏冪礌鍏ㄩ儴鐩稿姞 1浠h〃閿佸畾 0浠h〃鏈攣瀹�
-		return talentLockList.Sum();
+		return talentLockList.Count;
+	}
+
+	//璁剧疆鏄惁閿佸畾锛屽彧瀛樺偍閿佸畾鐨勭储寮�
+	public void SetTalentLockState(int lockIndex, int state)
+	{
+		var index = talentLockList.IndexOf(lockIndex);
+
+		if (state == 1)
+		{
+			if (index < 0)
+			{
+				talentLockList.Add(lockIndex);
+			}
+			return;
+		}
+
+		if (state == 0)
+		{ 
+			if (index >= 0)
+			{
+				talentLockList.RemoveAt(index);
+			}
+			return;
+		}
+
+
 	}
 
 }
diff --git a/Main/System/HeroUI/HeroGiftEatWin.cs b/Main/System/HeroUI/HeroGiftEatWin.cs
index bad68cb..240b519 100644
--- a/Main/System/HeroUI/HeroGiftEatWin.cs
+++ b/Main/System/HeroUI/HeroGiftEatWin.cs
@@ -91,7 +91,21 @@
             SysNotifyMgr.Instance.ShowTip("HeroGift3");
             return;
         }
+
         var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
+        //娲楃偧鍜岃閱掔殑澶╄祴鏈鐞嗕笉鍙悶鍣�
+        if (hero.talentRandomIDList.Count > 0 )
+        { 
+            SysNotifyMgr.Instance.ShowTip("HeroGift4");
+            return;
+        }
+
+        if (hero.talentAwakeRandomIDList.Count > 0)
+        { 
+            SysNotifyMgr.Instance.ShowTip("HeroGift5");
+            return;
+        }
+
         var eatHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid);
         if (hero == null || eatHero == null)
             return;
@@ -104,6 +118,7 @@
         HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin = HeroUIManager.Instance.selectHeroGuidForGiftFunc;
         HeroUIManager.Instance.heroBeforeGiftIDList = new List<int>(hero.talentIDList);
         HeroUIManager.Instance.heroBeforeGiftLevelList = new List<int>(hero.talentLvList);
+        HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
 
         //璁剧疆涓瓑寰呭洖澶嶇殑鏍囪瘑 鏄剧ず鎴愬姛鐣岄潰
         HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse()
diff --git a/Main/System/HeroUI/HeroGiftRoleListCell.cs b/Main/System/HeroUI/HeroGiftRoleListCell.cs
index c016d95..1f6d0ea 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)
+        if (hero.awakeLevel > 0 || hero.breakLevel > 0)
         {
             SysNotifyMgr.Instance.ShowTip("HeroReborn1");
             return;
diff --git a/Main/System/HeroUI/HeroGiftWashCell.cs b/Main/System/HeroUI/HeroGiftWashCell.cs
new file mode 100644
index 0000000..86c1f7c
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftWashCell.cs
@@ -0,0 +1,78 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢娲楃偧褰撳墠鐨勫ぉ璧�
+/// </summary>
+public class HeroGiftWashCell : MonoBehaviour
+{
+    [SerializeField] GiftBaseCell giftCell;
+    [SerializeField] Button lockBtn;
+    [SerializeField] Image lockImg;
+
+    [SerializeField] UIEffectPlayer effectPlayer;
+
+
+    public void Display(HeroInfo hero, int index)
+    {
+        int giftID = hero.talentIDList[index];
+        int giftLV = hero.talentLvList[index];
+
+        giftCell.Init(giftID, giftLV);
+
+        if (hero.talentLockList.IndexOf(index) != -1)
+        {
+            lockImg.SetSprite("lockImage");
+        }
+        else
+        {
+            lockImg.SetSprite("unlockImage");
+        }
+
+        lockBtn.AddListener(() =>
+        {
+            var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+            if (hero == null)
+            {
+                return;
+            }
+
+            //娌℃湁鍙戦攣瀹氬寘锛屽鎴风鑷繁淇濆瓨
+            var state = hero.talentLockList.IndexOf(index) == -1 ? 0 : 1;
+
+            if (state == 0 && hero.GetTalentLockCount() >= hero.talentIDList.Count - 1)
+            {
+                //鑷冲皯瑕佷繚鐣欎竴涓ぉ璧嬫湭閿佸畾
+                SysNotifyMgr.Instance.ShowTip("HeroGift6");
+                return;
+            }
+
+            hero.SetTalentLockState(index, state == 1 ? 0 : 1);
+
+            if (hero.talentLockList.IndexOf(index) != -1)
+            {
+                lockImg.SetSprite("lockImage");
+            }
+            else
+            {
+                lockImg.SetSprite("unlockImage");
+            }
+            
+            HeroUIManager.Instance.changeLockEvent?.Invoke();
+        });
+
+    }
+
+    public void ShowEffect(HeroInfo hero, int index)
+    {
+        if (hero.talentLockList.IndexOf(index) != -1)
+        {
+            return;
+        }
+        
+        effectPlayer.Play(true, true);
+    }
+
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Effect/UISpineEffect.cs.meta b/Main/System/HeroUI/HeroGiftWashCell.cs.meta
similarity index 83%
rename from Main/Component/UI/Effect/UISpineEffect.cs.meta
rename to Main/System/HeroUI/HeroGiftWashCell.cs.meta
index d7d957b..c133ebd 100644
--- a/Main/Component/UI/Effect/UISpineEffect.cs.meta
+++ b/Main/System/HeroUI/HeroGiftWashCell.cs.meta
@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: fdbe400d15c065042a16a05cd09dd322
+guid: e4bda7ee080f4a04fb1c9fd7b6c1d399
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2
diff --git a/Main/System/HeroUI/HeroGiftWashWin.cs b/Main/System/HeroUI/HeroGiftWashWin.cs
new file mode 100644
index 0000000..0795e5f
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftWashWin.cs
@@ -0,0 +1,235 @@
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢娲楃偧鐣岄潰
+/// </summary>
+public class HeroGiftWashWin : UIBase
+{
+    [SerializeField] HeroShowBaseCell heroShow;
+    [SerializeField] GameObject currentGo;
+    [SerializeField] GameObject changeGo;
+
+
+    [SerializeField] HeroGiftWashCell[] currentGiftCells;
+
+    [SerializeField] Button washBtn;
+    [SerializeField] Image itemIcon;
+    [SerializeField] Text itemCountText;
+
+    [SerializeField] GiftBaseCell[] beforeGiftCells;
+    [SerializeField] GiftBaseCell[] afterGiftCells;
+    [SerializeField] Button cancelBtn;
+    [SerializeField] Button saveBtn;
+
+
+    HeroInfo hero;
+
+    protected override void InitComponent()
+    {
+        washBtn.AddListener(WashGift);
+        cancelBtn.AddListener(CancelWash);
+        saveBtn.AddListener(SaveWash);
+        btnClickEmptyCloseEvent = OnCloseWin;
+    }
+
+    protected override void OnPreOpen()
+    {
+        hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+        if (hero == null)
+        {
+            return;
+        }
+        HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
+        HeroUIManager.Instance.changeLockEvent += ChangeLockEvent;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        hero = null;
+        HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
+        HeroUIManager.Instance.changeLockEvent -= ChangeLockEvent;
+    }
+
+    void OnHeroChangeEvent(HeroInfo hero)
+    {
+        if (hero.itemHero.guid != HeroUIManager.Instance.selectWashHeroGUID)
+        {
+            return;
+        }
+        Display();
+    }
+
+
+    public void Display()
+    {
+        heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel);
+
+        if (hero.talentRandomIDList.Count == 0)
+        {
+            currentGo.SetActive(true);
+            changeGo.SetActive(false);
+            for (int i = 0; i < currentGiftCells.Length; i++)
+            {
+                if (i < hero.talentIDList.Count)
+                {
+                    currentGiftCells[i].SetActive(true);
+                    currentGiftCells[i].Display(hero, i);
+                }
+                else
+                {
+                    currentGiftCells[i].SetActive(false);
+                }
+            }
+            itemIcon.SetItemSprite(HeroUIManager.Instance.washItemID);
+            int useCount = HeroUIManager.Instance.GetTalentLockUseWashCount(hero);
+            var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, HeroUIManager.Instance.washItemID);
+            itemCountText.text = UIHelper.AppendColor(itemCount >= useCount ? TextColType.Green : TextColType.Red,
+                itemCount + "/" + useCount);
+        }
+        else
+        {
+            currentGo.SetActive(false);
+            changeGo.SetActive(true);
+            HeroUIManager.Instance.RefreshGiftCell(beforeGiftCells, hero);  //褰撳墠澶╄祴
+            ShowChangeGift(hero);   //闅忔満鏈繚瀛樼殑澶╄祴
+
+        }
+    }
+
+
+    void WashGift()
+    {
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+        if (hero == null)
+        {
+            return;
+        }
+
+        //鏍规嵁閿佺姸鎬佸垽鏂潗鏂欐槸鍚﹁冻澶�
+        if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID,
+        HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2))
+        {
+            return;
+        }
+
+        for (int i = 0; i < currentGiftCells.Length; i++)
+        {
+            if (i < hero.talentIDList.Count)
+            {
+                currentGiftCells[i].ShowEffect(hero, i);
+            }
+        }
+
+        closeTime = Time.time;
+        //鍋氱壒鏁堣〃鐜�
+        SendPack().Forget();
+    }
+    float closeTime;
+
+
+    async UniTask SendPack()
+    {
+        //寤惰繜0.5绉掑彂鍖�
+        await UniTask.Delay(500);
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+        if (hero == null)
+        {
+            return;
+        }
+
+
+        HeroUIManager.Instance.SendWash(hero, 0);
+    }
+
+
+    void ShowChangeGift(HeroInfo hero)
+    {
+        for (int i = 0; i < afterGiftCells.Length; i++)
+        {
+            if (i >= hero.talentRandomIDList.Count)
+            {
+                afterGiftCells[i].SetActive(false);
+                continue;
+            }
+
+            afterGiftCells[i].SetActive(true);
+
+
+            afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i]);
+
+            //瀵规瘮鍙樺寲鐨勫ぉ璧嬫樉绀虹壒鏁�
+            if (hero.talentRandomIDList[i] != hero.talentIDList[i])
+            {
+                afterGiftCells[i].GetComponentInChildren<UIEffectPlayer>().Play();
+            }
+            else
+            {
+                afterGiftCells[i].GetComponentInChildren<UIEffectPlayer>().Stop();
+            }
+        }
+    }
+
+
+    void CancelWash()
+    {
+        //鍙栨秷娲楃偧
+        ConfirmCancel.ToggleConfirmCancelByType(ToggleCheckType.WashCancel, Language.Get("HeroGift20"), () =>
+        {
+            var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+            if (hero == null)
+            {
+                return;
+            }
+            HeroUIManager.Instance.SendWash(hero, 2);
+        });
+    }
+
+    void SaveWash()
+    {
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+        if (hero == null)
+        {
+            return;
+        }
+        HeroUIManager.Instance.SendWash(hero, 1);
+
+    }
+
+
+    void OnCloseWin()
+    {
+        if (Time.time - closeTime < 1f)
+        {
+            return;
+        }
+        //娲楃偧缁撴灉鏈鐞�
+        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectWashHeroGUID);
+        if (hero == null)
+        {
+            return;
+        }
+
+        if (hero.talentRandomIDList.Count > 0)
+        {
+            return;
+        }
+        else
+        {
+            CloseWindow();
+        }
+    }
+
+
+    void ChangeLockEvent()
+    { 
+        int useCount = HeroUIManager.Instance.GetTalentLockUseWashCount(hero);
+        var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, HeroUIManager.Instance.washItemID);
+        itemCountText.text = UIHelper.AppendColor(itemCount >= useCount ? TextColType.Green : TextColType.Red,
+            itemCount + "/" + useCount);
+    }
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Effect/UISpineEffect.cs.meta b/Main/System/HeroUI/HeroGiftWashWin.cs.meta
similarity index 83%
copy from Main/Component/UI/Effect/UISpineEffect.cs.meta
copy to Main/System/HeroUI/HeroGiftWashWin.cs.meta
index d7d957b..e656972 100644
--- a/Main/Component/UI/Effect/UISpineEffect.cs.meta
+++ b/Main/System/HeroUI/HeroGiftWashWin.cs.meta
@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: fdbe400d15c065042a16a05cd09dd322
+guid: e98a167ec42aa6541b0854a73c6c727b
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 790067b..9a4583b 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -616,23 +616,18 @@
 
     void StarUP()
     {
-        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId,  hero.Quality))
+        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
         {
             return;
         }
         else if (hero.IsFullStar())
         {
-            starUPBtn.interactable = true;
-            starUPBtn.SetColorful(null, false);
-            starUPBtnText.text = Language.Get("HeroGift3");
+            SysNotifyMgr.Instance.ShowTip("HeroGift1");
+            return;
         }
-        else
-        {
-            starUPBtn.interactable = true;
-            starUPBtn.SetColorful(null, true);
-            HeroUIManager.Instance.selectHeroGuidForGiftFunc = hero.itemHero.guid;
-            UIManager.Instance.OpenWindow<HeroGiftEatWin>();
-        }
+
+        HeroUIManager.Instance.selectHeroGuidForGiftFunc = hero.itemHero.guid;
+        UIManager.Instance.OpenWindow<HeroGiftEatWin>();
     }
 
     void Wash()
@@ -642,15 +637,9 @@
             SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel);
             return;
         }
-        // //鏍规嵁閿佺姸鎬佸垽鏂潗鏂欐槸鍚﹁冻澶�
-        // if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID,
-        // HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2))
-        // {
-        //     return;
-        // }
 
-
-        // UIManager.Instance.OpenWindow<HeroGiftWashWin>();
+        HeroUIManager.Instance.selectWashHeroGUID = hero.itemHero.guid;
+        UIManager.Instance.OpenWindow<HeroGiftWashWin>();
 
     }
 }
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
index a57892b..793db64 100644
--- a/Main/System/HeroUI/HeroUIManager.Talent.cs
+++ b/Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -38,7 +38,11 @@
         }
     }
 
+    #region 娲楃偧
+    public string selectWashHeroGUID; //琚礂缁冩灏咷UID
+    public Action changeLockEvent;
 
+    #endregion
 
     public List<string> heroEatList = new List<string>();
 
@@ -60,7 +64,13 @@
     //鏍规嵁澶╄祴閿佺姸鎬佽幏鍙栨秷鑰楃殑鏉愭枡鏁伴噺
     public int GetTalentLockUseWashCount(HeroInfo hero)
     {
-        return washByLockUseCounts[hero.GetTalentLockCount()];
+        int heroTalentLockCount = hero.GetTalentLockCount();
+        //涓嶅鍙栨渶鍚庝竴涓�
+        if (heroTalentLockCount >= washByLockUseCounts.Length)
+        {
+            heroTalentLockCount = washByLockUseCounts.Length - 1;
+        }
+        return washByLockUseCounts[heroTalentLockCount];
     }
 
 
@@ -98,7 +108,7 @@
 
 
     //beforeGiftIDList鐢ㄤ簬瀵规瘮鍙樺寲鐨勫ぉ璧嬫牸瀛�
-    public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList= null, List<int> beforeGiftLevelList= null)
+    public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList = null, List<int> beforeGiftLevelList = null)
     {
         int showCount = GetGiftGirdMaxCount(hero.heroId);
         for (int i = 0; i < giftBaseCells.Length; i++)
@@ -117,7 +127,7 @@
                 int state = 0; //0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
 
                 if (!beforeGiftIDList.IsNullOrEmpty())
-                { 
+                {
                     if (i >= beforeGiftIDList.Count)
                     {
                         state = 1;
@@ -177,7 +187,7 @@
 
 
     public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true)
-    { 
+    {
         int imgCount = starImages.Length;
         for (int i = 0; i < imgCount; i++)
         {
@@ -205,5 +215,24 @@
             }
         }
     }
+
+
+    // public ushort ItemIndex;    //姝﹀皢鐗╁搧鎵�鍦ㄦ灏嗚儗鍖呬綅缃储寮�
+    // public byte LockCnt;
+    // public  byte[] LockTalentIndexs;    //閿佸畾澶╄祴绱㈠紩鍒楄〃
+    // public byte OPType;    // 鎿嶄綔绫诲瀷锛�0-鎵ц娲楃偧锛�1-鏇挎崲鍘熷ぉ璧嬶紱2-淇濈暀鍘熷ぉ璧�
+    public void SendWash(HeroInfo hero, byte opType)
+    {
+        var pack = new CB235_tagCSHeroWash();
+        pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+        pack.LockCnt = (byte)hero.talentLockList.Count;
+        pack.LockTalentIndexs = new byte[pack.LockCnt];
+        for (int i = 0; i < pack.LockCnt; i++)
+        {
+            pack.LockTalentIndexs[i] = (byte)hero.talentLockList[i];
+        }
+        pack.OPType = opType;
+        GameNetSystem.Instance.SendInfo(pack);
+    }
 }
 
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 5ea30a5..429d79e 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -17,6 +17,7 @@
     public WaitHeroFuncResponse waitResponse;    //璇锋眰姝﹀皢鍔熻兘锛屼笌鏈嶅姟绔氦浜�
 
     //鐢ㄤ簬闈炰笂闃垫灏嗘垬鍔涘彉鍖栨椂 姝﹀皢ID锛氫笂娆℃垬鍔�
+    //浣跨敤鏂规硶锛氬叾浠栧姛鑳界晫闈㈣缃鍊煎嵆鍙�
     public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>(); 
 
     public override void Init()
diff --git a/Main/System/ItemTip/ItemTipUtility.cs b/Main/System/ItemTip/ItemTipUtility.cs
index 9c80061..6a5e647 100644
--- a/Main/System/ItemTip/ItemTipUtility.cs
+++ b/Main/System/ItemTip/ItemTipUtility.cs
@@ -237,6 +237,7 @@
     }
 
 
+    //showGetWay 鏄惁鑾峰彇閫斿緞鐣岄潰
     public static void Show(int itemId, bool showGetWay = false)
     {
         if (!ItemConfig.HasKey(itemId))
diff --git a/Main/System/KnapSack/Logic/ItemModel.cs b/Main/System/KnapSack/Logic/ItemModel.cs
index 4950563..fd5057e 100644
--- a/Main/System/KnapSack/Logic/ItemModel.cs
+++ b/Main/System/KnapSack/Logic/ItemModel.cs
@@ -121,7 +121,7 @@
             useDataDict.TryGetValue(key, out list);
         }
 
-        return list;
+        return list == null ? new List<int>() : list;
     }
 
     public int GetUseDataFirstValue(int key)
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index cc00f34..f763ca2 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -192,13 +192,10 @@
     }
 
     //鏈鐧婚檰涓嶅啀鎻愮ず, toggle鐨勭‘璁ょ被鍨嬶紝鏂逛究澶栭儴璋冪敤
-    static Dictionary<int, bool> toggleCheckDict = new Dictionary<int, bool>();
-    public enum ToggleCheckType
-    {
-        Auction = 0, //鎷嶅崠琛�
-    }
+    public static Dictionary<ToggleCheckType, bool> toggleCheckDict = new Dictionary<ToggleCheckType, bool>();
 
-    public static void ToggleConfirmCancelByType(int type, string fullTip, Action func)
+
+    public static void ToggleConfirmCancelByType(ToggleCheckType type, string fullTip, Action func)
     {
         if (toggleCheckDict.ContainsKey(type) && toggleCheckDict[type])
         {
@@ -323,4 +320,10 @@
 
 }
 
+public enum ToggleCheckType
+{
+    Auction = 0, //鎷嶅崠琛�
+    WashCancel = 1, //娲楃粌鍙栨秷
+}
+
 

--
Gitblit v1.8.0