From bc6f787bac321f603a37fb680e7e9c6eef6e06b0 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 16 十月 2025 10:53:00 +0800
Subject: [PATCH] 218 子 【付费内容】首充 / 【付费内容】首充-客户端 实现获得英雄物品,大于等于传奇品质展示英雄立绘,逻辑同抽奖

---
 Main/System/FirstCharge/HeroShowLHWin.cs.meta  |   11 +++
 Main/System/KnapSack/Logic/ItemLogicUtility.cs |   41 ++++++++++++-
 Main/System/FirstCharge/HeroShowLHWin.cs       |   71 +++++++++++++++++++++++
 3 files changed, 119 insertions(+), 4 deletions(-)

diff --git a/Main/System/FirstCharge/HeroShowLHWin.cs b/Main/System/FirstCharge/HeroShowLHWin.cs
new file mode 100644
index 0000000..a465076
--- /dev/null
+++ b/Main/System/FirstCharge/HeroShowLHWin.cs
@@ -0,0 +1,71 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class HeroShowLHWin : UIBase
+{
+    [SerializeField] UIHeroController roleLHModel;
+    [SerializeField] PositionTween roleLHModelTween;
+    [SerializeField] UIAlphaTween roleLHModelTween2;
+    [SerializeField] RawImage bgTexture;
+    [SerializeField] Image qualityImg;
+    [SerializeField] HeroCallResultCell showLHResultCell;
+    [SerializeField] Image newMarkLHImg;
+    [SerializeField] Button showNextlhOrCloseBtn;
+
+    [SerializeField] Text heroNameText;
+    [SerializeField] Image heroCountryImg;
+    [SerializeField] Image heroJobImg;
+    [SerializeField] Text jobPosNameText;
+
+    protected override void InitComponent()
+    {
+        showNextlhOrCloseBtn.AddListener(RefreshLihui);
+    }
+
+    protected override void OnPreOpen()
+    {
+        RefreshLihui();
+    }
+
+    protected override void OnPreClose()
+    {
+    }
+
+    void RefreshLihui()
+    {
+        //姹囨�诲搧璐ㄤ紶璇村強浠ヤ笂鐨勭珛缁�
+        int heroID = 0;
+        if (ItemLogicUtility.Instance.poplhHeroIdList.Count > 0)
+        {
+            heroID = ItemLogicUtility.Instance.poplhHeroIdList[0];
+            ItemLogicUtility.Instance.poplhHeroIdList.RemoveAt(0);
+        }
+        else
+        {
+            CloseWindow();
+            return;
+        }
+        var hero = HeroConfig.Get(heroID);
+        roleLHModel.Create(hero.SkinIDList[0], 1, motionName: "", isLh: true);
+        qualityImg.SetSprite("HeroCallQuality" + hero.Quality);
+        newMarkLHImg.SetActive(HeroUIManager.Instance.IsNewHero(heroID));
+        showLHResultCell.Display(heroID, 0, true);
+        RefreshHeroInfo(heroID);
+        roleLHModelTween.SetStartState();
+        roleLHModelTween.Play();
+        roleLHModelTween2.SetStartState();
+        roleLHModelTween2.Play();
+        bgTexture.SetTexture2D("countryBG" + hero.Country);
+    }
+
+    void RefreshHeroInfo(int heroID)
+    {
+        var heroConfig = HeroConfig.Get(heroID);
+        heroNameText.text = heroConfig.Name;
+        heroNameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
+        heroCountryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
+        heroJobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
+        jobPosNameText.text = HeroUIManager.Instance.GetJobName(heroConfig.Class) + "  " + heroConfig.Desc;
+    }
+}
\ No newline at end of file
diff --git a/Main/System/FirstCharge/HeroShowLHWin.cs.meta b/Main/System/FirstCharge/HeroShowLHWin.cs.meta
new file mode 100644
index 0000000..80ec91b
--- /dev/null
+++ b/Main/System/FirstCharge/HeroShowLHWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 72585065cb2d25e45bd99b5e43fc7261
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
index 915f6f3..8c72ea0 100644
--- a/Main/System/KnapSack/Logic/ItemLogicUtility.cs
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -173,7 +173,7 @@
 
     }
 
-    
+
 
     // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
     // {
@@ -256,7 +256,7 @@
             }
         }
 
-        
+
     }
 
     #endregion
@@ -296,7 +296,7 @@
         return isEnough;
     }
 
-    
+
 
     public event Action<string> GetBetterEquipEvent; //寰楀埌鏇村ソ鐨勮澶� value 鐗╁搧鐨勫疄渚婭D
 
@@ -819,7 +819,7 @@
     // }
     #endregion
 
-    
+
 
     bool IsCanPutOn(ItemModel item)
     {
@@ -1143,8 +1143,37 @@
 
     //     return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
     // }
+    #region 鑾峰緱鑻遍泟鐗╁搧灞曠ず绔嬬粯
+    public List<int> poplhHeroIdList = new List<int>();
 
+    public void SetHeroList(List<Item> items)
+    {
+        if (items.IsNullOrEmpty())
+            return;
+        foreach (var item in items)
+        {
+            int itemId = item.id;
+            if (HeroConfig.HasKey(itemId) &&
+                HeroConfig.Get(itemId).Quality >= HappyXBModel.Instance.lhQuality)
+            {
+                poplhHeroIdList.Add(itemId);
+            }
+        }
+    }
 
+    public void ShowHeroLHWin(List<Item> items)
+    {
+        SetHeroList(items);
+        if (poplhHeroIdList.Count > 0)
+        {
+            if (!UIManager.Instance.IsOpenedInList<HeroShowLHWin>())
+            {
+                UIManager.Instance.OpenWindow<HeroShowLHWin>();
+            }
+        }
+    }
+
+    #endregion
 
     public Action OnGetItem;    //CommonGetItemWin鐣岄潰鍏抽棴鏃惰Е鍙�
     public string getItemInfo { get; private set; }  //閫氱敤鏄剧ず鑾峰緱鐨勭晫闈俊鎭�
@@ -1193,6 +1222,8 @@
         {
             UIManager.Instance.OpenWindow<CommonGetItemWin>();
         }
+
+        ShowHeroLHWin(items);//鏈変紶濂囦互涓婅嫳闆勬樉绀虹珛缁�
     }
 
     //鍙互鎸囧畾鎵撳紑鐨勭獥鍙�
@@ -1237,6 +1268,8 @@
         {
             UIManager.Instance.OpenWindow<T>();
         }
+
+        ShowHeroLHWin(items);//鏈変紶濂囦互涓婅嫳闆勬樉绀虹珛缁�
     }
     public void ClearGetItem()
     {

--
Gitblit v1.8.0