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(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); }