| | |
| | | public static Action<bool> OnToggleSingleConfirmEvent; |
| | | public static Action<bool, bool> OnToggleConfirmEventEx; |
| | | //带toggle的确认和取消 |
| | | 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; |
| | |
| | | OnToggleSingleConfirmEvent = null; |
| | | OnToggleConfirmEvent = func; |
| | | toggleOpenState = _toggle; |
| | | OKName = null; |
| | | OKName = okName; |
| | | CancelName = null; |
| | | if (!UIManager.Instance.IsOpened<ToggleConfirmWin>()) |
| | | { |
| | |
| | | } |
| | | |
| | | //本次登陆不再提示, 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]) |
| | | { |
| | |
| | | |
| | | public static string generalItemTip; |
| | | public static string generalItemTip2; |
| | | public static Action ItemConfirmEvent; |
| | | |
| | | public static int moneyType; |
| | | public static int moneyNeedCount; |
| | | |
| | | public static List<Item> getItems { get; private set; } |
| | | //多物品确认框 |
| | | public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, string info2, string btnText, Action func, int moneyCnt = 0, int type = 0) |
| | | 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; |
| | | ItemConfirmEvent = func; |
| | | OKName = btnText; |
| | | ItemConfirmEvent = func; |
| | | 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; |
| | | } |
| | | |
| | | 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; } |
| | | MoneyIconToggleConfirm(moneyCnt, _moneyType, fullTip, Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | func?.Invoke(); |
| | | toggleCheckDict[type] = isToggle; |
| | | } |
| | | |
| | | // 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 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 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, //白骨盈野 |
| | | } |
| | | |
| | | |