/// <summary> /// Sets the chat word.显示话术 /// </summary> /// <param name="value">Value.</param> public void SetChatWord(NetChatVo value) { if (null != _window && getVisible()) { (_window as UIGameHallWindow).ShowChat(value); } }
public void ShowChat(NetChatVo value) { lb_chat.text = value.playerName + ":" + value.chat; lb_chat.rectTransform.localPosition = initChatPosition; chatWidth = lb_chat.preferredWidth; isUpdateChat = true; }
public void Refresh(NetChatVo value) { // Console.Error.WriteLine ("sssssssssssssssss"+value.playerName); lb_name.text = value.playerName + ":"; lb_txt.text = value.chat; lb_txt.rectTransform.localPosition = new Vector3(txtNamePosition.x + lb_name.preferredWidth + 10, txtChatPosition.y, txtChatPosition.z); _chatvo = value; }
/// <summary> /// Updates the chat data. 更新聊天信息 /// </summary> /// <param name="value">Value.</param> public void UpdateChatData(NetChatVo value) { if (null != value) { if (null != _window && getVisible()) { _chatVoList.Add(value); if (_chatVoList.Count > 30) { _chatVoList.RemoveAt(0); _chatVoList.TrimExcess(); } (_window as UIBattleWindow).UpdateChatItemInfor(value); } } }
/// <summary> /// 刷新聊天话术 /// </summary> /// <param name="value"></param> public void Refresh(NetChatVo value) { var tmpName = value.playerName; if (tmpName.Length > 6) { tmpName = tmpName.Substring(0, 6); } lb_name.text = tmpName + ":"; lb_txt.text = value.chat; lb_txt.rectTransform.localPosition = new Vector3(txtNamePostion.x + lb_name.preferredWidth + 10, txtChatPostion.y, txtChatPostion.z); _chatvo = value; }
/// <summary> /// 添加新的聊天信息 /// </summary> /// <param name="value"></param> public void AddNewChatLog(NetChatVo value) { if (_window != null && getVisible()) { if (null != _chatList) { _chatList.Add(value); if (_chatList.Count > 30) { _chatList.RemoveAt(0); _chatList.TrimExcess(); } } (_window as UIFightroomWindow).UpateChatLog(); } }
public void AddNewChatLog(NetChatVo value) { if (null != _chatList) { _chatList.Add(value); if (_chatList.Count > 30) { // _chatList.RemoveRange (0, 20); _chatList.RemoveAt(0); _chatList.TrimExcess(); } if (_window != null && getVisible()) { (_window as UIGameHallChatWindow).UpateChatLog(); } } }
/// <summary> /// Updates the chat item infor.刷新聊天 /// </summary> public void UpdateChatItemInfor(NetChatVo value) { var tmpId = value.playerId; Image tmpimg = null; if (tmpId == PlayerManager.Instance.HostPlayerInfo.playerID) { tmpimg = img_chat1; } else if (tmpId == _playerInfors[0].GetPlayerId()) { tmpimg = img_chat2; } else if (tmpId == _playerInfors[1].GetPlayerId()) { // setLightImage(_imgLight3); tmpimg = img_chat3; } else if (tmpId == _playerInfors [2].GetPlayerId()) { // setLightImage(_imgLight4); tmpimg = img_chat4; } if (null != tmpimg) { tmpimg.SetActiveEx(true); tmpimg.GetComponentInChildren <Text> ().text = value.chat; var quance = DOTween.Sequence(); quance.Append(tmpimg.transform.DOScaleZ(1, 2.5f)); quance.AppendCallback(() => { tmpimg.SetActiveEx(false); }); } // Console.Warning.WriteLine ("开始更新人物聊天面板了"); if (null != _tipRecordBoard) { // Console.Warning.WriteLine ("有人物聊天面板"); _tipRecordBoard.UpdateChatItemRecord(); } }
public void Refresh(NetChatVo value) { // _lbTitleTxt.text = value.title; // if(UIDebtAndPaybackController.isDebt==true) // { // _lbBorrow.text = value.borrow.ToString (); // } // else // { // _lbBorrow.text =string.Format("-{0}", Mathf.Abs(value.debt).ToString ()) ; // } lb_name.text = value.playerName; lb_txt.text = value.chat; lb_time.text = value.sendTime; if (tmpHeadPath != value.playerHead) { //img_displayHead.Load (value.playerHead); AsyncImageDownload.Instance.SetAsyncImage(value.playerHead, img_displayHead); tmpHeadPath = value.playerHead; } if (value.playerId == GameModel.GetInstance.myHandInfor.uuid) { // lb_txt; btn_head.transform.localPosition = new Vector3(itemSize.x - btnHeadSize.x - 10, btnHeadPosition.y, btnHeadPosition.z); lb_name.transform.localPosition = new Vector3(itemSize.x - btnHeadSize.x - 10 - txtNameSize.x - 10, txtNamePosition.y, txtNamePosition.z); lb_txt.transform.localPosition = new Vector3(itemSize.x - btnHeadSize.x - 10 - txtChatSize.x - 10, txtChatPosition.y, txtChatPosition.z); lb_time.transform.localPosition = new Vector3(itemSize.x - btnHeadSize.x - 10 - lb_name.preferredWidth - 20 - txtTimeSize.x, txtTimePosition.y, txtTimePosition.z); lb_name.alignment = TextAnchor.MiddleRight; //TextAlignment.Right;TextAnchor lb_txt.alignment = TextAnchor.MiddleRight; lb_time.alignment = TextAnchor.MiddleRight; if (null != img_sex) { img_sex.SetActive(false); } } else { btn_head.transform.localPosition = btnHeadPosition; lb_name.transform.localPosition = txtNamePosition; lb_txt.transform.localPosition = txtChatPosition; lb_time.transform.localPosition = new Vector3(txtNamePosition.x + lb_name.preferredWidth + 20, txtTimePosition.y, txtTimePosition.z); lb_name.alignment = TextAnchor.MiddleLeft; lb_txt.alignment = TextAnchor.MiddleLeft; lb_time.alignment = TextAnchor.MiddleLeft; if (null != img_sex) { img_sex.SetActive(true); if (value.sex == 0) { img_sex.Load(sexWomanPath); } else if (value.sex == 1) { img_sex.Load(sexManPath); } } } _chatvo = value; }