From 6521aa56fbeba8d6509d5736bd35b1d42dcc4029 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 17 十一月 2025 19:12:37 +0800
Subject: [PATCH] 328 【主界面】坐骑系统

---
 Main/Core/GameEngine/Player/PlayerBaseData.cs      |    2 
 Main/System/Horse/HorseSuccessWin.cs               |   75 +++++++++++++++++++++++-
 Main/System/Horse/HorseManager.cs                  |   11 +++
 Main/System/Main/HomeWin.cs                        |    2 
 Main/Config/PartialConfigs/PlayerPropertyConfig.cs |   20 +++++-
 Main/System/Horse/HorseWin.cs                      |   19 +++++-
 Main/System/Horse/HorseRankUPWin.cs                |   18 +++--
 7 files changed, 126 insertions(+), 21 deletions(-)

diff --git a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
index 80dbebe..412e6f6 100644
--- a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
+++ b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -106,12 +106,13 @@
         }
     }
 
-    public static string GetValueDescription(int id, long value)
+    //largeNumFormat 澶ф暟鍊兼牸寮忥細0 榛樿鍘熸暟鍊� 1 鎸変竾鎴栬��(K)鏄剧ず 2 鎸�6浣嶆暟浠ヤ笂锛堟墠杞崲澶ф暟鍊硷紝鏍规嵁鎯呭喌鍙粺涓�璋冩暣锛�
+    public static string GetValueDescription(int id, long value, int largeNumFormat = 1)
     {
-        return GetValueDescription(id, value, true);
+        return GetValueDescriptionEx(id, value, largeNumFormat);
     }
 
-    public static string GetValueDescription(int id, long value, bool largeValue)
+    public static string GetValueDescriptionEx(int id, long value, int largeNumFormat = 1)
     {
         var config = Get(id);
         if (config == null)
@@ -134,10 +135,21 @@
         }
 
         var label = string.Empty;
-        if (largeValue)
+        if (largeNumFormat == 1)
         {
             label = UIHelper.ReplaceLargeNum(result);
         }
+        else if (largeNumFormat == 2)
+        {
+            if (result > 999999)
+            {
+                label = UIHelper.ReplaceLargeNum(result, 6);
+            }
+            else
+            {
+                label = result.ToString();
+            }
+        }
         else
         {
             label = result.ToString();
diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs
index 3c5ec04..56f00f0 100644
--- a/Main/Core/GameEngine/Player/PlayerBaseData.cs
+++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -101,7 +101,7 @@
     public int BasicsDefense;//鍩虹闃插尽
     public int BasicsScoreAHit;//鍩虹鍛戒腑
     public int BasicsDodge;//鍩虹闂伩
-    public uint equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦�  涓綅鏁板崄浣嶆暟锛堟渶澶ф敮鎸� 1~99锛�
+    public uint equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦紙鏈�澶ф敮鎸� 1~999锛�
     public int mater;//鐏垫牴灞炴�р�斺�旈噾
     public int wood;//鐏垫牴灞炴�р�斺�旀湪
     public int water;//鐏垫牴灞炴�р�斺�旀按
diff --git a/Main/System/Horse/HorseManager.cs b/Main/System/Horse/HorseManager.cs
index 566a1a6..c9a935c 100644
--- a/Main/System/Horse/HorseManager.cs
+++ b/Main/System/Horse/HorseManager.cs
@@ -66,17 +66,26 @@
 
     public int GetHorseSkinID()
     {
-        return (int)PlayerDatas.Instance.baseData.equipShowSwitch%100;
+        return (int)PlayerDatas.Instance.baseData.equipShowSwitch%1000;
     }
 
     public void UpdateHorseInfo(HA303_tagSCHorseClassInfo netPack)
     {
+        bool isOpenSuccess = false;
+        if (classLV != netPack.ClassLV && DTC0403_tagPlayerLoginLoadOK.finishedLogin)
+        {
+            isOpenSuccess = true;
+        }
         classLV = netPack.ClassLV;
         horseLV = netPack.HorseLV;
         exp = netPack.Exp;
         UpdateRedpoint();
         RefreshAttr();
         OnHorseUpdateEvent?.Invoke();
+        if (isOpenSuccess)
+        {
+            UIManager.Instance.OpenWindow<HorseSuccessWin>();
+        }
     }
 
 
diff --git a/Main/System/Horse/HorseRankUPWin.cs b/Main/System/Horse/HorseRankUPWin.cs
index f392de3..80dddfa 100644
--- a/Main/System/Horse/HorseRankUPWin.cs
+++ b/Main/System/Horse/HorseRankUPWin.cs
@@ -48,9 +48,12 @@
         {
             if (i < keys.Count)
             {
+                var curValue = HorseManager.Instance.attrDic[keys[i]];
                 attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
-                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]);
-                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextConfig.ClassAttrValueList[i]);
+                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
+                
+                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], 
+                    curValue + nextConfig.ClassAttrValueList[i] + nextConfig.PerLVAttrValueList[i], 2);
             }
         }
 
@@ -61,16 +64,17 @@
             if (i < nextConfig.ClassSpecAttrIDList.Length)
             {
                 specialAttrRect[i].SetActive(true);
-                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(nextKeys[i]).Name;
+                var id = nextConfig.ClassSpecAttrIDList[i];
+                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(id).Name;
                 if (i < nextKeys.Count)
                 {
-                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]]);
-                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]] + nextConfig.ClassSpecAttrValueList[i]);
+                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, HorseManager.Instance.specialAttrDic[nextKeys[i]], 2);
+                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, HorseManager.Instance.specialAttrDic[nextKeys[i]] + nextConfig.ClassSpecAttrValueList[i], 2);
                 }
                 else
                 {
-                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], 0);
-                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], nextConfig.ClassSpecAttrValueList[i]);
+                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 0);
+                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, nextConfig.ClassSpecAttrValueList[i], 2);
                 }
             }
             else
diff --git a/Main/System/Horse/HorseSuccessWin.cs b/Main/System/Horse/HorseSuccessWin.cs
index eb5091c..f21c45d 100644
--- a/Main/System/Horse/HorseSuccessWin.cs
+++ b/Main/System/Horse/HorseSuccessWin.cs
@@ -1,27 +1,94 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 using UnityEngine;
 using UnityEngine.UI;
 
 /// <summary>
-/// 鍧愰獞
+/// 鍧愰獞杩涢樁鎴愬姛
 /// </summary>
 public class HorseSuccessWin : UIBase
 {
-    [SerializeField] Button bagBtn;
+    [SerializeField] Text curLVText;
+    [SerializeField] Text nextLVText;
+    [SerializeField] Text[] attrNameTexts;
+    [SerializeField] Text[] attrValueTexts;
+    [SerializeField] Text[] nextAttrValueTexts;
+
+    [SerializeField] Transform[] specialAttrRect;
+    [SerializeField] Text[] specialAttrNameTexts;
+    [SerializeField] Text[] specialAttrValueTexts;
+    [SerializeField] Text[] specialNextAttrValueTexts;
+    [SerializeField] Button okBtn;
+
+
 
     protected override void InitComponent()
     {
-
+        okBtn.AddListener(CloseWindow);
     }
+
 
     protected override void OnPreOpen()
     {
-
+        Display();
     }
 
     protected override void OnPreClose()
     {
+    }
+
+
+    void Display()
+    {
+        var config = HorseClassConfig.Get(HorseManager.Instance.classLV - 1);
+        curLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV - 1, config.MaxLV);
+        nextLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, 1);
+
+        var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV);
+
+        var keys = HorseManager.Instance.attrDic.Keys.ToList();
+        keys.Sort();
+        for (int i = 0; i < attrNameTexts.Length; i++)
+        {
+            if (i < keys.Count)
+            {
+                var curValue = HorseManager.Instance.attrDic[keys[i]];
+                attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
+                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], 
+                    curValue - nextConfig.ClassAttrValueList[i] - nextConfig.PerLVAttrValueList[i], 2);
+                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
+            }
+        }
+
+        var nextKeys = HorseManager.Instance.specialAttrDic.Keys.ToList();
+        nextKeys.Sort();
+        for (int i = 0; i < specialAttrRect.Length; i++)
+        {
+            if (i < nextConfig.ClassSpecAttrIDList.Length)
+            {
+                specialAttrRect[i].SetActive(true);
+                var id = nextConfig.ClassSpecAttrIDList[i];
+                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(id).Name;
+                if (i < nextKeys.Count)
+                {
+                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 
+                        HorseManager.Instance.specialAttrDic[nextKeys[i]] - nextConfig.ClassSpecAttrValueList[i], 2);
+                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 
+                        HorseManager.Instance.specialAttrDic[nextKeys[i]], 2);
+                }
+                else
+                {
+                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 0);
+                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, nextConfig.ClassSpecAttrValueList[i], 2);
+                }
+            }
+            else
+            {
+                specialAttrRect[i].SetActive(false);
+            }
+        }
+
 
     }
 
diff --git a/Main/System/Horse/HorseWin.cs b/Main/System/Horse/HorseWin.cs
index 6146299..336e7fe 100644
--- a/Main/System/Horse/HorseWin.cs
+++ b/Main/System/Horse/HorseWin.cs
@@ -157,20 +157,33 @@
         keys.Sort();
         //婊$骇 鍜屼笅绾у睘鎬�
         var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV + 1);
-        var nextAttr = state == 1 ? nextConfig.ClassAttrValueList : (state == 0 ? config.PerLVAttrValueList : new int[config.AttrIDList.Length]);
         for (int i = 0; i < attrNameTexts.Length; i++)
         {
             if (i < keys.Count)
             {
                 attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
-                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]);
-                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextAttr[i]);
+                var curValue = HorseManager.Instance.attrDic[keys[i]];
+                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
+                var addValue = 0;
+                if (state == 0)
+                {
+                    addValue = config.PerLVAttrValueList[i];
+                }
+                else if (state == 1)
+                {
+                    addValue = nextConfig.ClassAttrValueList[i] + nextConfig.PerLVAttrValueList[i];
+                }
+
+                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue + addValue, 2);
             }
         }
     }
 
     string GetSpecialAttr()
     {
+        if (HorseManager.Instance.specialAttrDic.Count == 0)
+            return "";
+            
         List<string> attrList = new List<string>();
         foreach(var attrID in HorseManager.Instance.specialAttrDic.Keys)
         {
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 20b3bee..7414a96 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -503,7 +503,7 @@
         if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse))
         {
             horseBGImg.SetActive(true);
-            //equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦�  涓綅鏁板崄浣嶆暟锛堟渶澶ф敮鎸� 1~99锛�
+            //equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦紙鏈�澶ф敮鎸� 1~999锛�
             var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetHorseSkinID());
             horseImg.SetOrgSprite(skinConfig.Icon, "Horse");
             horseLVText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV);

--
Gitblit v1.8.0