// 好友聊听 private void processBuddyChat(int nEntityID) { uint nUserID = GameLogicAPI.getPlayerUserID(nEntityID); if (nUserID == 0) { return; } // 好友聊听 UListComponentItemDataPopup item = new UPopupItemDataBuddyChat((int)nUserID, _strItemTypeName: UPopupItemDataBuddyChat.GetDescString()); PopupMenuDataManager.Instance.SetPopupItemData(m_BuddyChatInfo, ref item); }
public virtual void SetData(UListItemTaskReply reply) { if (reply == null) { return; } // 楼层 ReplyIndex.text = String.Format("{0}楼", reply.nIndex); // 文字 ReplyName.text = reply.node.szReplyName; ReplyContent.text = reply.node.szReplyContent; // 性别 if (reply.node.byReplySex < (byte)PERSON_SEX.SEX_MAX && reply.node.byReplySex >= (byte)PERSON_SEX.SEX_MALE) { ReplySexIcon.gameObject.SetActive(true); ReplySexIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_TASK_UNFOLD, reply.node.byReplySex + 1); HeadIcon.gameObject.SetActive(true); HeadIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_TASK_UNFOLD, 1, reply.node.byReplySex + 1); } else { ReplySexIcon.gameObject.SetActive(false); HeadIcon.gameObject.SetActive(false); } // 时间 DateTime replyTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(reply.node.nReplyTime); replyTime = replyTime.ToLocalTime(); int nGapTime = reply.nServerTime - reply.node.nReplyTime; if (nGapTime < 60)//1分钟 { ReplyTime.text = String.Format("{0}秒前", nGapTime); } else if (nGapTime < 3600)//1小时 { ReplyTime.text = String.Format("{0}分钟前", nGapTime / 60); } else if (nGapTime < 24 * 3600)//1天 { ReplyTime.text = String.Format("{0}小时前", nGapTime / 3600); } else if (nGapTime < 2 * 24 * 3600)//2天 { ReplyTime.text = String.Format("昨天 {0:D2}:{1:D2}", replyTime.Hour, replyTime.Minute); } else if (nGapTime < 3 * 24 * 3600)//3天 { ReplyTime.text = String.Format("前天 {0:D2}:{1:D2}", replyTime.Hour, replyTime.Minute); } else { ReplyTime.text = String.Format("{0}-{1}-{2} {3:D2}:{4:D2}", replyTime.Year, replyTime.Month, replyTime.Day, replyTime.Hour, replyTime.Minute); } // 右键弹窗 int nSelfID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); int nTargetID = reply.node.nReplyPDBID; if (nTargetID > 0 && nTargetID != nSelfID) { UPopupAction PopupAction = new UPopupAction(); PopupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(reply.node.nReplyUserID, reply.node.szReplyName)); PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(nTargetID)); PopupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite(nTargetID)); PopupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest(nTargetID)); PopupAction.Add(UPopupItemDataBuddyChat.GetDescString(), new UPopupItemDataBuddyChat(nTargetID)); PopupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(reply.node.szReplyName)); ReplyMenuHandle.HandlePopupAction = PopupAction; } }
// 更新展开界面 public void UpdateUnfoldWndView() { ClearView(); // 解析数据(首胜奖励) bool bFirstWinType = m_unfoldTask.nTaskType == (int)ENTASK_TYPE.ENTASK_TYPE_FIRSTWIN; int nFirstWinState = 0; if (bFirstWinType && !String.IsNullOrEmpty(m_unfoldTask.szHit) && m_unfoldTask.szHit.Length > 1) { string strFirstWinState = m_unfoldTask.szHit.Substring(1, 1); nFirstWinState = Int32.Parse(strFirstWinState); } if (bFirstWinType) { m_unfoldTask.szDescription = ULocalizationService.Instance.Get("UIView", "Task", "FirstWinNormalDesc"); if (nFirstWinState == 1) { m_unfoldTask.szDescription = ULocalizationService.Instance.Get("UIView", "Task", "FirstWinHalfDesc"); } } // 设置显示 if (m_unfoldTask.llContactID <= 0) { InputFieldGo.SetActive(false); TaskReplyGo.SetActive(false); this.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(774.0f, 240.0f); } else if (m_unfoldTask.listReply.Count <= 0) { InputFieldGo.SetActive(true); TaskReplyGo.SetActive(false); this.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(774.0f, 370.0f); } else { InputFieldGo.SetActive(true); TaskReplyGo.SetActive(true); this.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(774.0f, 586.0f); } WarRecordRT.gameObject.SetActive(m_unfoldTask.llTagID > 0); FinishRT.gameObject.SetActive(m_unfoldTask.nTaskState == (int)Task_State_Type.TaskStateType_Finish); GotoRT.gameObject.SetActive(m_unfoldTask.nClientLink > 0 && m_unfoldTask.nTaskState == (int)Task_State_Type.TaskStateType_Accept); // 设置任务 if (String.IsNullOrEmpty(m_unfoldTask.szName)) { TaskName.text = String.Format(ULocalizationService.Instance.Get("UIView", "Task", "UnfoldTitle"), m_unfoldTask.strPublishName); } else { TaskName.text = m_unfoldTask.szName; } TaskGo.SetActive(m_unfoldTask.nTaskID > 0); string strPoccess = ""; if (!String.IsNullOrEmpty(m_unfoldTask.szHit)) { strPoccess = m_unfoldTask.szHit; } else if (m_unfoldTask.nTaskState == (int)Task_State_Type.TaskStateType_Finish) { strPoccess = "(1/1)"; } else { strPoccess = "(0/1)"; } string strDesc = String.Format("{0},{1}{2}", m_unfoldTask.szDescription, ULocalizationService.Instance.Get("UIView", "Task", "NowPoccess"), strPoccess); UBB.toHtml(ref strDesc); Description.text = strDesc; if (TaskStarLevel.Length == (int)Task_Level.Level_3) { int nTaskLevel = TaskConfig.Instance.GetTaskLevel(m_unfoldTask.nTaskID, m_unfoldTask.nTaskType, m_unfoldTask.nTaskSubType, m_unfoldTask.nTaskSpecificType);; TaskStarLevel[0].gameObject.SetActive(nTaskLevel >= (int)Task_Level.Level_2); TaskStarLevel[1].gameObject.SetActive(nTaskLevel >= (int)Task_Level.Level_2); TaskStarLevel[2].gameObject.SetActive(nTaskLevel >= (int)Task_Level.Level_3); } // 设置首胜,特殊处理 if (m_unfoldTask.nTaskState == (int)Task_State_Type.TaskStateType_End) { Description.text = m_unfoldTask.szDescription; int nRemianTime = LogicDataCenter.taskDataManager.FirstWinRemainTime; int nHour = nRemianTime / 3600; int nMin = nRemianTime % 3600 / 60; FirstWinReflushTime.text = String.Format("{0}{1:D2}:{2:D2}", ULocalizationService.Instance.Get("UIView", "Task", "FirstWinRemainDesc"), nHour, nMin); FirstWinReflushTime.gameObject.SetActive(true); m_fFirstWinCoolTime = Time.unscaledTime; } else { FirstWinReflushTime.gameObject.SetActive(false); } // 设置发布者 PublisherGo.SetActive(m_unfoldTask.llContactID > 0); PublisherHead.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_TASK_UNFOLD, 1, 1); PublisherName.text = m_unfoldTask.strPublishName; EmotionWords.text = m_unfoldTask.strEmotionWords; if (m_unfoldTask.nPublishSex < (int)PERSON_SEX.SEX_MAX && m_unfoldTask.nPublishSex >= (int)PERSON_SEX.SEX_MALE) { PublisherSex.gameObject.SetActive(true); PublisherSex.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_TASK_UNFOLD, m_unfoldTask.nPublishSex + 1); PublisherHead.gameObject.SetActive(true); PublisherHead.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_TASK_UNFOLD, 1, m_unfoldTask.nPublishSex + 1); } else { PublisherSex.gameObject.SetActive(false); PublisherHead.gameObject.SetActive(false); } int nSelfID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); int nTargetID = m_unfoldTask.nPublishPDBID; // 右键弹窗 if (nTargetID > 0 && nTargetID != nSelfID) { UPopupAction PopupAction = new UPopupAction(); PopupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(m_unfoldTask.nPublishUserID, m_unfoldTask.strPublishName)); PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(nTargetID)); PopupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite(nTargetID)); PopupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest(nTargetID)); PopupAction.Add(UPopupItemDataBuddyChat.GetDescString(), new UPopupItemDataBuddyChat(nTargetID)); PopupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(m_unfoldTask.strPublishName)); PublishMenuHandle.HandlePopupAction = PopupAction; } // 设置回复 int nReplyCount = m_unfoldTask.listReply.Count; TaskReplyList.DataSource.Clear(); ObservableList <UListItemTaskReply> dataSource = new ObservableList <UListItemTaskReply>(); foreach (var item in m_unfoldTask.listReply) { UListItemTaskReply node = new UListItemTaskReply(); node.nIndex = nReplyCount--; node.nServerTime = m_unfoldTask.nServerTime; node.node = item; dataSource.Add(node); } TaskReplyList.DataSource = dataSource; // 设置奖励 for (int i = 0; i < TASK_PRIZE_ITEM_COUNT; i++) { if (m_unfoldTask.arrayPrize != null && i < m_unfoldTask.arrayPrize.Length) { // 第二个首胜奖励 bool bShowClan = m_unfoldTask.nTaskType == (int)ENTASK_TYPE.ENTASK_TYPE_FIRSTWIN && i >= 1; // 第二个首胜奖励,且完成1态 bool bShowNoHave = bShowClan && m_unfoldTask.nTaskState == (int)Task_State_Type.TaskStateType_Finish && nFirstWinState == 1; m_arrTaskPrizeItem[i].SetData(m_unfoldTask.arrayPrize[i].nPrizeID, m_unfoldTask.arrayPrize[i].nCount, bFirstWinType, bShowClan, bShowNoHave); } else { m_arrTaskPrizeItem[i].Clear(); } } PrizePopupGo.SetActive(false); }