少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-04 d9e6e5aac14261fad5bd18053b600bd513b45509
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
using Snxxz.UI;
using System;
using System.Collections.Generic;
using System.Text;
using TableConfig;
using UnityEngine;
 
public class RichNormalEvent : TRichTextEvent
{
    public RichNormalEvent()
    {
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.APPLYFAIRY, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.INVITE, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.OPENUI, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.TIP, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.GetWay, this);
    }
 
    public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
    {
        switch (type)
        {
            case RichTextEventEnum.APPLYFAIRY:
                {
                    uint id = 0;
                    if (uint.TryParse(href.mSplits["applyfairy"], out id))
                    {
                        ModelCenter.Instance.GetModel<FairyModel>().SendApplyFairy(id);
                        return true;
                    }
                }
                break;
            case RichTextEventEnum.INVITE:
                {
                    uint id = 0;
                    if (uint.TryParse(href.mSplits["invite"], out id))
                    {
                        var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
                        if (teamModel.myTeam.GetIndexOfMember((int)id) != -1)
                        {
                            SysNotifyMgr.Instance.ShowTip("AlreadyInTeam");
                            return false;
                        }
                        if (teamModel.myTeam.inTeam)
                        {
                            ConfirmCancel.ShowPopConfirm(
                                "",
                                Language.Get("PlayerJoinTeam_1"),
                                (bool _ok) =>
                                {
                                    if (_ok)
                                    {
                                        teamModel.RequestExitTeam();
                                        teamModel.RequestApplyForJoin((int)id);
                                    }
                                }
                                );
                        }
                        else
                        {
                            teamModel.RequestApplyForJoin((int)id);
                        }
 
                    }
                }
                break;
            case RichTextEventEnum.OPENUI:
                {
                    int id = 0;
                    if (int.TryParse(href.mSplits["openui"], out id))
                    {
                        WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)id);
                    }
                }
                break;
            case RichTextEventEnum.TIP:
                {
                    var _key = href.mSplits["tip"];
                    SysNotifyMgr.Instance.ShowTip(_key);
                }
                break;
            case RichTextEventEnum.GetWay:
                {
                    int _id = 0;
                    int.TryParse(href.mSplits["getway"], out _id);
                    ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(_id, 0, true);
                    if (!WindowCenter.Instance.CheckOpen<GetWaysWin>())
                    {
                        WindowCenter.Instance.Open<GetWaysWin>();
                    }
                }
                break;
        }
        return false;
    }
 
    public override string GetDisplay(RichTextEventEnum type, Dictionary<string, string> dic)
    {
        return string.Empty;
    }
}