public void Open(COM_MAIL_TYPE mailType) { this.m_CUIForm = Singleton <CUIManager> .GetInstance().OpenForm(CMailSys.MAIL_FORM_PATH, false, true); if (this.m_CUIForm != null) { this.m_CUIListScriptTab = this.m_CUIForm.transform.FindChild("TopCommon/Panel_Menu/ListMenu").GetComponent <CUIListScript>(); this.m_CUIListScriptTab.SetElementAmount(3); this.m_CUIListScriptTab.GetElemenet(0).transform.FindChild("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mail_Friend"); this.m_CUIListScriptTab.GetElemenet(1).transform.FindChild("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mail_System"); this.m_CUIListScriptTab.GetElemenet(2).transform.FindChild("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mail_MsgCenter"); this.m_CUIListScriptTab.GetElemenet(0).GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mail_TabFriend); this.m_CUIListScriptTab.GetElemenet(1).GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mail_TabSystem); this.m_CUIListScriptTab.GetElemenet(2).GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mail_TabMsgCenter); this.m_panelFri = this.m_CUIForm.transform.FindChild("PanelFriMail").gameObject; this.m_panelSys = this.m_CUIForm.transform.FindChild("PanelSysMail").gameObject; this.m_panelMsg = this.m_CUIForm.transform.FindChild("PanelMsgMail").gameObject; this.m_SysDeleteBtn = this.m_panelSys.transform.FindChild("ButtonGrid/DeleteButton").gameObject; this.m_allReceiveSysButton = this.m_panelSys.transform.FindChild("ButtonGrid/AllReceiveButton").gameObject; this.m_allReceiveFriButton = this.m_panelFri.transform.FindChild("AllReceiveButton").gameObject; this.m_allDeleteMsgCenterButton = this.m_panelMsg.transform.FindChild("AllDeleteButton").gameObject; this.SetUnReadNum(COM_MAIL_TYPE.COM_MAIL_FRIEND, this.m_friUnReadNum); this.SetUnReadNum(COM_MAIL_TYPE.COM_MAIL_SYSTEM, this.m_sysUnReadNum); this.SetUnReadNum(COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE, this.m_msgUnReadNum); this.CurMailType = mailType; } }
public void UpdateMailList(COM_MAIL_TYPE mailtype, ListView <CMail> mailList) { if (this.m_CUIForm == null || mailList == null) { return; } CUIListElementScript cUIListElementScript = null; int currentUTCTime = CRoleInfo.GetCurrentUTCTime(); int num = -1; if (mailtype == 2) { CUIListScript component = this.m_CUIForm.transform.FindChild("PanelFriMail/List").GetComponent <CUIListScript>(); component.SetElementAmount(mailList.get_Count()); for (int i = 0; i < mailList.get_Count(); i++) { cUIListElementScript = component.GetElemenet(i); if (cUIListElementScript != null && cUIListElementScript.gameObject) { this.UpdateListElenment(cUIListElementScript.gameObject, mailList.get_Item(i)); } if (num == -1 && mailList.get_Item(i).subType == 1) { num = i; } } this.m_allReceiveFriButton.CustomSetActive(num >= 0); } else if (mailtype == 1) { CUIListScript component = this.m_CUIForm.transform.FindChild("PanelSysMail/List").GetComponent <CUIListScript>(); component.SetElementAmount(mailList.get_Count()); for (int j = 0; j < mailList.get_Count(); j++) { if (cUIListElementScript != null && cUIListElementScript.gameObject) { this.UpdateListElenment(cUIListElementScript.gameObject, mailList.get_Item(j)); } if (num == -1 && mailList.get_Item(j).subType == 2) { num = j; } } this.m_allReceiveSysButton.CustomSetActive(num >= 0); this.m_SysDeleteBtn.CustomSetActive(mailList.get_Count() > 0); } else if (mailtype == 3) { CUIListScript component = this.m_CUIForm.transform.FindChild("PanelMsgMail/List").GetComponent <CUIListScript>(); component.SetElementAmount(mailList.get_Count()); for (int k = 0; k < mailList.get_Count(); k++) { if (cUIListElementScript != null && cUIListElementScript.gameObject) { this.UpdateListElenment(cUIListElementScript.gameObject, mailList.get_Item(k)); } } this.m_allDeleteMsgCenterButton.CustomSetActive(mailList.get_Count() > 0); } }
public void SetUnReadNum(COM_MAIL_TYPE mailtype, int unReadNum) { if (mailtype == 2) { this.m_friUnReadNum = unReadNum; } else if (mailtype == 1) { this.m_sysUnReadNum = unReadNum; } else if (mailtype == 3) { this.m_msgUnReadNum = unReadNum; } if (this.m_CUIListScriptTab == null) { return; } if (mailtype == 2 && this.m_CUIListScriptTab.GetElemenet(0) != null) { if (unReadNum > 9) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject, enRedDotPos.enTopRight, 0); } else if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject, enRedDotPos.enTopRight, unReadNum); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject); } } else if (mailtype == 1 && this.m_CUIListScriptTab.GetElemenet(1) != null) { if (unReadNum > 9) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject, enRedDotPos.enTopRight, 0); } else if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject, enRedDotPos.enTopRight, unReadNum); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject); } } else if (mailtype == 3 && this.m_CUIListScriptTab.GetElemenet(2) != null) { if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(2).gameObject, enRedDotPos.enTopRight, 0); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(2).gameObject); } } }
public void SetUnReadNum(COM_MAIL_TYPE mailtype, int unReadNum) { if (mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND) { this.m_friUnReadNum = unReadNum; } else if (mailtype == COM_MAIL_TYPE.COM_MAIL_SYSTEM) { this.m_sysUnReadNum = unReadNum; } else if (mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE) { this.m_msgUnReadNum = unReadNum; } if (this.m_CUIListScriptTab != null) { if ((mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND) && (this.m_CUIListScriptTab.GetElemenet(0) != null)) { if (unReadNum > 9) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject, enRedDotPos.enTopRight, 0); } else if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject, enRedDotPos.enTopRight, unReadNum); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(0).gameObject); } } else if ((mailtype == COM_MAIL_TYPE.COM_MAIL_SYSTEM) && (this.m_CUIListScriptTab.GetElemenet(1) != null)) { if (unReadNum > 9) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject, enRedDotPos.enTopRight, 0); } else if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject, enRedDotPos.enTopRight, unReadNum); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(1).gameObject); } } else if ((mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE) && (this.m_CUIListScriptTab.GetElemenet(2) != null)) { if (unReadNum > 0) { CUICommonSystem.AddRedDot(this.m_CUIListScriptTab.GetElemenet(2).gameObject, enRedDotPos.enTopRight, 0); } else { CUICommonSystem.DelRedDot(this.m_CUIListScriptTab.GetElemenet(2).gameObject); } } } }
public void UpdateMailList(COM_MAIL_TYPE mailtype, ListView <CMail> mailList) { if ((this.m_CUIForm != null) && (mailList != null)) { CUIListElementScript elemenet = null; CUIListScript component = null; int num = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().getCurrentTimeSinceLogin(); int num2 = -1; if (mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND) { component = this.m_CUIForm.transform.FindChild("PanelFriMail/List").GetComponent <CUIListScript>(); component.SetElementAmount(mailList.Count); for (int i = 0; i < mailList.Count; i++) { elemenet = component.GetElemenet(i); if ((elemenet != null) && (elemenet.gameObject != null)) { this.UpdateListElenment(elemenet.gameObject, mailList[i]); } if ((num2 == -1) && (mailList[i].subType == 1)) { num2 = i; } } this.m_allReceiveFriButton.CustomSetActive(num2 >= 0); } else if (mailtype == COM_MAIL_TYPE.COM_MAIL_SYSTEM) { this.m_CUIForm.transform.FindChild("PanelSysMail/List").GetComponent <CUIListScript>().SetElementAmount(mailList.Count); for (int j = 0; j < mailList.Count; j++) { if ((elemenet != null) && (elemenet.gameObject != null)) { this.UpdateListElenment(elemenet.gameObject, mailList[j]); } if ((num2 == -1) && (mailList[j].subType == 2)) { num2 = j; } } this.m_allReceiveSysButton.CustomSetActive(num2 >= 0); this.m_deleteBtn.CustomSetActive(mailList.Count > 0); } else if (mailtype == COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE) { this.m_CUIForm.transform.FindChild("PanelMsgMail/List").GetComponent <CUIListScript>().SetElementAmount(mailList.Count); for (int k = 0; k < mailList.Count; k++) { if ((elemenet != null) && (elemenet.gameObject != null)) { this.UpdateListElenment(elemenet.gameObject, mailList[k]); } } this.m_allDeleteMsgCenterButton.CustomSetActive(mailList.Count > 0); } } }
public CMail(COM_MAIL_TYPE mailType, ref CSDT_GETMAIL_RES pkg) { this.mailType = mailType; this.subType = pkg.bMailType; this.mailIndex = pkg.iMailIndex; this.mailState = pkg.bMailState; this.autoDel = (pkg.bAutoDel > 0); this.from = Utility.UTF8Convert(pkg.szFrom); this.sendTime = pkg.dwSendTime; this.subject = Utility.UTF8Convert(pkg.szSubject, (int)pkg.bSubjectLen); }
public CMail(COM_MAIL_TYPE mailType, ref CSDT_GETMAIL_RES pkg) { this.accessUseable = new ListView <CUseable>(); this.mailType = mailType; this.subType = pkg.bMailType; this.mailIndex = pkg.iMailIndex; this.mailState = (COM_MAIL_STATE)pkg.bMailState; this.autoDel = pkg.bAutoDel > 0; this.from = Utility.UTF8Convert(pkg.szFrom); this.sendTime = pkg.dwSendTime; this.subject = Utility.UTF8Convert(pkg.szSubject, pkg.bSubjectLen); }