From 14ee0cae9be4ab59e9ab9aa095a0641c6185a95e Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 10 十一月 2025 18:56:33 +0800
Subject: [PATCH] 0312 代金券显示单位元,基金滚动动态调整
---
Main/Utility/UIHelper.cs | 8 ++++----
Main/System/BattlePass/BattlePassCommonWin.cs | 5 +++++
Main/System/ItemTip/OwnMoneyCell.cs | 9 ++++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/Main/System/BattlePass/BattlePassCommonWin.cs b/Main/System/BattlePass/BattlePassCommonWin.cs
index 1a80ab3..273c821 100644
--- a/Main/System/BattlePass/BattlePassCommonWin.cs
+++ b/Main/System/BattlePass/BattlePassCommonWin.cs
@@ -94,6 +94,7 @@
lockRect.SetActive(battlePassData.isActivite == 0);
scroller.m_Scorller.RefreshActiveCellViews();
+ var _rect = scroller.GetComponent<RectTransform>();
if (battlePassData.isActivite == 0)
{
rechargeRect.SetActive(true);
@@ -109,11 +110,15 @@
{
ItemTipUtility.Show(itemID);
});
+ _rect.sizeDelta = new Vector2(_rect.rect.width, 630);
}
else
{
rechargeRect.SetActive(false);
+ _rect.sizeDelta = new Vector2(_rect.rect.width, 757);
}
+
+
}
void ShowTotalValueStr()
diff --git a/Main/System/ItemTip/OwnMoneyCell.cs b/Main/System/ItemTip/OwnMoneyCell.cs
index afd95cc..0369a9b 100644
--- a/Main/System/ItemTip/OwnMoneyCell.cs
+++ b/Main/System/ItemTip/OwnMoneyCell.cs
@@ -64,7 +64,14 @@
// Debug.LogError("moneyType == 0");
return;
}
- numText.text = UIHelper.ReplaceLargeNum(UIHelper.GetMoneyCnt(moneyType));
+ double count = UIHelper.GetMoneyCnt(moneyType);
+ int decimalPlaces = 1;
+ if (moneyType == 99)
+ {
+ count = count / 100.0;
+ decimalPlaces = 2;
+ }
+ numText.text = UIHelper.ReplaceLargeNum(count, decimalPlaces);
if (resetIcon)
{
moneyIcon.SetIconWithMoneyType(moneyType);
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 8767f39..bb0b2ad 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -226,7 +226,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;
@@ -243,15 +243,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);
}
}
--
Gitblit v1.8.0