Example #1
0
        // 收到邀请加入战队请求
        public void OnRecvKinInvite(IntPtr ptr, int nLen)
        {
            cmd_recv_kin_invite inviteData = IntPtrHelper.toData <cmd_recv_kin_invite>(ptr);

            DIDAAddData msg = new DIDAAddData();

            msg.nDIDATime        = 60;
            msg.nItemID          = (int)EDIDAType.EDIDA_Kin;
            msg.bAllowRepeatItem = false;
            msg.nButtonIconID    = (int)EDIDAType.EDIDA_Kin;
            msg.strTooltip       = ULocalizationService.Instance.Get("UIView", "KinMember", "KinRequest");

            KinInviteInfo inviteInfo = new KinInviteInfo();

            inviteInfo.nInviterID = inviteData.dwInviterPDBID;
            msg.sCustomData       = inviteInfo;
            msg.callBack          = (CustomerInfo) =>
            {
                KinInviteInfo customerInfo = CustomerInfo as KinInviteInfo;
                UIDialogData  toolTipData  = new UIDialogData(
                    title: ULocalizationService.Instance.Get("UIView", "KinMember", "KinRequest"),
                    message: String.Format(ULocalizationService.Instance.Get("UIView", "KinMember", "KinRequestDesc"), inviteData.szKinName, inviteData.szInviteName),
                    buttons: new UIWidgets.DialogActions()
                {
                    { ULocalizationService.Instance.Get("UIView", "Common", "ConfirmBtn"), () => { recvKinInviteCallBack(customerInfo, true); return(true); } },
                    { ULocalizationService.Instance.Get("UIView", "Common", "CancelBtn"), () => { recvKinInviteCallBack(customerInfo, false); return(true); } }
                });

                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, toolTipData);
            };

            LogicDataCenter.didaDataManager.AddItem(msg);
        }
Example #2
0
        // 邀请答复回调
        private void recvKinInviteCallBack(KinInviteInfo info, bool isAgree)
        {
            cmd_kin_answer_Invite data = new cmd_kin_answer_Invite();

            data.dwPDBID  = info.nInviterID;
            data.bIsAgree = isAgree ? 1 : 0;
            ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_KIN_ANSWER_INVITE, ref data);
        }