少年修仙传客户端代码仓库
client_Hale
2018-09-21 c14ff3cca3524356bed6cd0a5e401a22eef186a0
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
4个文件已修改
103 ■■■■■ 已修改文件
System/Chat/ChatCtrl.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/FairyChatWin.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/TeamChatWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/DailyQuest/DailyQuestData.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatCtrl.cs
@@ -179,6 +179,9 @@
        DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent;
        StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
        DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += PlayerLoginOkEvent;
        InitChatRedpoints();
        FuncConfigConfig _cfg = Config.Instance.Get<FuncConfigConfig>("RandomWord");
        try
@@ -192,12 +195,20 @@
        }
    }
    private void PlayerLoginOkEvent()
    {
        UpdateRedpoint(ChatInfoType.Team);
        UpdateRedpoint(ChatInfoType.Fairy);
    }
    private void OnStageLoadFinish()
    {
        bool isDungeon = StageManager.Instance.CurrentStage is DungeonStage;
        if (!isDungeon)
        {
            ClearAllChatInfo();
            unReadChatCounts[ChatInfoType.Fairy] = 0;
            unReadChatCounts[ChatInfoType.Team] = 0;
        }
    }
@@ -430,6 +441,7 @@
    {
        ChatData chatData = new ChatFamilyData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
        KeepChatInfo(chatData);
        ReceiveNewChat(ChatInfoType.Fairy);
    }
    /// <summary>
    /// 好友私聊
@@ -494,6 +506,7 @@
    {
        ChatData chatData = new ChatTeamData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
        KeepChatInfo(chatData);
        ReceiveNewChat(ChatInfoType.Team);
    }
    /// <summary>
    /// GM
@@ -990,6 +1003,75 @@
        return string.Empty;
    }
    #endregion
    #region 仙缘红点
    Dictionary<ChatInfoType, Redpoint> chatSocialRedpoints = new Dictionary<ChatInfoType, Redpoint>();
    Dictionary<ChatInfoType, int> unReadChatCounts = new Dictionary<ChatInfoType, int>();
    public void InitChatRedpoints()
    {
        chatSocialRedpoints.Add(ChatInfoType.Fairy, new Redpoint(MainRedDot.RedPoint_FriendChatKey, 2502));
        chatSocialRedpoints.Add(ChatInfoType.Team, new Redpoint(MainRedDot.RedPoint_FriendChatKey, 2503));
        unReadChatCounts.Add(ChatInfoType.Fairy, 0);
        unReadChatCounts.Add(ChatInfoType.Team, 0);
    }
    public void ViewChat(ChatInfoType type)
    {
        if (unReadChatCounts.ContainsKey(type))
        {
            unReadChatCounts[type] = 0;
            UpdateRedpoint(type);
        }
    }
    void ReceiveNewChat(ChatInfoType type)
    {
        switch (type)
        {
            case ChatInfoType.Team:
                if (!WindowCenter.Instance.CheckOpen<TeamChatWin>())
                {
                    unReadChatCounts[ChatInfoType.Team] = Mathf.Min(unReadChatCounts[ChatInfoType.Team] + 1, 99);
                }
                break;
            case ChatInfoType.Fairy:
                if (!WindowCenter.Instance.CheckOpen<FairyChatWin>())
                {
                    unReadChatCounts[ChatInfoType.Fairy] = Mathf.Min(unReadChatCounts[ChatInfoType.Fairy] + 1, 99);
                }
                break;
        }
        UpdateRedpoint(type);
    }
    public void UpdateRedpoint(ChatInfoType type)
    {
        if (chatSocialRedpoints.ContainsKey(type))
        {
            var redpoint = chatSocialRedpoints[type];
            if (unReadChatCounts[type] > 0)
            {
                redpoint.state = RedPointState.Quantity;
                redpoint.count = unReadChatCounts[type];
            }
            else
            {
                redpoint.state = RedPointState.None;
            }
        }
        var socialRed = MainRedDot.Instance.redPointFriendChat;
        if (chatSocialRedpoints[ChatInfoType.Fairy].state == RedPointState.Quantity
            || chatSocialRedpoints[ChatInfoType.Team].state == RedPointState.Quantity)
        {
            socialRed.count = unReadChatCounts[ChatInfoType.Fairy] > 0 ?
                unReadChatCounts[ChatInfoType.Fairy] : unReadChatCounts[ChatInfoType.Team];
        }
        else
        {
            socialRed.count = 0;
        }
    }
    #endregion
}
public struct ChatExtraData
{
System/Chat/FairyChatWin.cs
@@ -18,6 +18,9 @@
        [SerializeField] ChatContentBehaviour m_ChatContent;
        [SerializeField] RectTransform m_ContainerNoFairy;
        [SerializeField] Button m_JoinFairy;
        ChatCenter chatCenter { get { return ModelCenter.Instance.GetModel<ChatCenter>(); } }
        #region Built-in
        protected override void BindController()
        {
@@ -36,6 +39,9 @@
            ChatCtrl.Inst.presentChatType = ChatInfoType.Fairy;
            m_ChatContent.chatType = ChatInfoType.Fairy;
            MyFairyRefresh();
            ChatCtrl.Inst.ViewChat(ChatInfoType.Fairy);
            ChatCtrl.Inst.lockUpdate = false;
            chatCenter.UpdateChatContentPos();
        }
        protected override void OnActived()
System/Chat/TeamChatWin.cs
@@ -17,6 +17,7 @@
        [SerializeField] ChatContentBehaviour m_ChatContent;
        [SerializeField] RectTransform m_NoTeamContainer;
        TeamModel team { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
        ChatCenter chatCenter { get { return ModelCenter.Instance.GetModel<ChatCenter>(); } }
        #region Built-in
        protected override void BindController()
        {
@@ -33,6 +34,9 @@
            ChatCtrl.Inst.presentChatType = ChatInfoType.Team;
            m_ChatContent.chatType = ChatInfoType.Team;
            MyTeamRefresh();
            ChatCtrl.Inst.ViewChat(ChatInfoType.Team);
            ChatCtrl.Inst.lockUpdate = false;
            chatCenter.UpdateChatContentPos();
        }
        protected override void OnActived()
System/DailyQuest/DailyQuestData.cs
@@ -152,6 +152,11 @@
            for (int i = 0; i < configs.Count; i++)
            {
                var config = configs[i];
                if (config.CanEnter == 0)
                {
                    continue;
                }
                if (config.StartWeekday == 0 && config.EndWeekday == 0)
                {
                    for (int j = 0; j < 7; j++)
@@ -188,6 +193,11 @@
        foreach (var config in configs)
        {
            if (config.CanEnter == 0)
            {
                continue;
            }
            var openDayWeek = config.OpenServerWeek % 7;
            if (!specialOpenTimes.ContainsKey(openDayWeek))
            {
@@ -205,7 +215,6 @@
            hourMinutes.Add(new HourMinute(config.StartHour, config.StartMinute, config.EndHour, config.EndMinute));
        }
    }
    public bool IsValidServerOpenTime()
    {