From 4b1247636bb04a0f0491537cb9853cd0b2101367 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 05 三月 2026 15:26:53 +0800
Subject: [PATCH] 348 功能预告-客户端 适配坊市表新增CostItemID
---
Main/Utility/UIHelper.cs | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 15927ac..b70810e 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -1275,6 +1275,34 @@
return isEnough;
}
+ /// <param name="needTips">0 涓嶅搷搴� 1 寮规彁绀� 2 寮硅幏鍙栭�斿緞tips</param>
+ public static bool CheckItemCount(int itemId, long needCount, int needTips = 0)
+ {
+ if (needCount <= 0)
+ {
+ return true;
+ }
+ long haveCount = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
+ bool isEnough = haveCount >= needCount;
+
+ if (!isEnough)
+ {
+ if (needTips == 1)
+ {
+ ItemConfig itemConfig = ItemConfig.Get(itemId);
+ if (itemConfig != null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LackItem", itemConfig.ItemName);
+ }
+ }
+ else if (needTips == 2)
+ {
+ ItemTipUtility.Show(itemId, true);
+ }
+ }
+
+ return isEnough;
+ }
#endregion
--
Gitblit v1.8.0