hch
3 天以前 0cfa0f146cdf71c802a63b1b854249f909372510
0312 统一频道枚举
7个文件已修改
97 ■■■■ 已修改文件
Main/System/Chat/ChatManager.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatPlayerMineCell.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatPlayerOtherCell.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatTabCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatWin.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Guild/GuildBaseWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/HomeWin.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatManager.cs
@@ -99,7 +99,7 @@
        if (!obj)
        {
            nowChatChannel = ChatChannel.World;
            nowChatTab = ChatTab.World;
            nowChatTab = ChatChannel.World;
            if (talkDict.ContainsKey(ChatChannel.Guild))
            {
                talkDict[ChatChannel.Guild].Clear();
@@ -117,7 +117,7 @@
        lastTalkDataDict.Clear();
        currentDayDict.Clear();
        nowChatChannel = ChatChannel.World;
        nowChatTab = ChatTab.World;
        nowChatTab = ChatChannel.World;
    }
    private void OnBeforePlayerDataInitializeEventOnRelogin()
@@ -415,7 +415,7 @@
            bool isOpen = GetBulletSetting(channelType);
            if (!isOpen)
                continue;
            if (channelType == ChatChannel.Guild && !IsTabOpen(ChatTab.Guild, false))
            if (channelType == ChatChannel.Guild && !IsTabOpen(ChatChannel.Guild, false))
                continue;
            if (data == null || talkData.TalkTime > data.TalkTime)
            {
@@ -598,8 +598,8 @@
    }
    #region 标签页
    // 当前展示的频道入口
    private ChatTab m_NowChatTab;
    public ChatTab nowChatTab
    private ChatChannel m_NowChatTab;
    public ChatChannel nowChatTab
    {
        get { return m_NowChatTab; }
        set
@@ -611,26 +611,26 @@
        }
    }
    public event Action<ChatTab> OnChatTabChangeEvent;
    public event Action<ChatChannel> OnChatTabChangeEvent;
    // 频道入口的展示顺序
    public readonly List<ChatTab> tabShowList = new List<ChatTab>()
    public readonly List<ChatChannel> tabShowList = new List<ChatChannel>()
    {
        ChatTab.World,
        ChatTab.Guild,
        ChatTab.CrossServer,
        ChatChannel.World,
        ChatChannel.Guild,
        ChatChannel.CrossServer,
        // ChatTab.Person,
        // ChatTab.BlackList,
    };
    public bool IsTabOpen(ChatTab chatTab, bool isTip = false)
    public bool IsTabOpen(ChatChannel chatTab, bool isTip = false)
    {
        if (!tabShowList.Contains(chatTab))
            return false;
        switch (chatTab)
        {
            case ChatTab.Guild:
            case ChatChannel.Guild:
                //没有公会
                if (!PlayerDatas.Instance.fairyData.HasFairy)
                {
@@ -639,7 +639,7 @@
                    return false;
                }
                return true;
            case ChatTab.CrossServer:
            case ChatChannel.CrossServer:
                //没有合服
                if (GuildManager.Instance.zoneID <= 0)
                {
@@ -653,22 +653,22 @@
        }
    }
    public bool IsSelectChatTab(ChatTab chatTab)
    public bool IsSelectChatTab(ChatChannel chatTab)
    {
        return nowChatTab == chatTab;
    }
    public bool IsValidChatTab(int chatTab)
    {
        return Enum.IsDefined(typeof(ChatTab), chatTab);
        return Enum.IsDefined(typeof(ChatChannel), chatTab);
    }
    public string GetChatTabName(ChatTab chatTab)
    public string GetChatTabName(ChatChannel chatTab)
    {
        return Language.Get(StringUtility.Concat("ChatTab", ((int)chatTab).ToString()));
    }
    public string GetChatTabSelectIcon(ChatTab chatTab, bool isSelect)
    public string GetChatTabSelectIcon(ChatChannel chatTab, bool isSelect)
    {
        return StringUtility.Concat(isSelect ? "ChatTabSelect" : "ChatTabUnSelect", ((int)chatTab).ToString());
    }
@@ -747,14 +747,7 @@
}
public enum ChatTab
{
    World = 0,      //世界
    Guild = 1,      //公会
    CrossServer = 2,    //跨服
    Person = 3,     //私聊
    BlackList = 4,  //黑名单
}
public enum ChatChannel
{
    World = 0,          //世界
Main/System/Chat/ChatPlayerMineCell.cs
@@ -25,17 +25,17 @@
                                                PlayerDatas.Instance.baseData.facePic));
        title.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
        if (manager.nowChatTab == ChatTab.World)
        if (manager.nowChatTab == ChatChannel.World)
        {
            string serverName = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
            m_PlayerName.text = Language.Get("Chat08", serverName, PlayerDatas.Instance.baseData.PlayerName);
        }
        else if (manager.nowChatTab == ChatTab.Guild)
        else if (manager.nowChatTab == ChatChannel.Guild)
        {
            int fmlv = PlayerDatas.Instance.fairyData.mine.FmLV;
            m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), PlayerDatas.Instance.baseData.PlayerName);
        }
        else if (manager.nowChatTab == ChatTab.CrossServer)
        else if (manager.nowChatTab == ChatChannel.CrossServer)
        {
            string serverName = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
            m_PlayerName.text = Language.Get("Chat08", serverName, PlayerDatas.Instance.baseData.PlayerName);
Main/System/Chat/ChatPlayerOtherCell.cs
@@ -27,12 +27,12 @@
        int bubbleID = ChatBubbleHelper.GetOtherChatBubbleID(data.Job, (int)data.BubbleBox);
        m_ChatBubble.DisplayBubble(bubbleID, (int)data.PlayerID);
        if (manager.nowChatTab == ChatTab.World)
        if (manager.nowChatTab == ChatChannel.World)
        {
            string serverName = ServerListCenter.Instance.GetServerName((int)data.ServerID);
            m_PlayerName.text = Language.Get("Chat08", serverName, data.Name);
        }
        else if (manager.nowChatTab == ChatTab.Guild)
        else if (manager.nowChatTab == ChatChannel.Guild)
        {
            FairyMember fairyMember = PlayerDatas.Instance.fairyData.GetMember((int)data.PlayerID);
            int fmlv = 0;
@@ -42,7 +42,7 @@
            }
            m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name);
        }
        else if (manager.nowChatTab == ChatTab.CrossServer)
        else if (manager.nowChatTab == ChatChannel.CrossServer)
        {
            string serverName = ServerListCenter.Instance.GetServerName((int)data.ServerID);
            m_PlayerName.text = Language.Get("Chat08", serverName, data.Name);
Main/System/Chat/ChatTabCell.cs
@@ -17,7 +17,7 @@
        int tab = cellView.info.Value.infoInt1;
        if (!manager.IsValidChatTab(tab))
            return;
        ChatTab chatTab = (ChatTab)tab;
        ChatChannel chatTab = (ChatChannel)tab;
        bool isSelect = manager.IsSelectChatTab(chatTab);
        imgSelectBg.SetActive(isSelect);
Main/System/Chat/ChatWin.cs
@@ -312,7 +312,7 @@
        }
    }
    private void OnChatTabChange(ChatTab entrance)
    private void OnChatTabChange(ChatChannel entrance)
    {
        CreaterAll(entrance);
    }
@@ -327,13 +327,13 @@
        RefreshAll(manager.nowChatChannel);
    }
    private void CreaterAll(ChatTab chatTab)
    private void CreaterAll(ChatChannel chatTab)
    {
        if (chatTab == ChatTab.World)
        if (chatTab == ChatChannel.World)
        {
            manager.nowChatChannel = ChatChannel.World;
        }
        else if (chatTab == ChatTab.Guild)
        else if (chatTab == ChatChannel.Guild)
        {
            manager.nowChatChannel = ChatChannel.Guild;
        }
@@ -342,34 +342,34 @@
        // 打开界面时默认到底部,无未读
        isJumpArea = true;
        scrWorld.lockType = EnhanceLockType.LockVerticalBottom; // 初始锁定底部
        scrWorld.SetActive(chatTab == ChatTab.World);
        scrWorld.SetActive(chatTab == ChatChannel.World);
        scrGuild.lockType = EnhanceLockType.LockVerticalBottom; // 初始锁定底部
        scrGuild.SetActive(chatTab == ChatTab.Guild);
        scrGuild.SetActive(chatTab == ChatChannel.Guild);
        scrCrossServer.lockType = EnhanceLockType.LockVerticalBottom; // 初始锁定底部
        scrCrossServer.SetActive(chatTab == ChatTab.CrossServer);
        scrCrossServer.SetActive(chatTab == ChatChannel.CrossServer);
        transInput.SetActive(true);
        serversBtn.SetActive(chatTab == ChatTab.CrossServer);
        serversBtn.SetActive(chatTab == ChatChannel.CrossServer);
        CreateChatTabScroller();
        switch (chatTab)
        {
            case ChatTab.World:
            case ChatChannel.World:
                manager.nowChatChannel = ChatChannel.World;
                CreateScroller(scrWorld, ChatChannel.World);
                ScrollerJump(scrWorld, ChatChannel.World);
                ClearUnreadMsg();
                break;
            case ChatTab.Guild:
            case ChatChannel.Guild:
                manager.nowChatChannel = ChatChannel.Guild;
                CreateScroller(scrGuild, ChatChannel.Guild);
                ScrollerJump(scrGuild, ChatChannel.Guild);
                ClearUnreadMsg();
                break;
            case ChatTab.CrossServer:
            case ChatChannel.CrossServer:
                manager.nowChatChannel = ChatChannel.CrossServer;
                CreateScroller(scrCrossServer, ChatChannel.CrossServer);
                ScrollerJump(scrCrossServer, ChatChannel.CrossServer);
@@ -440,11 +440,11 @@
            scroller.m_Scorller.RefreshActiveCellViews();
        }
        if (type == ChatChannel.World && manager.nowChatTab != ChatTab.World)
        if (type == ChatChannel.World && manager.nowChatTab != ChatChannel.World)
            return;
        if (type == ChatChannel.Guild && manager.nowChatTab != ChatTab.Guild)
        if (type == ChatChannel.Guild && manager.nowChatTab != ChatChannel.Guild)
            return;
        if (type == ChatChannel.CrossServer && manager.nowChatTab != ChatTab.CrossServer)
        if (type == ChatChannel.CrossServer && manager.nowChatTab != ChatChannel.CrossServer)
            return;
        // 1. 自己发送的消息 -> 强制跳转到底部 + 清零
        if (playerId == PlayerDatas.Instance.PlayerId)
Main/System/Guild/GuildBaseWin.cs
@@ -218,7 +218,7 @@
    public void OnClickTalkButton()
    {
        ChatManager.Instance.nowChatTab = ChatTab.Guild;
        ChatManager.Instance.nowChatTab = ChatChannel.Guild;
        ChatManager.Instance.nowChatChannel = ChatChannel.Guild;
        UIManager.Instance.OpenWindow<ChatWin>();
    }
Main/System/Main/HomeWin.cs
@@ -359,7 +359,7 @@
        bool hasLastTalkData = ChatManager.Instance.TryGetLastTalkData(out ChatChannel type, out TalkData data);
        if (!hasLastTalkData)
        {
            ChatManager.Instance.nowChatTab = ChatTab.World;
            ChatManager.Instance.nowChatTab = ChatChannel.World;
            ChatManager.Instance.nowChatChannel = ChatChannel.World;
        }
        else
@@ -368,15 +368,15 @@
            {
                case ChatChannel.World:
                default:
                    ChatManager.Instance.nowChatTab = ChatTab.World;
                    ChatManager.Instance.nowChatTab = ChatChannel.World;
                    ChatManager.Instance.nowChatChannel = ChatChannel.World;
                    break;
                case ChatChannel.Guild:
                    ChatManager.Instance.nowChatTab = ChatTab.Guild;
                    ChatManager.Instance.nowChatTab = ChatChannel.Guild;
                    ChatManager.Instance.nowChatChannel = ChatChannel.Guild;
                    break;
                case ChatChannel.CrossServer:
                    ChatManager.Instance.nowChatTab = ChatTab.CrossServer;
                    ChatManager.Instance.nowChatTab = ChatChannel.CrossServer;
                    ChatManager.Instance.nowChatChannel = ChatChannel.CrossServer;
                    break;
            }
@@ -439,7 +439,7 @@
        }
    }
    private void OnChatTabChangeEvent(ChatTab tab)
    private void OnChatTabChangeEvent(ChatChannel tab)
    {
        //UpdateChat(tab);
    }