public void OnRecvMentorshipApplyAnswer(int cmdID, int nParam, string strParam, IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); GameLogic.cmd_mentorship_request_applyanswer cmdRecvData = helper.get <GameLogic.cmd_mentorship_request_applyanswer>(); ShowAskApplyMentorship(cmdRecvData); }
private void ShowAskApplyMentorship(GameLogic.cmd_mentorship_request_applyanswer cmdData) { if (m_ApplyAnwserList.ContainsKey(cmdData.nSrcPDBID)) { return; } m_ApplyAnwserList.Add(cmdData.nSrcPDBID, cmdData); string szTmpPost = ""; if (cmdData.nRelationType == (int)EMMentorshipType.emMentorshipType_Formal) { if (cmdData.nApplyPost == (int)EMMentorshipPost.emMentorshipPost_Master) { szTmpPost = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "FormalMasterDesc"); } else { szTmpPost = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "FormalPrenticeDesc"); } } else { if (cmdData.nApplyPost == (int)EMMentorshipPost.emMentorshipPost_Prentice) { szTmpPost = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "InternPrenticeDesc"); } else { szTmpPost = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "InternMasterDesc"); } } string szMsg = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "ApplyNameDesc"); szMsg = szMsg.Replace("{1}", cmdData.szSrcName); szMsg = szMsg.Replace("{2}", szTmpPost); string szAgreeDesc = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "AgreeApplyDesc"); string szRefuseDesc = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "RefuseApplyDesc"); DIDAAddData msg = new DIDAAddData(); msg.eLayout = EDIDALayout.EDT_Middle; msg.nDIDATime = 60; msg.nItemID = (int)EDIDAType.EDIDA_Mentorship; msg.bAllowRepeatItem = true; msg.nButtonIconID = (int)EDIDAType.EDIDA_Mentorship; msg.strTooltip = ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "ApplyTitle"); SideButtonDataMentorshipInfo applyInfo = new SideButtonDataMentorshipInfo(); applyInfo.nSrcPDBID = cmdData.nSrcPDBID; msg.sCustomData = applyInfo; msg.callBack = (CustomerInfo) => { SideButtonDataMentorshipInfo customerInfo = CustomerInfo as SideButtonDataMentorshipInfo; UIDialogData toolTipData = new UIDialogData( title: ULocalizationService.Instance.Get("UIView", "MentorshipWnd", "ApplyTitle"), message: szMsg, buttons: new UIWidgets.DialogActions() { { szAgreeDesc, () => { ApplyMentorshipCallBack(customerInfo.nSrcPDBID, true); return(true); } }, { szRefuseDesc, () => { ApplyMentorshipCallBack(customerInfo.nSrcPDBID, false); return(true); } } } ); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, toolTipData); }; LogicDataCenter.didaDataManager.AddItem(msg); }