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 | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 025b3ef..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);
}
}
@@ -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