From 09bc892c7283df8757a07b646d5af21ddaa263d1 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 06 十一月 2025 18:22:34 +0800
Subject: [PATCH] 164 天子的考验-客户端
---
Main/System/Tip/ConfirmCancel.cs | 164 ++++++++++++++++++++++++++++++++----------------------
1 files changed, 96 insertions(+), 68 deletions(-)
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index 2822c2c..6fa1683 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -123,7 +123,7 @@
public static Action<bool> OnToggleSingleConfirmEvent;
public static Action<bool, bool> OnToggleConfirmEventEx;
//甯oggle鐨勭‘璁ゅ拰鍙栨秷
- public static void ToggleConfirmCancel(string title, string content, string toggleTxt, Action<bool, bool> func, bool _toggle = false)
+ public static void ToggleConfirmCancel(string title, string content, string toggleTxt, Action<bool, bool> func, string okName = "", bool _toggle = false)
{
generalTitle = title;
generalContent = content;
@@ -131,7 +131,7 @@
OnToggleSingleConfirmEvent = null;
OnToggleConfirmEvent = func;
toggleOpenState = _toggle;
- OKName = null;
+ OKName = okName;
CancelName = null;
if (!UIManager.Instance.IsOpened<ToggleConfirmWin>())
{
@@ -192,13 +192,10 @@
}
//鏈鐧婚檰涓嶅啀鎻愮ず, toggle鐨勭‘璁ょ被鍨嬶紝鏂逛究澶栭儴璋冪敤
- static Dictionary<int, bool> toggleCheckDict = new Dictionary<int, bool>();
- public enum ToggleCheckType
- {
- Auction = 0, //鎷嶅崠琛�
- }
+ public static Dictionary<ToggleCheckType, bool> toggleCheckDict = new Dictionary<ToggleCheckType, bool>();
- public static void ToggleConfirmCancelByType(int type, string fullTip, Action func)
+
+ public static void ToggleConfirmCancelByType(ToggleCheckType type, string fullTip, Action func)
{
if (toggleCheckDict.ContainsKey(type) && toggleCheckDict[type])
{
@@ -257,72 +254,103 @@
// }
// }
- // public static string generalItemTip;
- // public static int generalItemId;
- // public static int generalItemCnt;
- // public static Action ItemConfirmEvent;
- // public static void ShowItemConfirm(string info, int _itemId, int _itemCnt, Action func)
- // {
- // generalItemTip = info;
- // generalItemId = _itemId;
- // generalItemCnt = _itemCnt;
- // ItemConfirmEvent = func;
- // if (!UIManager.Instance.IsOpened<ItemConfirmWin>())
- // {
- // UIManager.Instance.OpenWindow<ItemConfirmWin>();
- // }
- // }
+ public static string generalItemTip;
+ public static string generalItemTip2;
- // public static List<Item> getItems { get; private set; }
- // //澶氱墿鍝佺‘璁ゆ
- // public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, string btnText, Action func, int moneyCnt = 0, int type = 0)
- // {
- // getItems = items;
- // generalTitle = tiltle;
- // generalItemTip = info;
- // ItemConfirmEvent = func;
- // OKName = btnText;
- // ItemConfirmEvent = func;
- // moneyType = type;
- // moneyNeedCount = moneyCnt;
- // if (!UIManager.Instance.IsOpened<ItemsConfirmWin>())
- // {
- // UIManager.Instance.OpenWindow<ItemsConfirmWin>();
- // }
- // }
+ public static int moneyType;
+ public static int moneyNeedCount;
+
+ public static List<Item> getItems { get; private set; }
+ public static string replaceItemName;
+ /// <summary>
+ /// 澶氱墿鍝佺‘璁ゆ
+ /// </summary>
+ /// <param name="items"></param>
+ /// <param name="tiltle"></param>
+ /// <param name="info"></param>
+ /// <param name="func"></param>
+ /// <param name="info2"></param>
+ /// <param name="btnText">涓虹┖鏃堕粯璁ゆ樉绀虹‘瀹氭枃瀛�</param>
+ /// <param name="moneyCnt"></param>
+ /// <param name="type"></param>
+ public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func,
+ string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0, string itemName = "")
+ {
+ getItems = items;
+ generalTitle = tiltle;
+ generalItemTip = info;
+ generalItemTip2 = info2;
+ OKName = btnText;
+ OnPopConfirmClickEvent = func;
+ moneyType = type;
+ moneyNeedCount = moneyCnt;
+ replaceItemName = itemName;
+ if (!UIManager.Instance.IsOpened<ItemsConfirmWin>())
+ {
+ UIManager.Instance.OpenWindow<ItemsConfirmWin>();
+ }
+ }
+
+
+ public static void MoneyIconToggleConfirmByType(ToggleCheckType type, int moneyCnt, int _moneyType, string fullTip, Action func)
+ {
+ if (toggleCheckDict.ContainsKey(type) && toggleCheckDict[type])
+ {
+ func?.Invoke();
+ return;
+ }
+
+ MoneyIconToggleConfirm(moneyCnt, _moneyType, fullTip, Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
+ {
+ if (isOk)
+ {
+ func?.Invoke();
+ toggleCheckDict[type] = isToggle;
+ }
+
+ });
+ }
- // public static string moneyTitle;
- // public static string moneyTopInfo;
- // public static string moneybtnOkText;
- // public static int moneyType;
- // public static int moneyNeedCount;
- // public static ulong moneyHaveCount;
- // public static string moneyToggleText { get; private set; }
- // public static bool moneytoggleOpen { get; private set; }
- // public static bool moneytoggleOpenState { get; private set; }
+ //璐у竵纭妗�:鏈夋樉绀哄嬀閫夌殑
+ public static Action<bool, bool> OnMoneyToggleConfirmAct;
+ public static void MoneyIconToggleConfirm(int moneyCnt, int _moneyType, string content, string toggleTxt, Action<bool, bool> func, bool _toggle = false)
+ {
+ generalContent = content;
+ toggleContent = toggleTxt;
+ OnToggleConfirmEvent = func;
+ toggleOpenState = _toggle;
+ moneyType = _moneyType;
+ moneyNeedCount = moneyCnt;
+ if (!UIManager.Instance.IsOpened<MoneyIconToggleConfirmWin>())
+ {
+ UIManager.Instance.OpenWindow<MoneyIconToggleConfirmWin>();
+ }
+ }
- // public static Action<bool, bool> OnMoneyToggleConfirmAct;
- // public static void MoneyIconToggleConfirm(string title, string topInfo,string okTxt, int type,
- // int needCnt, ulong haveCnt, Action<bool, bool> func, bool toggleOpen = false, string toggleTxt = "", bool toggleOpenState = false)
- // {
- // moneyTitle = title;
- // moneyTopInfo = topInfo;
- // moneybtnOkText = okTxt;
- // moneyType = type;
- // moneyNeedCount = needCnt;
- // moneyHaveCount = haveCnt;
- // moneyToggleText = toggleTxt;
- // moneytoggleOpen = toggleOpen;
- // moneytoggleOpenState = toggleOpenState;
- // OnMoneyToggleConfirmAct = func;
- // if (!UIManager.Instance.IsOpened<MoneyIconToggleConfirmWin>())
- // {
- // UIManager.Instance.OpenWindow<MoneyIconToggleConfirmWin>();
- // }
- // }
+ //璐у竵纭妗�:涓嶆樉绀哄嬀閫夌殑
+ public static void MoneyIconConfirm(int moneyCnt, int _moneyType, string content, Action<bool, bool> func)
+ {
+ generalContent = content;
+ OnToggleConfirmEvent = func;
+ moneyType = _moneyType;
+ moneyNeedCount = moneyCnt;
+ if (!UIManager.Instance.IsOpened<MoneyIconToggleConfirmWin>())
+ {
+ UIManager.Instance.OpenWindow<MoneyIconToggleConfirmWin>();
+ }
+ }
+
+}
+
+public enum ToggleCheckType
+{
+ Auction = 0, //鎷嶅崠琛�
+ WashCancel = 1, //娲楃粌鍙栨秷
+ GoldRush = 2, //娣橀噾
+ BoneField = 3, //鐧介鐩堥噹
}
--
Gitblit v1.8.0