少年修仙传客户端代码仓库
client_linchunjie
2018-08-20 5e5551e8e7630f816a68c7bbe554a7e0bfa8705f
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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Snxxz.UI
{
    public class ServerTipDetails
    {
        #region 跑马灯
        public static bool OnTweening = false;
        private static List<SystemHintData> m_Marquees = new List<SystemHintData>();
        public static void ShowMarquee(string msg, ArrayList info, int _order, int loopCnt = 1)
        {
            m_Marquees.Add(new SystemHintData()
            {
                appendTime = DateTime.Now,
                message = msg,
                extentionData = info == null ? info : new ArrayList(info),
                order = _order
            });
 
            m_Marquees.Sort(SysNotifyMgr.Instance.Compare);
 
            if (!WindowCenter.Instance.CheckOpen<MarqueeWin>())
            {
                WindowCenter.Instance.Open<MarqueeWin>();
            }
        }
 
        public static SystemHintData RequireMarquee()
        {
            if (m_Marquees.Count > 0)
            {
                var _hint = m_Marquees[0];
                m_Marquees.RemoveAt(0);
                return _hint;
            }
            return null;
        }
 
        #endregion
 
        #region 固定全服消息
        private static List<SystemHintData> hintTips = new List<SystemHintData>();
 
        public static void ShowServerTip(string msg, ArrayList info, int order)
        {
            hintTips.Add(new SystemHintData()
            {
                message = msg,
                order = order,
                extentionData = info == null ? info : new ArrayList(info),
                appendTime = DateTime.Now,
            });
 
            hintTips.Sort(SysNotifyMgr.Instance.Compare);
 
            MessageWin.Inst.ShowServerTip();
        }
 
        public static SystemHintData RequireServerTip()
        {
            if (hintTips.Count > 0)
            {
                var _hint = hintTips[0];
                hintTips.RemoveAt(0);
                return _hint;
            }
            return null;
        }
        #endregion
 
        public static void ClearHint()
        {
            hintTips.Clear();
            m_Marquees.Clear();
            queueTrumpetTips.Clear();
        }
 
        #region 喇叭信息
        private static Queue<ChatTrumpetData> queueTrumpetTips = new Queue<ChatTrumpetData>();
        public static void ShowTrumpetTip(ChatTrumpetData trumpetData)
        {
            queueTrumpetTips.Enqueue(trumpetData);
            if (!WindowCenter.Instance.CheckOpen<TrumpetWin>())
            {
                WindowCenter.Instance.Open<TrumpetWin>();
            }
        }
        public static ChatTrumpetData RequireTrumpetTip()
        {
            if (queueTrumpetTips.Count > 0)
            {
                return queueTrumpetTips.Dequeue();
            }
            return null;
        }
        public static int GetTrumpetSurplusCnt()
        {
            return queueTrumpetTips.Count;
        }
        #endregion
    }
}