少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
 
namespace Snxxz.UI
{
    [XLua.LuaCallCSharp]
    public class ConfirmCancel
    {
        public static Action<bool> OnPopConfirmClickEvent;
        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 void ShowPopConfirm(string title, string info, Action<bool> func)
        {
            popConfirmTitle = title;
            popConfirmInfo = info;
            OnPopConfirmClickEvent = func;
            OnPopSingleConfirmEvent = null;
            IsSingleConfirm = false;
            if (!WindowCenter.Instance.IsOpen<PopConfirmWin>())
            {
                WindowCenter.Instance.Open<PopConfirmWin>();
            }
        }
 
        public static void ShowPopConfirm(string title, string info, Action func = null)
        {
            popConfirmTitle = title;
            popConfirmInfo = info;
            OnPopConfirmClickEvent = null;
            OnPopSingleConfirmEvent = func;
            IsSingleConfirm = true;
            if (!WindowCenter.Instance.IsOpen<PopConfirmWin>())
            {
                WindowCenter.Instance.Open<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 (!WindowCenter.Instance.IsOpen<RealmPopConfirmWin>())
            {
                WindowCenter.Instance.Open<RealmPopConfirmWin>();
            }
        }
 
        public static void ShowRuneTowerPopConfirm(string title, string info, Action<bool> func)
        {
            popConfirmTitle = title;
            popConfirmInfo = info;
            OnPopConfirmClickEvent = func;
            OnPopSingleConfirmEvent = null;
            IsSingleConfirm = false;
            WindowCenter.Instance.Open<RuneTowerConfirmWin>();
        }
 
        #region 带toggle的确认取消
        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 void ToggleConfirmCancel(string title, string content, string toggleTxt, Action<bool, bool> func, bool _toggle = false)
        {
            generalTitle = title;
            generalContent = content;
            toggleContent = toggleTxt;
            OnToggleConfirmEvent = func;
            toggleOpenState = _toggle;
            if (!WindowCenter.Instance.IsOpen<ToggleConfirmWin>())
            {
                WindowCenter.Instance.Open<ToggleConfirmWin>();
            }
        }
        #endregion
 
        #region 带图标的确认取消
        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 (!WindowCenter.Instance.IsOpen<IconConfirmWin>())
            {
                WindowCenter.Instance.Open<IconConfirmWin>();
            }
        }
 
        #endregion
 
        #region 仙盟联赛战场引导
        public static Action<bool> OnFairyLeagueGuideEvent;
        public static void ShowFairyLeagueGuide(Action<bool> func = null)
        {
            OnFairyLeagueGuideEvent = func;
            if (!WindowCenter.Instance.IsOpen<FairyLeagueGuideSelectWin>())
            {
                WindowCenter.Instance.Open<FairyLeagueGuideSelectWin>();
            }
        }
        #endregion
 
        #region 带物品的确认弹框
        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 (!WindowCenter.Instance.IsOpen<ItemConfirmWin>())
            {
                WindowCenter.Instance.Open<ItemConfirmWin>();
            }
        }
        #endregion
    }
 
}