yyl
23 小时以前 5d3366f2e0f687995eb7ad2107c4379fe7acd4e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
 
public class ConfirmCancel
{
    public static Action<bool> OnPopConfirmClickEvent;
    public static Action<bool> OnPopConfirmClickExEvent;
    public static Action OnPopSingleConfirmEvent;
    public static string popConfirmTitle { get; private set; }
    public static string popConfirmInfo { get; private set; }
    public static bool IsSingleConfirm { get; private set; }
    public static string OKName { get; private set; }
    public static string CancelName { get; private set; }
 
    //取消/确认弹框
    public static void ShowPopConfirm(string title, string info, Action<bool> func)
    {
        popConfirmTitle = title;
        popConfirmInfo = info;
        OnPopConfirmClickEvent = func;
        OnPopSingleConfirmEvent = null;
        IsSingleConfirm = false;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<PopConfirmWin>())
        {
            UIManager.Instance.OpenWindow<PopConfirmWin>();
        }
    }
 
    //取消/确认弹框 func1对应确认按钮旁边的取消按钮 func2对应右上角的圆形取消按钮
    public static void ShowPopConfirmEx(string title, string info, Action<bool> func1, Action<bool> func2)
    {
        popConfirmTitle = title;
        popConfirmInfo = info;
        OnPopConfirmClickEvent = func1;
        OnPopSingleConfirmEvent = null;
        OnPopConfirmClickExEvent = func2;
        IsSingleConfirm = false;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<PopConfirmWin>())
        {
            UIManager.Instance.OpenWindow<PopConfirmWin>();
        }
    }
 
    //单按钮确认框
    public static void ShowPopConfirm(string title, string info, Action func = null)
    {
        popConfirmTitle = title;
        popConfirmInfo = info;
        OnPopConfirmClickEvent = null;
        OnPopSingleConfirmEvent = func;
        IsSingleConfirm = true;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<PopConfirmWin>())
        {
            UIManager.Instance.OpenWindow<PopConfirmWin>();
        }
    }
 
    //带两个按钮的确认框 可改变按钮文字
    public static void ShowPopConfirm(string title, string info, string okName, string cancelName, Action<bool> func)
    {
        popConfirmTitle = title;
        popConfirmInfo = info;
        OnPopConfirmClickEvent = func;
        OnPopSingleConfirmEvent = null;
        IsSingleConfirm = false;
        OKName = okName;
        CancelName = cancelName;
        if (!UIManager.Instance.IsOpened<PopConfirmWin>())
        {
            UIManager.Instance.OpenWindow<PopConfirmWin>();
        }
    }
 
    // //可改变确认按钮文字的单按钮确认框,(命名与境界无关)
    // public static void ShowRealmPopConfirm(string title, string info, string okName, Action func = null)
    // {
    //     popConfirmTitle = title;
    //     popConfirmInfo = info;
    //     OKName = okName;
    //     OnPopConfirmClickEvent = null;
    //     OnPopSingleConfirmEvent = func;
    //     IsSingleConfirm = true;
    //     if (!UIManager.Instance.IsOpened<RealmPopConfirmWin>())
    //     {
    //         UIManager.Instance.OpenWindow<RealmPopConfirmWin>();
    //     }
    // }
 
    // public static void ShowRuneTowerPopConfirm(string title, string info, Action<bool> func)
    // {
    //     popConfirmTitle = title;
    //     popConfirmInfo = info;
    //     OnPopConfirmClickEvent = func;
    //     OnPopSingleConfirmEvent = null;
    //     IsSingleConfirm = false;
    //     UIManager.Instance.OpenWindow<RuneTowerConfirmWin>();
    // }
 
 
    // public static void CancelAuctionPopConfirm(string title, string info, Action<bool> func)
    // {
    //     popConfirmTitle = title;
    //     popConfirmInfo = info;
    //     OnPopConfirmClickEvent = func;
    //     OnPopSingleConfirmEvent = null;
    //     IsSingleConfirm = false;
    //     UIManager.Instance.OpenWindow<CancelAuctionConfirmWin>();
    // }
 
    public static string generalTitle;
    public static string generalContent;
    public static string toggleContent { get; private set; }
    public static bool toggleOpenState { get; private set; }
    public static Action<bool, bool> OnToggleConfirmEvent;
    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)
    {
        generalTitle = title;
        generalContent = content;
        toggleContent = toggleTxt;
        OnToggleSingleConfirmEvent = null;
        OnToggleConfirmEvent = func;
        toggleOpenState = _toggle;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<ToggleConfirmWin>())
        {
            UIManager.Instance.OpenWindow<ToggleConfirmWin>();
        }
    }
 
    //带toggle的只有确认按钮
    public static void ToggleConfirmCancel(string title, string content, string toggleTxt, Action<bool> func, bool _toggle = false)
    {
        generalTitle = title;
        generalContent = content;
        toggleContent = toggleTxt;
        OnToggleConfirmEvent = null;
        OnToggleSingleConfirmEvent = func;
        toggleOpenState = _toggle;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<ToggleConfirmWin>())
        {
            UIManager.Instance.OpenWindow<ToggleConfirmWin>();
        }
    }
 
    //带toggle的确认和取消 右上角圆形关闭按钮也有回调函数
    public static void ToggleConfirmCancelEx(string title, string content, string toggleTxt, Action<bool, bool> func, Action<bool, bool> func1, bool _toggle = false)
    {
        generalTitle = title;
        generalContent = content;
        toggleContent = toggleTxt;
        OnToggleSingleConfirmEvent = null;
        OnToggleConfirmEvent = func;
        OnToggleConfirmEventEx = func1;
        toggleOpenState = _toggle;
        OKName = null;
        CancelName = null;
        if (!UIManager.Instance.IsOpened<ToggleConfirmWin>())
        {
            UIManager.Instance.OpenWindow<ToggleConfirmWin>();
        }
    }
 
    //带toggle的确定和取消按钮,且可以改变按钮文字
    public static void ToggleConfirmCancel(string title, string content, string toggleTxt, string okName, string cancelName, Action<bool, bool> func, bool _toggle = false)
    {
        generalTitle = title;
        generalContent = content;
        toggleContent = toggleTxt;
        OnToggleSingleConfirmEvent = null;
        OnToggleConfirmEvent = func;
        toggleOpenState = _toggle;
        OKName = okName;
        CancelName = cancelName;
        if (!UIManager.Instance.IsOpened<ToggleConfirmWin>())
        {
            UIManager.Instance.OpenWindow<ToggleConfirmWin>();
        }
    }
 
    //本次登陆不再提示, toggle的确认类型,方便外部调用
    static Dictionary<int, bool> toggleCheckDict = new Dictionary<int, bool>();
    public enum ToggleCheckType
    {
        Auction = 0, //拍卖行
    }
 
    public static void ToggleConfirmCancelByType(int type, string fullTip, Action func)
    {
        if (toggleCheckDict.ContainsKey(type) && toggleCheckDict[type])
        {
            func?.Invoke();
            return;
        }
 
        ToggleConfirmCancel(Language.Get("Mail101"), fullTip,
            Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
            {
                if (isOk)
                {
                    func?.Invoke();
                    toggleCheckDict[type] = isToggle;
                }
 
            });
    }
 
 
 
 
    // public static string iconTitle;
    // public static string iconTopInfo;
    // public static string iconBottomInfo;
    // public static int iconItemId;
    // public static int iconNeedCnt;
    // public static int iconHaveCnt;
    // public static string iconToggleText { get; private set; }
    // public static Action<bool, bool> OnIconToggleConfirmAct;
    // public static void IconConfirmCancel(string title, string topInfo, int id,
    //   int haveCnt, int needCnt, string bottomInfo, string toggleTxt, Action<bool, bool> func)
    // {
    //     iconTitle = title;
    //     iconTopInfo = topInfo;
    //     iconBottomInfo = bottomInfo;
    //     iconItemId = id;
    //     iconHaveCnt = haveCnt;
    //     iconNeedCnt = needCnt;
    //     iconToggleText = toggleTxt;
    //     OnIconToggleConfirmAct = func;
    //     if (!UIManager.Instance.IsOpened<IconConfirmWin>())
    //     {
    //         UIManager.Instance.OpenWindow<IconConfirmWin>();
    //     }
    // }
 
 
    // public static Action<bool> OnFairyLeagueGuideEvent;
    // public static void ShowFairyLeagueGuide(Action<bool> func = null)
    // {
    //     OnFairyLeagueGuideEvent = func;
    //     if (!UIManager.Instance.IsOpened<FairyLeagueGuideSelectWin>())
    //     {
    //         UIManager.Instance.OpenWindow<FairyLeagueGuideSelectWin>();
    //     }
    // }
 
    // 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 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 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(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>();
    //     }
    // }
 
}