Exemple #1
0
        public void OnRecevKinApplyList(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            m_ApplyListHead = helper.get <GameLogic.cmd_kin_applylist_head>();

            m_ApplyListNode.Clear();
            for (int i = 0; i < m_ApplyListHead.nCount; ++i)
            {
                GameLogic.cmd_kin_applylist_node cmdNodeData = helper.get <GameLogic.cmd_kin_applylist_node>();
                // 添加到数据管理中心
                m_ApplyListNode.Add(cmdNodeData);
            }
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_KIN_RECEV_APPLY_LIST, null);
        }
Exemple #2
0
        public void OnRecevKinApplyList()
        {
            ListKinAcceptMember.DataSource.Clear();
            ListKinAcceptMember.OnSelect.RemoveListener(onSelectKin);

            UIWidgets.ObservableList <UListItemKinAcceptMember> dataSource = new UIWidgets.ObservableList <UListItemKinAcceptMember>();
            GameLogic.cmd_kin_applylist_head cmdHead       = LogicDataCenter.kinDataManager.ApplyListHead;
            List <cmd_kin_applylist_node>    ApplyListNode = LogicDataCenter.kinDataManager.ApplyListNode;

            ListKinAcceptMember.DataSource.Clear();
            for (int i = 0; i < cmdHead.nCount; ++i)
            {
                GameLogic.cmd_kin_applylist_node cmdNodeData = ApplyListNode[i];
                UListItemKinAcceptMember         item        = new UListItemKinAcceptMember();
                item.PlayerID   = cmdNodeData.nPlayerPDBID;
                item.PersonName = cmdNodeData.szName;
                item.Level     += cmdNodeData.nLevel;
                item.Power     += cmdNodeData.nPower;
                dataSource.Add(item);
            }

            ListKinAcceptMember.DataSource = dataSource;
            ListKinAcceptMember.OnSelect.AddListener(onSelectKin);
        }
Exemple #3
0
        public void OnProcessKinApplyMember(IntPtr ptr, int nLen, int nType)
        {
            // 更新成员数据
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            switch ((ProcessKinApply)nType)
            {
            // 添加
            case ProcessKinApply.PKM_APPLY_ADD:
            {
                GameLogic.cmd_kin_applylist_node cmdKinMember = helper.get <GameLogic.cmd_kin_applylist_node>();
                m_ApplyListNode.Add(cmdKinMember);
                m_kinBaseData.nApplyCount++;

                // DIDA
                DIDAAddData msg = new DIDAAddData();
                msg.nDIDATime        = 60;
                msg.nItemID          = (int)EDIDAType.EDIDA_Kin;
                msg.bAllowRepeatItem = true;
                msg.nButtonIconID    = (int)EDIDAType.EDIDA_Kin;
                msg.strTooltip       = ULocalizationService.Instance.Get("UIView", "KinMember", "KinApply");

                KinApplyInfo applyInfo = new KinApplyInfo();
                applyInfo.nApplyID = cmdKinMember.nPlayerPDBID;
                msg.sCustomData    = applyInfo;
                msg.callBack       = (CustomerInfo) =>
                {
                    KinApplyInfo customerInfo = CustomerInfo as KinApplyInfo;
                    UIDialogData toolTipData  = new UIDialogData(
                        title: ULocalizationService.Instance.Get("UIView", "KinMember", "KinApply"),
                        message: String.Format(ULocalizationService.Instance.Get("UIView", "KinMember", "KinApplyDesc"), cmdKinMember.szName),
                        buttons: new UIWidgets.DialogActions()
                        {
                            { ULocalizationService.Instance.Get("UIView", "Common", "ConfirmBtn"), () => { recvKinApplyCallBack(customerInfo, true); return(true); } },
                            { ULocalizationService.Instance.Get("UIView", "Common", "CancelBtn"), () => { recvKinApplyCallBack(customerInfo, false); return(true); } }
                        });

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

                LogicDataCenter.didaDataManager.AddItem(msg);
            }
            break;

            // 删除
            case ProcessKinApply.PKM_APPLY_REMOVE:
            {
                GameLogic.cmd_kin_remove_apply cmdRemoveMember = helper.get <GameLogic.cmd_kin_remove_apply>();
                for (int i = 0; i < m_ApplyListNode.Count; ++i)
                {
                    if (m_ApplyListNode[i].nPlayerPDBID == cmdRemoveMember.nPlayerPDBID)
                    {
                        m_ApplyListNode.RemoveAt(i);
                        m_kinBaseData.nApplyCount--;
                        break;
                    }
                }
            }
            break;
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_KIN_UPDATEAPPLY_TIPS, null);
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_KIN_UPDATE_APPLY_LIST, null);
        }