Esempio n. 1
0
 public override void Update()
 {
     if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG) != null)
     {
         return;
     }
     for (int i = 0; i < 7; i++)
     {
         if (0 < this._Manager.GetChatMsgCount())
         {
             MainChatMsg mainChatMsg = this._Manager.ChatMsgDequeue();
             if (string.Empty == mainChatMsg.color)
             {
                 mainChatMsg.color = ChatManager.GetChatColorKey(mainChatMsg.type);
             }
             ChatLabel chatLable = this.GetChatLable(mainChatMsg.type);
             if (null != chatLable)
             {
                 chatLable.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
             }
             this._clChatAll.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
         }
     }
     if (0 < this._Manager.GetCharChatCount())
     {
         CharChat charChat = this._Manager.CharChatDequeue();
         if (charChat.Character != null)
         {
             charChat.Character.MakeChatText(charChat.msg, true);
         }
     }
 }
Esempio n. 2
0
    public override void Update()
    {
        if (this.IsChatFocused() != this.bOldTextFieldFocus)
        {
            this.bOldTextFieldFocus = this.IsChatFocused();
        }
        if (0 < this._Manager.GetChatMsgCount())
        {
            MainChatMsg mainChatMsg = this._Manager.ChatMsgDequeue();
            if (string.Empty == mainChatMsg.color)
            {
                mainChatMsg.color = ChatManager.GetChatColorKey(mainChatMsg.type);
            }
            this._clChat.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
            if (mainChatMsg.type == CHAT_TYPE.GUILD)
            {
                this._clChatGuild.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
            }
            if (this.m_MainChat != null)
            {
                ChatLabel chatLable = this.m_MainChat.GetChatLable(CHAT_TYPE.ALL);
                if (chatLable != null)
                {
                    chatLable.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
                }
            }
            TournamentLobbyDlg tournamentLobbyDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOURNAMENT_LOBBY_DLG) as TournamentLobbyDlg;

            if (tournamentLobbyDlg != null)
            {
                ChatLabel chatLable2 = tournamentLobbyDlg.GetChatLable(CHAT_TYPE.ALL);
                if (chatLable2 != null)
                {
                    chatLable2.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
                }
            }
        }
        if (0 < this._Manager.GetCharChatCount())
        {
            CharChat charChat = this._Manager.CharChatDequeue();
            if (charChat.Character != null)
            {
                charChat.Character.MakeChatText(charChat.msg, true);
            }
        }
    }
Esempio n. 3
0
 public override void Update()
 {
     if (Input.imeIsSelected != this.bLanguage)
     {
         this.bLanguage = Input.imeIsSelected;
         this._dtChatLag.SetTexture((!this.bLanguage) ? "Main_I_ChatEng" : "Main_I_ChatHan");
     }
     if (this.IsChatFocused() != this.bOldTextFieldFocus)
     {
         this.bOldTextFieldFocus = this.IsChatFocused();
     }
     for (int i = 0; i < 7; i++)
     {
         if (0 < this._Manager.GetChatMsgCount())
         {
             MainChatMsg mainChatMsg = this._Manager.ChatMsgDequeue();
             if (string.Empty == mainChatMsg.color)
             {
                 mainChatMsg.color = ChatManager.GetChatColorKey(mainChatMsg.type);
             }
             ChatLabel chatLable = this.GetChatLable(mainChatMsg.type);
             if (null != chatLable)
             {
                 chatLable.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
             }
             this._clChatAll.PushText(mainChatMsg.name, mainChatMsg.msg, mainChatMsg.color, mainChatMsg.linkItem);
         }
     }
     if (0 < this._Manager.GetCharChatCount())
     {
         CharChat charChat = this._Manager.CharChatDequeue();
         if (charChat.Character != null)
         {
             charChat.Character.MakeChatText(charChat.msg, true);
         }
     }
 }
Esempio n. 4
0
    public bool ProcessClientCommand(string chattext, ref ChatLabel pkTargetLable)
    {
        if (chattext.Contains("/ani") && chattext.Length == 10)
        {
            int        id        = int.Parse(chattext.Substring(5, 2));
            int        animation = int.Parse(chattext.Substring(8, 2));
            NrCharBase @char     = NrTSingleton <NkCharManager> .Instance.GetChar(id);

            if (@char != null)
            {
                @char.SetAnimation((eCharAnimationType)animation);
                return(true);
            }
        }
        if (chattext.Contains("/objcount"))
        {
            string text = string.Empty;
            text = "All = " + Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "Textures = " + Resources.FindObjectsOfTypeAll(typeof(Texture)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "AudioClips = " + Resources.FindObjectsOfTypeAll(typeof(AudioClip)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "Meshes = " + Resources.FindObjectsOfTypeAll(typeof(Mesh)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "Materials = " + Resources.FindObjectsOfTypeAll(typeof(Material)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "GameObjects = " + Resources.FindObjectsOfTypeAll(typeof(GameObject)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            text = "Components = " + Resources.FindObjectsOfTypeAll(typeof(Component)).Length.ToString();
            pkTargetLable.PushText("SYSTEM", text, ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL), null);
            return(true);
        }
        if (chattext.Contains("/sf"))
        {
            NrTSingleton <FormsManager> .Instance.ShowOrClose(G_ID.DLG_FPS);

            return(true);
        }
        if (chattext.Contains("/fm"))
        {
            NrTSingleton <FormsManager> .Instance.ShowOrClose(G_ID.DLG_MEMORYCHECK);

            return(true);
        }
        if (chattext.Contains("/setfps"))
        {
            string[] array = chattext.Split(new char[]
            {
                '='
            });
            int num = 0;
            if (int.TryParse(array[1], out num))
            {
                if (num != 0)
                {
                    Application.targetFrameRate = num;
                }
                return(true);
            }
        }
        if (chattext.Contains("/delsolui"))
        {
            NrTSingleton <FormsManager> .Instance.ClearShowHideForms();
        }
        if (chattext.Contains("/sr"))
        {
            NrTSingleton <NkBattleReplayManager> .Instance.SaveReplay = !NrTSingleton <NkBattleReplayManager> .Instance.SaveReplay;
            NrTSingleton <ChatManager> .Instance.PushSystemMsg(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1230"), "Save Replay : " + NrTSingleton <NkBattleReplayManager> .Instance.SaveReplay.ToString());
        }
        if (chattext.Contains("/rl") && NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_REPLAY_LIST_DLG) == null)
        {
            NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.BATTLE_REPLAY_LIST_DLG);
        }
        if (chattext.Contains("/tm") && 100 <= NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.m_nMasterLevel && NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOURNAMENT_MASTER_DLG) == null)
        {
            NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.TOURNAMENT_MASTER_DLG);
        }
        if (chattext.Contains("/logouttest") && 100 <= NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.m_nMasterLevel)
        {
            NrMobileAuthSystem.Instance.RequestLogout = true;
            NrMobileAuthSystem.Instance.Auth.DeleteAuthInfo();
            NrTSingleton <NrMainSystem> .Instance.ReLogin(true);
        }
        if (chattext.Contains("/relogintest") && 100 <= NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.m_nMasterLevel)
        {
            NrTSingleton <NrMainSystem> .Instance.ReLogin(true);
        }
        return(false);
    }
Esempio n. 5
0
    public void MakeChatText(Form form, CHAT_TYPE type, short colosseumGrade, string strText, ITEM linkItem)
    {
        if (type == CHAT_TYPE.SYSTEM)
        {
            type = CHAT_TYPE.NORMAL;
        }
        NrCharUser nrCharUser = NrTSingleton <NkCharManager> .Instance.GetChar(1) as NrCharUser;

        if (nrCharUser != null)
        {
            char c = TKString.StringChar("/")[0];
            if (!string.IsNullOrEmpty(strText))
            {
                char[] array = strText.ToCharArray(0, 1);
                if (c.CompareTo(array[0]) == 0)
                {
                    return;
                }
            }
            ChatLabel chatLabel  = null;
            ChatLabel chatLabel2 = null;
            if (TsPlatform.IsWeb)
            {
                MainChatDlg mainChatDlg = form as MainChatDlg;
                if (mainChatDlg != null)
                {
                    chatLabel  = mainChatDlg.GetChatLable(type);
                    chatLabel2 = mainChatDlg.GetChatLable(CHAT_TYPE.ALL);
                }
            }
            else
            {
                ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = form as ChatMobile_Sub_Dlg;
                if (chatMobile_Sub_Dlg != null)
                {
                    chatLabel  = chatMobile_Sub_Dlg.GetChatLable(type);
                    chatLabel2 = chatMobile_Sub_Dlg.GetChatLable(CHAT_TYPE.ALL);
                }
            }
            string name = string.Empty;
            if (chatLabel2 != null)
            {
                name = ChatManager.GetChatFrontString(nrCharUser.GetCharName(), colosseumGrade, type, false);
                chatLabel2.PushText(name, strText, ChatManager.GetChatColorKey(type), linkItem);
                if (null != chatLabel && type != CHAT_TYPE.NORMAL)
                {
                    chatLabel.PushText(name, strText, ChatManager.GetChatColorKey(type), linkItem);
                }
            }
            if (TsPlatform.IsMobile)
            {
                ChatMobileDlg chatMobileDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg;

                if (chatMobileDlg != null)
                {
                    chatLabel2 = chatMobileDlg.GetChatLable(CHAT_TYPE.ALL);
                    if (chatLabel2 != null)
                    {
                        chatLabel2.PushText(name, strText, ChatManager.GetChatColorKey(type), linkItem);
                    }
                    if (80 <= this.ChatMsgList.Count)
                    {
                        this.ChatMsgList.Dequeue();
                    }
                    this.ChatMsgList.Enqueue(new MainChatMsg(type, ChatManager.GetChatNameStr(nrCharUser.GetCharName(), colosseumGrade, false), strText, linkItem, ChatManager.GetChatColorKey(type)));
                }
                TournamentLobbyDlg tournamentLobbyDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOURNAMENT_LOBBY_DLG) as TournamentLobbyDlg;

                if (tournamentLobbyDlg != null)
                {
                    chatLabel2 = tournamentLobbyDlg.GetChatLable(CHAT_TYPE.ALL);
                    if (chatLabel2 != null)
                    {
                        chatLabel2.PushText(name, strText, ChatManager.GetChatColorKey(type), linkItem);
                    }
                }
            }
            nrCharUser.MakeChatText(strText, true);
        }
    }