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 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); } } }
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); } } }
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) { } } }
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); } }
public override void SetComponent() { this._lChatChannel = (base.GetControl("Label_channel1") as Label); this._tfInput = (base.GetControl("TextField_InputText") as TextField); this._tfInput.multiline = false; this._tfInput.AddCommitDelegate(new EZKeyboardCommitDelegate(this.OnInputText)); this._tfInput.AddFocusDelegate(new UITextField.FocusDelegate(this.OnFocusText)); if (NrGlobalReference.strLangType.Equals("eng")) { this._tfInput.maxLength = 100; } else { this._tfInput.maxLength = 50; } this._tfInput.MaxWidth = 0f; this._tfInput.SetDefaultText(string.Empty); if (null != this._tfInput.spriteText) { this._tfInput.spriteText.parseColorTags = false; if (null != this._tfInput.spriteTextShadow) { this._tfInput.spriteTextShadow.parseColorTags = false; } } this.chatTab = (base.GetControl("TabBtn") as Toolbar); this.SetToolBarText(); for (int i = 0; i < this.chatTab.Count; i++) { UIPanelTab expr_137 = this.chatTab.Control_Tab[i]; expr_137.ButtonClick = (EZValueChangedDelegate)Delegate.Combine(expr_137.ButtonClick, new EZValueChangedDelegate(this.OnClickTab)); } this.chatTab.FirstSetting(); this.chatTab.SetSelectTabIndex(0); this._btSend = (base.GetControl("Button_Enter") as Button); this._btSend.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickSend)); this._btEmoticon = (base.GetControl("Button_ChatEmo") as Button); this._btEmoticon.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickEmoticon)); this._btChangeChannel = (base.GetControl("Button_channel") as Button); this._btChangeChannel.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickChangeChannel)); this._lChatType = (base.GetControl("Label_Chatkind") as Label); this._lChatType.Text = NrTSingleton <CTextParser> .Instance.GetTextColor(ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL)) + NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2138"); this._btChangeType1 = (base.GetControl("Button_ChatChange1") as Button); this._btChangeType2 = (base.GetControl("Button_ChatChange2") as Button); this._btChangeType1.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickChangeType1)); this._btChangeType2.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickChangeType2)); this.SetChatType(); this._dtChatBG = (base.GetControl("DrawTexture_ChatBG") as DrawTexture); base.SetLocation(0f, GUICamera.height - base.GetSize().y); Vector2 vPos = new Vector2(this._dtChatBG.GetSize().x, 0f); this._clChat = ChatManager.MakeChatLabel(this, "ChatLabel_AllChat", vPos); this._clChatGuild = ChatManager.MakeChatLabel(this, "ChatLabel_Guild", vPos); this._clChatGuild.Visible = false; this._Default = (base.GetControl("Label_chat") as Label); base.ShowLayer(1); this.m_MainChat = (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHAT_MAIN_DLG) as ChatMobileDlg); base.SetScreenCenter(); this.ChatStart(); this.m_nChatTap = PlayerPrefs.GetInt(NrPrefsKey.CHAT_SUB_TAP, 0); CHAT_TYPE changeTap = (CHAT_TYPE)this.m_nChatTap; this.SetChangeTap(changeTap); }