public void SetData(cmd_mentorship_personshipinfo data) { m_MentorshipID = data.nMentorshipID; m_DesPDBID = data.nPDBID; m_MasterName = data.szName; if (data.nRelationType == (int)EMMentorshipType.emMentorshipType_Formal) { fMasterIcon.enabled = true; fMasterIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_MentorshipMaster, "MasterIcon_1", WndID.WND_ID_SOCIALCONTACT); posDesc.text = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "FormalPosDesc"); } else { fMasterIcon.enabled = false; posDesc.text = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "InnerPosDesc"); } if (popupMenuHandle == null) { popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>(); } UPopupAction popupAction = new UPopupAction(); popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(m_DesPDBID)); if (data.nIsOnline == 0) { string szLeaveLineDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "LeaveLineNameDesc"); szLeaveLineDesc = szLeaveLineDesc.Replace("{1}", data.szName); name.text = szLeaveLineDesc; } else { name.text = data.szName; popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(m_MasterName)); if (data.nRelationType != (int)EMMentorshipType.emMentorshipType_Formal && !LogicDataCenter.mentorshipDataManager.IsFormalMasterFull()) { popupAction.Add(UPopupItemDataApplyFormalPrentice.GetDescString(), new UPopupItemDataApplyFormalPrentice(m_DesPDBID)); } } if (data.nSeverPDBID == 0 || data.nPDBID == data.nSeverPDBID) { popupAction.Add(UPopupItemDataDismissMentorship.GetDescString(), new UPopupItemDataDismissMentorship(m_MentorshipID)); } popupMenuHandle.HandlePopupAction = popupAction; gameObject.SetActive(true); }
public void SetData(cmd_mentorship_issueinfo data) { m_PersonPDBID = data.nPDBID; name.text = data.szName; level.text = data.nLevel.ToString(); stateDesc.text = ""; corpsName.text = (data.szCorpsName == "" ? "暂无" : data.szCorpsName); clanName.text = (data.szClanName == "" ? "暂无" : data.szClanName); issueInfo.text = (data.szIssueInfo == "" ? "暂无留言" : data.szIssueInfo); bgIcon.gameObject.SetActive(true); SetIssueItemStateDesc(LogicDataCenter.mentorshipDataManager.IsPApplyFreezing(m_PersonPDBID)); if (data.bySex < (int)PERSON_SEX.SEX_MAX && data.bySex >= (int)PERSON_SEX.SEX_MALE) { sexIcon.enabled = true; sexIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_SOCIALCONTACT, data.bySex + 1); } else { sexIcon.enabled = false; } if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property != null) { if (m_PersonPDBID == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID)) { m_bIsSelf = true; //bgIcon.sprite = selfBgBorder; bgIcon.gameObject.SetActive(true); } } if (!m_bIsSelf) { if (popupMenuHandle == null) { popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>(); } UPopupAction popupAction = new UPopupAction(); popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(m_PersonPDBID)); popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(data.szName)); popupMenuHandle.HandlePopupAction = popupAction; popupMenuHandle.gameObject.SetActive(true); } gameObject.SetActive(true); }
public void SetData(int mentorshipID, int nPDBID, string szName, int nSeverPDBID, int nOnline, int nRelationType, bool bSelfPrentice) { m_MentorshipID = mentorshipID; m_DesPDBID = nPDBID; m_PrenticeName = szName; m_bSelfPrentice = bSelfPrentice; headIcon.enabled = true; headIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_SOCIALCONTACT, 1, 1); if (popupMenuHandle == null) { popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>(); } UPopupAction popupAction = new UPopupAction(); popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(m_DesPDBID)); if (nOnline == 0) { string szLeaveLineDesc = ULocalizationService.Instance.Get("UIView", "MentorshipPerson", "LeaveLineNameDesc"); szLeaveLineDesc = szLeaveLineDesc.Replace("{1}", szName); name.text = szLeaveLineDesc; } else { UEffectManager.Instance.DestroyEffect(UEffectType.UET_EffectMaterial, ref headIconMatParam); name.text = szName; popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(m_PrenticeName)); if (m_bSelfPrentice && nRelationType != (int)EMMentorshipType.emMentorshipType_Formal && !LogicDataCenter.mentorshipDataManager.IsFormalPrenticeFull()) { popupAction.Add(UPopupItemDataPromotePrentice.GetDescString(), new UPopupItemDataPromotePrentice(m_MentorshipID, m_DesPDBID)); } } if (m_bSelfPrentice && (nSeverPDBID == 0 || nPDBID == nSeverPDBID)) { popupAction.Add(UPopupItemDataDismissMentorship.GetDescString(), new UPopupItemDataDismissMentorship(m_MentorshipID)); } popupMenuHandle.HandlePopupAction = popupAction; gameObject.SetActive(true); }
public void SetData(cmd_legendcup_recv_regist_memberlistnode memeberNode) { KinMemberName.text = memeberNode.szActorName; KinMemberLevel.text = memeberNode.nActorLevel.ToString(); if (memeberNode.nRankIconId != 0) { KinMemberRank.gameObject.SetActive(true); KinMemberRank.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_RankImage, WndID.WND_ID_LEGENDCUP_REGIST, 1, memeberNode.nRankIconId); } else { KinMemberRank.gameObject.SetActive(false); } if (memeberNode.nActorSex < (int)PERSON_SEX.SEX_MAX && memeberNode.nActorSex >= (int)PERSON_SEX.SEX_MALE) { KinMemberSex.gameObject.SetActive(true); KinMemberSex.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_KinSex, WndID.WND_ID_LEGENDCUP_REGIST, memeberNode.nActorSex + 1); } else { KinMemberSex.gameObject.SetActive(false); } // 添加右键弹窗 this.gameObject.RemoveComponent <UPopupMenuHandle>(); UPopupMenuHandle popupMenuHandle = this.gameObject.AddComponent <UPopupMenuHandle>(); if (popupMenuHandle != null) { UPopupAction popupAction = new UPopupAction(); popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)memeberNode.nPDBID)); popupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(memeberNode.uDBID, memeberNode.szActorName)); popupAction.Add(UPopupItemDataAddBlackList.GetDescString(), new UPopupItemDataAddBlackList(memeberNode.uDBID, memeberNode.szActorName)); popupAction.Add(UPopupItemDataCopyName.GetDescString(), new UPopupItemDataCopyName(memeberNode.szActorName)); popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(memeberNode.szActorName)); popupMenuHandle.HandlePopupAction = popupAction; } this.gameObject.SetActive(true); }
// 处理私聊菜单项 private void processPrivateChat(int nEntityID) { U3D_Render.EntityView ev = EntityFactory.getEntityViewByID(nEntityID); if (ev == null) { return; } string szName = ev.Property.CreatureName; if (string.IsNullOrEmpty(szName)) { return; } // 构造弹出菜单列表 UListComponentItemDataPopup item = new UPopupItemDataPrivateChat(szName, _strItemTypeName: UPopupItemDataPrivateChat.GetDescString()); PopupMenuDataManager.Instance.SetPopupItemData(m_PrivateChatInfo, 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); }