From 7dc59be24d527d92a28c2e6227c178f8b96ab6e0 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期二, 06 一月 2026 19:41:22 +0800
Subject: [PATCH] 282 查看他人-客户端 支持显示红颜和坐骑

---
 Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs |  131 ++++++++++++++++++++++----------
 Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs     |   53 +++++++++++-
 2 files changed, 138 insertions(+), 46 deletions(-)

diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
index 944299c..40d114c 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
@@ -337,6 +337,20 @@
         return GetUseData(hero, 73);
     }
 
+    // 鑾峰彇绾㈤灞炴�у��
+    public RolePlusData.BeautyData GetBeautyData(int playerID)
+    {
+        ViewPlayerData viewPlayerData = GetViewPlayerData(playerID);
+        return viewPlayerData?.rolePlusData?.beautyData;
+    }
+
+    // 鑾峰彇鍧愰獞鏁版嵁瀵硅薄
+    public RolePlusData.HorseData GetHorseData(int playerID)
+    {
+        ViewPlayerData viewPlayerData = GetViewPlayerData(playerID);
+        return viewPlayerData?.rolePlusData?.horseData;
+    }
+
     #endregion
     #region 瑙f瀽PlusData
     public class ViewPlayerData
@@ -370,6 +384,27 @@
 
         // 闃靛瀛楀吀 <闃靛ID, 闃靛鏁版嵁>
         public Dictionary<int, LineupData> LineupDic = new Dictionary<int, LineupData>();
+
+        // 绾㈤鏁版嵁
+        public BeautyData beautyData;
+
+        // 鍧愰獞鏁版嵁
+        public HorseData horseData;
+
+        // 绾㈤鏁版嵁绫�
+        public class BeautyData
+        {
+            public int Cnt; // 宸茶В閿佹暟
+            public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); // 灞炴��
+        }
+
+        // 鍧愰獞鏁版嵁绫�
+        public class HorseData
+        {
+            public int LV;       // 绛夌骇
+            public int ClassLV;  // 闃剁骇
+            public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); // 灞炴��
+        }
 
         // 瑁呭鏁版嵁绫�
         public class EquipData
@@ -405,18 +440,43 @@
             public Dictionary<int, List<int>> Data = new Dictionary<int, List<int>>();
         }
 
-        // --- 瑙f瀽閫昏緫 ---
+        // 閫氱敤鐨勫睘鎬цВ鏋愭柟娉�
+        private Dictionary<int, long> ParseAttrDict(JsonData jd, string key)
+        {
+            Dictionary<int, long> result = new Dictionary<int, long>();
+            if (jd.Keys.Contains(key))
+            {
+                JsonData attrs = jd[key];
+                foreach (string attrKey in attrs.Keys)
+                {
+                    if (int.TryParse(attrKey, out int attrId))
+                    {
+                        JsonData v = attrs[attrKey];
+                        long val = 0;
+                        // 鍋ュ.鎬ф暟鍊艰浆鎹�
+                        if (v.IsLong) val = (long)v;
+                        else if (v.IsInt) val = (long)(int)v;
+                        else if (v.IsDouble) val = (long)(double)v;
+                        else if (v.IsString) long.TryParse(v.ToString(), out val);
 
+                        result[attrId] = val;
+                    }
+                }
+            }
+            return result;
+        }
+
+        // --- 瑙f瀽閫昏緫 ---
         public void AnalysisRolePlusData(string jsonStr)
         {
             try
             {
                 if (string.IsNullOrEmpty(jsonStr)) return;
 
-                // 娓呴櫎鏃ф暟鎹紝闃叉閲嶇敤瀵硅薄鏃舵暟鎹爢鍙�
                 EquipDic.Clear();
                 LineupDic.Clear();
-
+                beautyData = null; // 蹇呴』缃┖锛岄槻姝㈡樉绀轰笂涓�涓帺瀹剁殑鏁版嵁
+                horseData = null;  // 蹇呴』缃┖
                 // 1. 杞负 JsonData 瀵硅薄
                 JsonData jd = JsonMapper.ToObject(jsonStr);
 
@@ -441,7 +501,33 @@
                         }
                     }
                 }
+                // 銆愭柊澧炪�戣В鏋愮孩棰� (Beauty)
+                if (jd.Keys.Contains("Beauty"))
+                {
+                    JsonData beautyJd = jd["Beauty"];
+                    beautyData = new BeautyData();
 
+                    if (beautyJd.Keys.Contains("Cnt"))
+                        beautyData.Cnt = (int)beautyJd["Cnt"];
+
+                    // 瑙f瀽灞炴��
+                    beautyData.AttrDict = ParseAttrDict(beautyJd, "Attr");
+                }
+                // 銆愭柊澧炪�戣В鏋愬潗楠� (Horse)
+                if (jd.Keys.Contains("Horse"))
+                {
+                    JsonData horseJd = jd["Horse"];
+                    horseData = new HorseData();
+
+                    if (horseJd.Keys.Contains("LV"))
+                        horseData.LV = (int)horseJd["LV"];
+
+                    if (horseJd.Keys.Contains("ClassLV"))
+                        horseData.ClassLV = (int)horseJd["ClassLV"];
+
+                    // 瑙f瀽灞炴��
+                    horseData.AttrDict = ParseAttrDict(horseJd, "Attr");
+                }
                 // 3. 瑙f瀽闃靛 (Lineup)
                 if (jd.Keys.Contains("Lineup"))
                 {
@@ -493,43 +579,7 @@
                                                 heroData.SkillIDList.Add((int)skills[i]);
                                             }
                                         }
-
-                                        // 銆愪慨鏀圭偣 2銆�: 灞炴�цВ鏋愰�昏緫鏇存柊
-                                        if (heroJd.Keys.Contains("AttrDict"))
-                                        {
-                                            JsonData attrs = heroJd["AttrDict"];
-                                            foreach (string attrKey in attrs.Keys)
-                                            {
-                                                if (int.TryParse(attrKey, out int attrId))
-                                                {
-                                                    JsonData v = attrs[attrKey];
-                                                    long val = 0;
-
-                                                    // 鍋ュ.鎬у垽鏂細鏃犺Json閲屾槸int, long杩樻槸double锛岄兘瀹夊叏杞负long
-                                                    if (v.IsLong)
-                                                    {
-                                                        val = (long)v;
-                                                    }
-                                                    else if (v.IsInt)
-                                                    {
-                                                        val = (long)(int)v;
-                                                    }
-                                                    else if (v.IsDouble)
-                                                    {
-                                                        // 濡傛灉鏈嶅姟绔彂浜嗗皬鏁帮紝杩欓噷浼氭埅鏂彇鏁达紝闃叉鎶ラ敊
-                                                        val = (long)(double)v;
-                                                    }
-                                                    else if (v.IsString)
-                                                    {
-                                                        // 闃叉鏈変簺鏋佺鎯呭喌鏁板�煎彉鎴愪簡瀛楃涓�
-                                                        long.TryParse(v.ToString(), out val);
-                                                    }
-
-                                                    heroData.AttrDict[attrId] = val;
-                                                }
-                                            }
-                                        }
-
+                                        heroData.AttrDict = ParseAttrDict(heroJd, "AttrDict");
                                         lineupData.HeroDic[heroPos] = heroData;
                                     }
                                 }
@@ -538,6 +588,7 @@
                         }
                     }
                 }
+
             }
             catch (Exception e)
             {
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
index ec259e1..237a0c4 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
@@ -20,6 +20,10 @@
     [SerializeField] OtherEquipCardItem[] equipCards;
     [SerializeField] ButtonEx btnMM;
     [SerializeField] TextEx txtMMCnt;
+    [SerializeField] ButtonEx btnHorse;
+    [SerializeField] HorseController horseController;
+    [SerializeField] TextEx txtHorseLV;
+    [SerializeField] ImageEx imgHorseBG;
     [SerializeField] ButtonEx btnBlock;
     [SerializeField] ButtonEx btnReport;
     [SerializeField] ButtonEx btnAddFriend;
@@ -34,6 +38,8 @@
         btnReport.SetListener(OnClickReport);
         btnCopy.SetListener(OnClickCopy);
         btnGuild.SetListener(OnClickGuild);
+        btnMM.SetListener(OnClickMM);
+        btnHorse.SetListener(OnClickHorse);
     }
 
     protected override void OnPreOpen()
@@ -76,11 +82,14 @@
             return;
         }
 
-        DisplayMM();
+
         DisplayPlayerInfo(viewPlayerData);
         DisplayGuildInfo(viewPlayerData);
 
         int playerID = viewPlayerData.PlayerID;
+
+        DisplayMM(playerID);
+
         var heroList = manager.GetHeroDataSortList(playerID, teamType);
         if (heroList.IsNullOrEmpty())
         {
@@ -103,11 +112,11 @@
         DisplayEquip(equipDict);
     }
 
-    private void DisplayMM()
+    private void DisplayMM(int playerID)
     {
-        txtMMCnt.text = Language.Get("OtherPlayerDetail08", 0);
+        OtherPlayerDetailManager.RolePlusData.BeautyData beautyData = manager.GetBeautyData(playerID);
+        txtMMCnt.text = Language.Get("OtherPlayerDetail08", beautyData == null ? 0 : beautyData.Cnt);
     }
-
     private void DisplayGuildInfo(OtherPlayerDetailManager.ViewPlayerData viewPlayerData)
     {
         if (viewPlayerData.FamilyEmblemID <= 0 || string.IsNullOrEmpty(viewPlayerData.FamilyEmblemWord))
@@ -135,7 +144,7 @@
 
     private void DisplayHorseModel(OtherPlayerDetailManager.ViewPlayerData viewPlayerData)
     {
-        int HorseSkinID = viewPlayerData.EquipShowSwitch % 1000;
+        int horseSkinID = HorseManager.Instance.GetOtherPlayerHorseSkinID(viewPlayerData.EquipShowSwitch);
         int modelMark = viewPlayerData.ModelMark;
 
         // 濡傛灉 ModelMark 涓� 0锛岃幏鍙栭粯璁ょ殑 ModelMark
@@ -154,7 +163,15 @@
 
         var modelConfig = ModelConfig.Get(modelMark);
         int heroSkinID = modelConfig.SkinID;
-        horseModel.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID(HorseSkinID), heroSkinID, 1);
+        horseModel.Create(horseSkinID, heroSkinID, 1);
+
+        OtherPlayerDetailManager.RolePlusData.HorseData horseData = manager.GetHorseData(viewPlayerData.PlayerID);
+        imgHorseBG.SetActive(horseData != null);
+        if (horseData != null)
+        {
+            txtHorseLV.text = Language.Get("Horse8", horseData == null ? 0 : horseData.ClassLV, horseData == null ? 0 : horseData.LV);
+            horseController.Create(horseSkinID, 0, 0.6f);
+        }
     }
 
     private void DisplayCard(List<OtherPlayerDetailManager.RolePlusData.HeroData> heros)
@@ -231,5 +248,29 @@
         GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString());
     }
 
+    private void OnClickMM()
+    {
+        if (viewPlayerData == null)
+        {
+            return;
+        }
+        int playerID = viewPlayerData.PlayerID;
+        OtherPlayerDetailManager.RolePlusData.BeautyData beautyData = manager.GetBeautyData(playerID);
 
+        AttributeManager.Instance.OpenTotalAttributeWin(beautyData == null || beautyData.AttrDict == null ? new Dictionary<int, long>() : beautyData.AttrDict);
+    }
+    private void OnClickHorse()
+    {
+        if (viewPlayerData == null)
+        {
+            return;
+        }
+        int playerID = viewPlayerData.PlayerID;
+        OtherPlayerDetailManager.RolePlusData.HorseData horseData = manager.GetHorseData(playerID);
+        if (horseData == null)
+        {
+            return;
+        }
+        AttributeManager.Instance.OpenTotalAttributeWin(horseData.AttrDict == null ? new Dictionary<int, long>() : horseData.AttrDict);
+    }
 }

--
Gitblit v1.8.0