public override void SetComponent() { this.m_lTitle = (base.GetControl("Label_Title") as Label); this.m_tfChat = (base.GetControl("TextArea_InputText") as TextField); this.m_tfChat.CommitDelegate = new EZKeyboardCommitDelegate(this.OnInputText); this.m_tfChat.maxLength = 50; this.m_tfChat.MaxWidth = 0f; this.m_btChatInPut = (base.GetControl("Button_Enter") as Button); this.m_btChatInPut.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickSend)); this.m_btChatColorChange = (base.GetControl("Button_SelectColor") as Button); Button expr_A9 = this.m_btChatColorChange; expr_A9.Click = (EZValueChangedDelegate)Delegate.Combine(expr_A9.Click, new EZValueChangedDelegate(this.OnClickColor)); this.m_dtColorSwatchs = (base.GetControl("DrawTexture_ColorSwatchs") as DrawTexture); this.m_btChatEmo = (base.GetControl("Button_ChatEmo") as Button); this.m_btChatEmo.Click = new EZValueChangedDelegate(this.OnClickEmoticon); this.m_btChatEmo.data = NrTSingleton <NrTextMgr> .Instance.GetTextFromToolTip("43"); this.m_bMini = (base.GetControl("Button_Button24") as Button); this.m_bMini.Click = new EZValueChangedDelegate(this.OnClickMini); this.m_clChat = (base.GetControl("ChatLabel_Chat01") as ChatLabel); this.m_clChat.MakeBoxCollider(); this.m_clChat.itemSpacing = 5f; for (int i = 0; i < this.MAX_USER_COUNT; i++) { this.user_info[i] = new USER_CHATINFO(); this.user_info[i].m_itUserImage0 = (base.GetControl("ItemTexture_User" + i) as ItemTexture); this.user_info[i].m_lCharName0 = (base.GetControl("Label_charname" + i) as Label); } base.SetScreenCenter(); this.Hide(); }
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); } } }
public Message(string ChatText, int ChatType, Bitmap Portrait, string ChatName = "2017011518") { InitializeComponent(); ChatLabel.Text = ChatText; FriendNameLabel.Text = ChatName; MyNameLabel.Text = Info.UserName; this.Height = ChatLabel.Height + 60; if (ChatType == 0) { ChatLabel.Location = new Point(80, 40); ChatLabel.BringToFront(); } else if (ChatType == 1) { ChatLabel.Location = new Point(this.Width - ChatLabel.Width - 70, 40); ChatLabel.BringToFront(); ChatLabel.BackColor = Color.Aqua; } Bitmap ShowPortrait = new Bitmap(Portrait); if (ChatType == 0) { this.FriendPortrait.Image = ShowPortrait; MyPortrait.Visible = false; MyNameLabel.Visible = false; } else if (ChatType == 1) { this.MyPortrait.Image = new Bitmap(Info.headP);//TODO FriendPortrait.Visible = false; FriendNameLabel.Visible = false; } }
public override void SetComponent() { for (int i = 0; i < 4; i++) { this.m_lbGroupTitle[i] = (base.GetControl(string.Format("Label_GroupTitle{0}", (i + 1).ToString("00"))) as Label); this.m_btGroupClose[i] = (base.GetControl(string.Format("Button_Close{0}", (i + 1).ToString("00"))) as Button); this.m_btGroupClose[i].Data = i; this.m_btGroupClose[i].AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickDeleteRoom)); this.m_tgGroup[i] = (base.GetControl(string.Format("Toggle_Group{0}", (i + 1).ToString("00"))) as Toggle); this.m_tgGroup[i].AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickToggle)); } this.m_InviteList = (base.GetControl("ListBox_InviteList") as ListBox); this.m_InviteList.LineHeight = 80f; this.m_InviteList.ColumnNum = 3; this.m_InviteList.UseColumnRect = true; this.m_InviteList.SetColumnRect(0, 15, 15, 50, 50); this.m_InviteList.SetColumnRect(1, 75, 11, 180, 28, SpriteText.Anchor_Pos.Middle_Left, 26f, false); this.m_InviteList.SetColumnRect(2, 75, 41, 180, 28, SpriteText.Anchor_Pos.Middle_Left, 26f, false); if (TsPlatform.IsMobile) { this.m_InviteList.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickUserList)); } else { this.m_InviteList.SetRightMouseDelegate(new EZValueChangedDelegate(this.OnClickUserList)); } this.m_btInvite = (base.GetControl("Button_Invite") as Button); this.m_btInvite.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickInvite)); this._ciWhisperChat = (base.GetControl("ChatLabel_Chat01") as ChatLabel); this._ciWhisperChat.MakeBoxCollider(); this._ciWhisperChat.itemSpacing = 5f; this.m_taInput = (base.GetControl("TextArea_InputText") as TextField); if (NrGlobalReference.strLangType.Equals("eng")) { this.m_taInput.maxLength = 100; } else { this.m_taInput.maxLength = 50; } this.m_taInput.MaxWidth = 0f; this.m_btSendMessage = (base.GetControl("Button_Enter") as Button); this.m_btSendMessage.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnInputText)); this.m_btSelectColor = (base.GetControl("Button_SelectColor") as Button); this.m_btSelectColor.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickColor)); this.m_btMinimum = (base.GetControl("Button_Minimum") as Button); this.m_btMinimum.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickMinium)); this.m_btEmoticon = (base.GetControl("Button_ChatEmo") as Button); this.m_btEmoticon.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickEmoticon)); this.m_btGroupList = (base.GetControl("Button_GroupList") as Button); this.m_btGroupList.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickGroupList)); this.m_lbLastTime = (base.GetControl("Label_TalkTime") as Label); this.m_txTextColor = (base.GetControl("DrawTexture_ColorSwatchs") as DrawTexture); this.SetUserStateText(NrTSingleton <WhisperManager> .Instance.UserState); this.SetChatColor(); base.ShowLayer(1); base.SetScreenCenter(); this.SetData(); }
private ChatLabel MakeChat(string strName, Vector2 vPos) { ChatLabel chatLabel = base.GetControl(strName) as ChatLabel; chatLabel.Visible = false; chatLabel.itemSpacing = 5f; return(chatLabel); }
public void Chat(string text) { if (ChatLabel != null && !ChatLabel.IsDisposed) { ChatLabel.Dispose(); ChatLabel = null; } const int chatWidth = 200; List <string> chat = new List <string>(); string[] output = text.Split('(', ')'); foreach (var o in output) { if (!uint.TryParse(o, out uint id)) { continue; } var item = GameScene.ItemInfoList.FirstOrDefault(x => x.Index == id); if (item != null) { text = Functions.ReplaceFirst(text, "(" + o + ")", " " + item.FriendlyName + " "); } } int index = 0; for (int i = 1; i < text.Length; i++) { if (TextRenderer.MeasureText(CMain.Graphics, text.Substring(index, i - index), ChatFont).Width > chatWidth) { chat.Add(text.Substring(index, i - index - 1)); index = i - 1; } } chat.Add(text.Substring(index, text.Length - index)); text = chat[0]; for (int i = 1; i < chat.Count; i++) { text += string.Format("\n{0}", chat[i]); } ChatLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = Color.White, OutLine = true, OutLineColour = Color.Black, DrawFormat = TextFormatFlags.HorizontalCenter, Text = text, }; ChatTime = CMain.Time + 5000; }
private void Start() { if (Global.isServer) { Object.DestroyImmediate(this); return; } GameObject gameObject = (GameObject)Object.Instantiate(m_chatLabel, base.transform.position + m_addVector, Quaternion.Euler(55f, 0f, 0f)); gameObject.transform.parent = base.transform; m_label = gameObject.GetComponent <ChatLabel>(); m_client = (LidClient)Object.FindObjectOfType(typeof(LidClient)); }
public override void SetComponent() { this._tfInput = (base.GetControl("TextField_Textinput") as TextField); this._tfInput.AddCommitDelegate(new EZKeyboardCommitDelegate(this.OnInputText)); this._tfInput.maxLength = 50; this._tfInput.MaxWidth = 0f; this._ToolBar = (base.GetControl("ToolBar_ChatTab") as Toolbar); this.lbChatType = (base.GetControl("Label_Sort") as Label); this.GetToolBab(); for (int i = 0; i < this._ToolBar.Count; i++) { UIPanelTab expr_90 = this._ToolBar.Control_Tab[i]; expr_90.ButtonClick = (EZValueChangedDelegate)Delegate.Combine(expr_90.ButtonClick, new EZValueChangedDelegate(this.OnClickTab)); } this._ToolBar.FirstSetting(); this._ToolBar.SetSelectTabIndex(0); this._btSize = (base.GetControl("Button_variableBtn") as Button); Button expr_F9 = this._btSize; expr_F9.Click = (EZValueChangedDelegate)Delegate.Combine(expr_F9.Click, new EZValueChangedDelegate(this.OnClickSize)); this._btOption = (base.GetControl("Button_ChatConf") as Button); Button expr_136 = this._btOption; expr_136.Click = (EZValueChangedDelegate)Delegate.Combine(expr_136.Click, new EZValueChangedDelegate(this.OnClickOption)); this._btEmoticon = (base.GetControl("Button_ChatEmo") as Button); Button expr_173 = this._btEmoticon; expr_173.Click = (EZValueChangedDelegate)Delegate.Combine(expr_173.Click, new EZValueChangedDelegate(this.OnClickEmoticon)); this._btAD = (base.GetControl("Button_ChatShout") as Button); Button expr_1B0 = this._btAD; expr_1B0.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1B0.Click, new EZValueChangedDelegate(this.OnClickAD)); this._dtInputBG = (base.GetControl("DrawTexture_TextArea") as DrawTexture); this._dtChatBG = (base.GetControl("DrawTexture_ChatBG") as DrawTexture); this._dtChatLag = (base.GetControl("DrawTexture_Lag") as DrawTexture); this._dtInputBG.SetAlpha(0.5f); Vector2 vPos = new Vector2(this._dtChatBG.GetSize().x, 0f); this._clChat = this.MakeChat("ChatLabel_Allchat", vPos); this._clChatAll = this.MakeChat("ChatLabel_Allchat", vPos); this._clChatGuild = this.MakeChat("ChatLabel_Guildchat", vPos); this._clChatParty = this.MakeChat("ChatLabel_Partychat", vPos); this._clChatShout = this.MakeChat("ChatLabel_Fieldchat", vPos); this.DEFAULT_CHAT_BG_HEIGHT = this._dtChatBG.GetSize().y; this.DEFAULT_CHAT_LABEL_HEIGHT = this._clChatAll.GetSize().y; base.Draggable = false; base.ShowLayer((int)(this.m_SelectTab + 1), 5); this.SetChatSize(this.SCREEN_TYPE_MAX_SIZE / 2); }
public static ChatLabel MakeChatLabel(Form form, string strName, Vector2 vPos) { ChatLabel chatLabel = form.GetControl(strName) as ChatLabel; if (null == chatLabel) { return(null); } if (null != chatLabel.slider) { UnityEngine.Object.Destroy(chatLabel.slider.gameObject); } chatLabel.Visible = false; chatLabel.itemSpacing = 5f; return(chatLabel); }
public void SetChatText(string a_text) { if (a_text != null && a_text.Length > 0) { if (null == m_labelChat && null != m_labelChatPrefab) { GameObject gameObject = (GameObject)Object.Instantiate(m_labelChatPrefab, base.transform.position + m_labelChatOffset, Quaternion.identity); gameObject.transform.parent = base.transform; m_labelChat = gameObject.GetComponent <ChatLabel>(); } if (null != m_labelChat) { m_labelChat.SetText(a_text); } } }
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); } } }
public int SendType; //=1; public SendBox(string ChatText, int ChatType, Bitmap Portrait, string ChatName = "2016011435") //添加对话显示 { InitializeComponent(); string CurrentTime; CurrentTime = DateTime.Now.Hour.ToString(); if (DateTime.Now.Minute < 10)//以两位数显示分钟 { CurrentTime += ":" + "0" + DateTime.Now.Minute.ToString(); } else { CurrentTime += ":" + DateTime.Now.Minute.ToString(); } TimeLabel.Text = CurrentTime; ChatLabel.Text = ChatText; FriendNameLabel.Text = ChatName; MyNameLabel.Text = BasicInfo.UserName; SendType = ChatType; this.Height = ChatLabel.Height + 65; if (ChatType == 0) { ChatLabel.Location = new Point(80, 40); ChatLabel.BringToFront(); } else if (ChatType == 1) { ChatLabel.Location = new Point(this.Width - ChatLabel.Width - 70, 40); ChatLabel.BringToFront(); } Bitmap ShowPortrait = new Bitmap(Portrait); if (ChatType == 0) { this.FriendPortrait.Image = ShowPortrait; MyPortrait.Visible = false; MyNameLabel.Visible = false; } else if (ChatType == 1) { this.MyPortrait.Image = ShowPortrait; FriendPortrait.Visible = false; FriendNameLabel.Visible = false; } }
public virtual void DrawChat() { if (ChatLabel == null || ChatLabel.IsDisposed) { return; } if (CMain.Time > ChatTime) { ChatLabel.Dispose(); ChatLabel = null; return; } ChatLabel.ForeColour = Dead ? Color.Gray : Color.White; ChatLabel.Location = new Point(DisplayRectangle.X + (48 - ChatLabel.Size.Width) / 2, DisplayRectangle.Y - (60 + ChatLabel.Size.Height) - (Dead ? 35 : 0)); ChatLabel.Draw(); }
public void Chat(string text) { if (ChatLabel != null && !ChatLabel.IsDisposed) { ChatLabel.Dispose(); ChatLabel = null; } const int chatWidth = 200; List <string> chat = new List <string>(); int index = 0; for (int i = 1; i < text.Length; i++) { if (TextRenderer.MeasureText(CMain.Graphics, text.Substring(index, i - index), ChatFont).Width > chatWidth) { chat.Add(text.Substring(index, i - index - 1)); index = i - 1; } } chat.Add(text.Substring(index, text.Length - index)); text = chat[0]; for (int i = 1; i < chat.Count; i++) { text += string.Format("\n{0}", chat[i]); } ChatLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = Color.White, OutLine = true, OutLineColour = Color.Black, DrawFormat = TextFormatFlags.HorizontalCenter, Text = text, }; ChatTime = CMain.Time + 5000; }
public override void SetComponent() { this._btKeyboard = (base.GetControl("Button_Input") as Button); Button expr_1C = this._btKeyboard; expr_1C.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1C.Click, new EZValueChangedDelegate(this.OnClickKeyboard)); this._dtChatBG = (base.GetControl("DrawTexture_ChatBG") as DrawTexture); base.SetLocation(0f, GUICamera.height - base.GetSizeY()); Vector2 vPos = new Vector2(this._dtChatBG.GetSize().x, 0f); this._clChat = ChatManager.MakeChatLabel(this, "ChatLabel_Allchat", vPos); this._clChatAll = ChatManager.MakeChatLabel(this, "ChatLabel_Allchat", vPos); this._clChatGuild = ChatManager.MakeChatLabel(this, "ChatLabel_Guildchat", vPos); this._clChatSystem = ChatManager.MakeChatLabel(this, "ChatLabel_Systemchat", vPos); this._clChat.RemoveBoxCollider(); base.ShowLayer(1); ChatMobile_Sub_Dlg chatMobile_Sub_Dlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.CHAT_MOBILE_SUB_DLG) as ChatMobile_Sub_Dlg; if (chatMobile_Sub_Dlg != null) { chatMobile_Sub_Dlg.Hide(); } }
public override void SetComponent() { PlunderSolListDlg plunderSolListDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.PLUNDERSOLLIST_DLG) as PlunderSolListDlg; if (plunderSolListDlg != null) { base.SetLocation(plunderSolListDlg.GetLocationX() + plunderSolListDlg.GetSizeX(), base.GetLocationY(), base.GetLocation().z); } this.cl_party = (base.GetControl("CL_Party") as ChatLabel); this.cl_party.RemoveBoxCollider(); this.cl_guild = (base.GetControl("CL_Guild") as ChatLabel); this.cl_guild.RemoveBoxCollider(); this.bt_ChatChange = (base.GetControl("BT_ChatChange") as Button); this.bt_ChatChange2 = (base.GetControl("BT_ChatChange2") as Button); this.bt_ChatChange.Click = new EZValueChangedDelegate(this.OnClickChangeChatType); this.bt_ChatChange2.Click = new EZValueChangedDelegate(this.OnClickChangeChatType); this.lb_Chat = (base.GetControl("LB_Chat") as Label); this.lb_Chat.Text = NrTSingleton <CTextParser> .Instance.GetTextColor(ChatManager.GetChatColorKey(CHAT_TYPE.NORMAL)) + NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2138"); this.box_chat = (base.GetControl("BOX_Chat") as Box); this.box_chat.Visible = false; base.SetShowLayer(2, false); }
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); } } }
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); }
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 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); }
private void ChangeChatLabel(ref ChatLabel target, float width, float BGwidth) { target.SetSize(target.GetSize().x, width); target.SetLocation(10f, 10f + this.DEFAULT_CHAT_LABEL_HEIGHT - width); target.clipWhenMoving = true; }