From ed98029a88cd89702980ac7c40b711afddc5aeb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 14:44:59 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts

---
 Main/Utility/UIHelper.cs |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 21ee7a0..2cd0ea7 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -66,6 +66,8 @@
 
 
     #region UI閫氱敤
+
+    //榛樿璐у竵鍥剧墖鐢ㄩ珮娓呯殑锛屽瘜鏂囨湰鐨勫彲浠ョ敤灏忓浘鏍囧埄浜庢帓鐗堟樉绀�
     public static void SetIconWithMoneyType(this Image _image, int moneyType)
     {
         if (_image == null) return;
@@ -97,6 +99,20 @@
         {
             Debug.LogError("MoneyDisplayModel 鏈厤缃揣甯佺被鍨嬶細" + moneyType);
             return "";
+        }
+    }
+
+    // 閫氳繃璐у竵绫诲瀷鑾峰彇鐗╁搧ID
+    public static int GetItemIDWithMoneyType(int moneyType)
+    {
+        if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
+        {
+            return GeneralDefine.MoneyDisplayModel[moneyType];
+        }
+        else
+        {
+            Debug.LogError("MoneyDisplayModel 鏈厤缃揣甯佺被鍨嬶細" + moneyType);
+            return 0;
         }
     }
 
@@ -212,7 +228,7 @@
     /// 澶ф暟鍊艰浆鍖� 鏍煎紡 鏈�澶氫袱涓皬鏁� ,鍚戜笅鍙栨暣
     /// K -鍗冿紝M -鐧捐惉锛孊-鍗佸剟锛孴 -钀剟
     /// </summary>
-    public static string ReplaceLargeNum(double num)
+    public static string ReplaceLargeNum(double num, int decimalPlaces = 1)
     {
         const long K = 10000;    //鍥藉唴涓轰竾锛屾捣澶栦负鍗�
         const long M = K * 10000;
@@ -229,15 +245,15 @@
         }
         else if (num >= M)
         {
-            return StringUtility.Contact(FormatWithoutRounding(num / M, 1), Language.Get("L1070"));
+            return StringUtility.Contact(FormatWithoutRounding(num / M, decimalPlaces), Language.Get("L1070"));
         }
         else if (num >= K)
         {
-            return StringUtility.Contact(FormatWithoutRounding(num / K, 1), Language.Get("L1071"));
+            return StringUtility.Contact(FormatWithoutRounding(num / K, decimalPlaces), Language.Get("L1071"));
         }
         else
         {
-            return FormatWithoutRounding(num, 1);
+            return FormatWithoutRounding(num, decimalPlaces);
         }
     }
 
@@ -1156,7 +1172,7 @@
     }
 
     //鏄剧ず鏁伴噺, 鏍煎紡n/m, 瓒冲缁胯壊涓嶈冻绾㈣壊
-    public static string ShowUseMoney(int moneyType, long useCnt, bool showLargeNum = true)
+    public static string ShowUseMoney(int moneyType, long useCnt, bool showLargeNum = false)
     {
         long cnt = GetMoneyCnt(moneyType);
         if (showLargeNum)
@@ -1165,7 +1181,7 @@
             return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{cnt}/{useCnt}");
     }
 
-    public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = true)
+    public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = false)
     {
         long cnt = PackManager.Instance.GetItemCountByID(type, itemId);
         if (showLargeNum)
@@ -1294,7 +1310,7 @@
         //bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$");
         //var chsCount = GetChsCount(name);
         int length = Encoding.Default.GetBytes(name).Length;
-        var maxlength = 14;  //绾腑鏂囦笉寤鸿瓒呰繃7涓瓧
+        var maxlength = 21;  //绾腑鏂囦笉寤鸿瓒呰繃7涓瓧
         var minlength = 3;
         if (length > maxlength)
         {

--
Gitblit v1.8.0