少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-11 cdfc472ad6ab1baa880ff9f6f15c7e0d8493150d
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
 
namespace Snxxz.UI
{
    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 void ShowPopConfirm(string title, string info, Action<bool> func)
        {
            popConfirmTitle = title;
            popConfirmInfo = info;
            OnPopConfirmClickEvent = func;
            OnPopSingleConfirmEvent = null;
            IsSingleConfirm = false;
            if (!WindowCenter.Instance.CheckOpen<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.CheckOpen<PopConfirmWin>())
            {
                WindowCenter.Instance.Open<PopConfirmWin>();
            }
        }
        #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.CheckOpen<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.CheckOpen<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.CheckOpen<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.CheckOpen<ItemConfirmWin>())
            {
                WindowCenter.Instance.Open<ItemConfirmWin>();
            }
        }
        #endregion
    }
 
}