Esempio n. 1
0
    public static bool AddItemLink(ITEM _item)
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg == null)
            {
                return(false);
            }
            mainChatDlg.AddItemLinkText(_item);
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG) as ChatMobile_Sub_Dlg;

            if (chatMobile_Sub_Dlg != null)
            {
                chatMobile_Sub_Dlg.AddItemLinkText(_item);
            }
            ChatMobileDlg chatMobileDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg;

            if (chatMobileDlg == null)
            {
                return(false);
            }
            chatMobileDlg.AddItemLinkText(_item);
        }
        return(true);
    }
    public void ShowChange()
    {
        if (this.m_btChat.Visible)
        {
            this.OnClickChatMode(this.m_btChat);
        }
        else if (this.m_btCharinfo.Visible)
        {
            if (!TsPlatform.IsMobile)
            {
                MainChatDlg mainChatDlg = (MainChatDlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG);

                if (mainChatDlg != null && mainChatDlg.IsChatFocused())
                {
                    return;
                }
            }
            else
            {
                ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = (ChatMobile_Sub_Dlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG);

                if (chatMobile_Sub_Dlg != null && chatMobile_Sub_Dlg.IsChatFocused())
                {
                    return;
                }
            }
            this.OnClickCharinfoMode(this.m_btCharinfo);
        }
    }
Esempio n. 3
0
    public static void SetHideControl(bool _bHide)
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg != null)
            {
                mainChatDlg.SetHideControl(_bHide);
            }
            if (!_bHide)
            {
                mainChatDlg.ChangeSize(GUICamera.width, GUICamera.height);
            }
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobileDlg chatMobileDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg;

            if (chatMobileDlg != null)
            {
                chatMobileDlg.SetHideControl(_bHide);
            }
        }
    }
Esempio n. 4
0
    public static void NPCTellChat(string name)
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg != null)
            {
                mainChatDlg.NPCTellChat(name);
            }
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobileDlg chatMobileDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg;

            if (chatMobileDlg != null)
            {
                chatMobileDlg.NPCTellChat(name);
            }
            ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG) as ChatMobile_Sub_Dlg;

            if (chatMobile_Sub_Dlg != null)
            {
                chatMobile_Sub_Dlg.NPCTellChat(name);
            }
            TournamentLobbyDlg tournamentLobbyDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOURNAMENT_LOBBY_DLG) as TournamentLobbyDlg;

            if (tournamentLobbyDlg != null)
            {
                tournamentLobbyDlg.NPCTellChat(name);
            }
        }
    }
Esempio n. 5
0
 private void SetData(CHAT_TYPE type, string name, string msg, ITEM linkItem, string color)
 {
     this.type     = type;
     this.name     = ChatManager.GetChatFrontString(name, type);
     this.msg      = msg;
     this.linkItem = linkItem;
     if (string.Empty != color && string.Empty != color)
     {
         this.color = color;
     }
     else
     {
         this.color = MainChatDlg.GetChatColorKey(type);
     }
 }
Esempio n. 6
0
    public void SetChatFocus()
    {
        IKeyFocusable keyFocusable = NrTSingleton <UIManager> .Instance.FocusObject as IKeyFocusable;

        if (keyFocusable != null)
        {
            TextField y = keyFocusable as TextField;
            if (this._tfInput != y)
            {
                return;
            }
        }
        if (this.HideControl)
        {
            return;
        }
        if (this.bNotTextKeypadEnter)
        {
            this._tfInput.ClearFocus();
        }
        else
        {
            this._tfInput.SetFocus();
        }
        this.bNotTextKeypadEnter = !this.bNotTextKeypadEnter;
        bool flag;

        if (!this._tfInput.Visible)
        {
            AutoSpriteControlBase arg_A3_0 = this._tfInput;
            flag = true;
            this._dtInputBG.Visible = flag;
            flag = flag;
            this.lbChatType.Visible = flag;
            arg_A3_0.Visible        = flag;
        }
        this._tfInput.ColorText = NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(this.m_SelectTab));

        UIPanelManager arg_E5_0 = this._ToolBar;

        flag = !this.bNotTextKeypadEnter;
        this._btOption.Visible = flag;
        arg_E5_0.Visible       = flag;
        if (0 < this._tfInput.Text.Length)
        {
            this.OnInputText(null);
        }
    }
Esempio n. 7
0
    public static void GetToolBab()
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg != null)
            {
                mainChatDlg.GetToolBab();
            }
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobileDlg chatMobileDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg;

            if (chatMobileDlg != null)
            {
            }
        }
    }
Esempio n. 8
0
    public static void AddChatText(string strdata)
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg != null)
            {
                mainChatDlg.AddChatText(strdata);
            }
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG) as ChatMobile_Sub_Dlg;

            if (chatMobile_Sub_Dlg != null)
            {
                chatMobile_Sub_Dlg.AddChatText(strdata);
            }
        }
    }
Esempio n. 9
0
    public static int GetSelectTap()
    {
        if (TsPlatform.IsWeb)
        {
            MainChatDlg mainChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as MainChatDlg;

            if (mainChatDlg != null)
            {
                return((int)mainChatDlg.GetSelectTab());
            }
        }
        else if (TsPlatform.IsMobile)
        {
            ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MOBILE_SUB_DLG) as ChatMobile_Sub_Dlg;

            if (chatMobile_Sub_Dlg != null)
            {
                return((int)chatMobile_Sub_Dlg.GetSelectTab());
            }
        }
        return(-1);
    }
Esempio n. 10
0
    private void OnClickTab(IUIObject obj)
    {
        UIPanelTab uIPanelTab = obj as UIPanelTab;
        CHAT_TYPE  cHAT_TYPE  = (CHAT_TYPE)uIPanelTab.panel.index;

        if (cHAT_TYPE == this.m_SelectTab)
        {
            return;
        }
        this.m_SelectTab = cHAT_TYPE;
        base.ShowLayer((int)(this.m_SelectTab + 1), 5);
        string arg = string.Empty;

        switch (cHAT_TYPE)
        {
        case CHAT_TYPE.NORMAL:
            arg = this._ChatTabDefine.TabName[0];
            break;

        case CHAT_TYPE.GUILD:
            arg = this._ChatTabDefine.TabName[1];
            break;

        case CHAT_TYPE.PARTY:
            arg = this._ChatTabDefine.TabName[2];
            break;

        case CHAT_TYPE.BATTLE:
            arg = this._ChatTabDefine.TabName[3];
            break;

        case CHAT_TYPE.WATCH:
            arg = this._ChatTabDefine.TabName[6];
            break;
        }
        this.lbChatType.SetText(string.Format("{0}[{1}]", NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(this.m_SelectTab)), arg));
        if (cHAT_TYPE != CHAT_TYPE.NORMAL && this._Manager.GetUniqueFromMegType(cHAT_TYPE) <= 0)
        {
            this._ToolBar.SetSelectTabIndex((int)this.m_SelectTab);
            return;
        }
        this.ChangeTab(cHAT_TYPE);
    }
Esempio n. 11
0
    public void GetToolBab()
    {
        this._ChatTabDefine.UserLoadChatTab();
        this._ToolBar.Control_Tab[0].Text = NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(CHAT_TYPE.NORMAL)) + this._ChatTabDefine.TabName[0];

        this._ToolBar.Control_Tab[1].Text = NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(CHAT_TYPE.GUILD)) + this._ChatTabDefine.TabName[1];

        this._ToolBar.Control_Tab[2].Text = NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(CHAT_TYPE.PARTY)) + this._ChatTabDefine.TabName[2];

        this._ToolBar.Control_Tab[3].Text = NrTSingleton <CTextParser> .Instance.GetTextColor(MainChatDlg.GetChatColorKey(CHAT_TYPE.BATTLE)) + this._ChatTabDefine.TabName[3];
    }
Esempio n. 12
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);
        }
    }