少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
using System;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
namespace vnxbqy.UI
{
    public class TeamFailEnterDungeonHandle : Singleton<TeamFailEnterDungeonHandle>
    {
        Dictionary<int, Action> tasks = new Dictionary<int, Action>();
        public TeamFailEnterDungeonHandle()
        {
            StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
        }
 
        private void OnStageLoadFinish()
        {
            foreach (var action in tasks.Values)
            {
                try
                {
                    action();
                }
                catch (Exception e)
                {
                    DebugEx.Log(e.StackTrace);
                }
            }
            tasks.Clear();
        }
 
        public void ReceiveReason(HB913_tagGCEnterTeamFBFailReason package)
        {
            switch (package.MapID)
            {
                case 31080:
                    HandleFairyLand(package.AskType, package.Reason);
                    break;
            }
        }
 
        public void HandleFairyLand(int type, int reason)
        {
            if (reason == 6)
            {
                HandleFairyLandLackTicket();
            }
        }
 
        void HandleFairyLandLackTicket()
        {
            var dayRemindKey = TeamDungeonTicketLackWin.GetDayRemindKey(TeamDungeonTicketLackWin.LackType.FairyLand);
            if (DayRemind.Instance.GetDayRemind(dayRemindKey))//设置了今日不再提醒
            {
                return;
            }
            if (NewBieCenter.Instance.inGuiding)//引导中不弹
            {
                return;
            }
            if (WindowCenter.Instance.IsOpen<TeamDungeonTicketLackWin>()
                || WindowCenter.Instance.IsOpen<ComposeWin>())
            {
                return;
            }
            if (!(StageLoad.Instance.currentStage is DungeonStage))
            {
                return;
            }
            var mapId = PlayerDatas.Instance.baseData.MapID;
            var mapConfig = MapConfig.Get(mapId);
            if (mapConfig == null || mapConfig.MapFBType != (int)MapType.OpenCountry)
            {
                return;
            }
            if (StageLoad.Instance.isLoading)
            {
                if (!tasks.ContainsKey(31080))
                {
                    tasks.Add(31080, RecheckFairyLandTicket);
                }
                return;
            }
            TeamDungeonTicketLackWin.lackType = TeamDungeonTicketLackWin.LackType.FairyLand;
            WindowCenter.Instance.Open<TeamDungeonTicketLackWin>();
        }
 
        void RecheckFairyLandTicket()
        {
            SnxxzGame.Instance.StartCoroutine(Co_Load());
        }
 
        IEnumerator Co_Load()
        {
            yield return WaitingForSecondConst.WaitMS500;
            HandleFairyLandLackTicket();
        }
    }
}