Ejemplo n.º 1
0
 void SetDissolve(Variant data)//13解散队伍
 {
     A3_TeamModel.getInstance().cidNameElse.Clear();
     joinedTeam = false;
     MyTeamData = null;
     dispatchEvent(GameEvent.Create(EVENT_DISSOLVETEAM, this, data));
 }
        override public void onShowed()
        {
            if (uiData != null)
            {
                cdTime = 30;

                txtCD.text = string.Format(strCD, cdTime);
                //showTime = new TickItem(onUpdates);
                //TickMgr.instance.addTick(showTime);
                CancelInvoke("showtime");
                InvokeRepeating("showtime", 0, 1);
                ItemTeamData itd = (ItemTeamData)uiData[0];
                m_itd = itd;
                string name  = itd.name;
                string carr  = A3_TeamModel.getInstance().getProfessional(itd.carr);
                uint   zhuan = itd.zhuan;
                uint   lvl   = itd.lvl;
                //txtInfor.text = string.Format(txtInfor.text, name, carr, zhuan, lvl);
                txtInfor.text = ContMgr.getCont("a3_teamInvitedPanel_1", new List <string> {
                    name, carr, zhuan.ToString(), lvl.ToString()
                });
            }
            transform.SetAsLastSibling();
            InterfaceMgr.getInstance().closeAllWin(new List <string> {
                this.uiName
            });
        }
Ejemplo n.º 3
0
        private void SetTeamobject_Change(Variant data)//更改队伍目的
        {
            uint ltpid = data["ltpid"];

            if (ltpid == 108 || ltpid == 109 || ltpid == 110 || ltpid == 111)
            {
                A3_TeamModel.getInstance().cidName = A3_TeamModel.getInstance().cidNameElse;
                ArrayList arr = new ArrayList();
                arr.Add(1);
                TeamProxy.getInstance().MyTeamData.ltpid = ltpid;
                A3_TeamModel.getInstance().bein   = true;
                A3_TeamModel.getInstance().ltpids = ltpid;
                //InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_COUNTERPART, arr);
                //a3_counterpart.instance?.transform.SetAsLastSibling();
                //a3_counterpart.instance?.changePos();
                //a3_counterpart.instance?.getGameObjectByPath("currentTeam").SetActive(true);
            }
            //else
            //{
            //    InterfaceMgr.getInstance().close(InterfaceMgr.A3_COUNTERPART);
            //    a3_counterpart.instance?.getGameObjectByPath("currentTeam").SetActive(false);
            //    a3_counterpart.instance?.getGameObjectByPath("haoyou").SetActive(false);
            //    a3_counterpart.instance?.getGameObjectByPath("yaoqing").SetActive(false);
            //}
            dispatchEvent(GameEvent.Create(EVENT_TEAMOBJECT_CHANGE, this, data));
        }
            public itemTeamApplyPanel(Transform trans, ItemTeamData itd)
            {
                m_go = GameObject.Instantiate(trans.gameObject) as GameObject;
                m_go.SetActive(true);
                m_go.transform.SetParent(trans.parent);
                m_go.transform.localScale    = Vector3.one;
                m_go.transform.localPosition = Vector3.zero;
                m_go.transform.SetAsFirstSibling();
                txtInfor   = m_go.transform.FindChild("body/Text").GetComponent <Text>();
                txtCD      = m_go.transform.FindChild("body/txtCD").GetComponent <Text>();
                txtCD.text = string.Format(strCD, cdTime);
                showTime   = new TickItem(onUpdates);
                TickMgr.instance.addTick(showTime);
                BaseButton btnClose  = new BaseButton(m_go.transform.FindChild("title/btnClose"));
                BaseButton btnOk     = new BaseButton(m_go.transform.FindChild("bottom/btnOk"));
                BaseButton btnCancle = new BaseButton(m_go.transform.FindChild("bottom/btnCancle"));

                btnCancle.onClick = onBtnCancleClick;
                btnClose.onClick  = onBtnCloseClick;
                btnOk.onClick     = onBtnOKClick;
                m_itd             = itd;
                string name     = itd.name;
                string carrName = A3_TeamModel.getInstance().getProfessional(itd.carr);
                uint   zhuan    = itd.zhuan;
                uint   lvl      = itd.lvl;

                txtInfor.text = string.Format(txtInfor.text, itd.name, carrName, zhuan, lvl);
                trans.transform.SetAsLastSibling();
            }
Ejemplo n.º 5
0
 void SetLeaveTeam(Variant data)
 {
     MyTeamData = null;
     dispatchEvent(GameEvent.Create(EVENT_LEAVETEAM, this, null));
     A3_TeamModel.getInstance().cidNameElse.Clear();
     MonsterMgr._inst.HideInvaildMonster();
     flytxt.instance.fly(ContMgr.getCont("TeamProxy_hanveout"));
 }
        void onAffirminvite(GameEvent e)
        {
            Variant            data = e.data;
            ItemTeamMemberData itm  = A3_TeamModel.getInstance().AffirmInviteData;

            team_object_change.value = change_v((int)itm.ltpid, false);
            Show(itm);
        }
Ejemplo n.º 7
0
        void SetNewMemberJoin(Variant data)//新成员入队
        {
            uint         cid    = data["cid"];
            string       name   = data["name"];
            uint         lvl    = data["lvl"];
            uint         zhuan  = data["zhuan"];
            uint         carr   = data["carr"];
            uint         combpt = data["combpt"];
            ItemTeamData itd    = new ItemTeamData();

            itd.cid       = cid;
            itd.name      = name;
            itd.lvl       = lvl;
            itd.zhuan     = zhuan;
            itd.carr      = carr;
            itd.combpt    = (int)combpt;
            itd.isCaptain = false;
            itd.online    = true;
            if (MyTeamData.meIsCaptain)
            {
                itd.showRemoveMemberBtn = true;
            }
            else
            {
                itd.showRemoveMemberBtn = false;
            }

            ArrayList array = new ArrayList();

            array.Add(itd);
            bool isNewMember = true;

            for (int i = 0; i < MyTeamData.itemTeamDataList.Count; i++)//断线重连也是新玩家,需要判断下
            {
                if (MyTeamData.itemTeamDataList[i].cid == cid)
                {
                    isNewMember = false;
                    MyTeamData.itemTeamDataList[i].online = true;
                    dispatchEvent(GameEvent.Create(EVENT_NOTICEONLINESTATECHANGE, this, data));//TODO:如果存在则直接派发一个更改在线状态的消息
                    break;
                }
            }
            if (isNewMember)
            {
                MyTeamData.itemTeamDataList.Add(itd);
                flytxt.instance.fly(itd.name + ContMgr.getCont("TeamProxy_add"));
                dispatchEvent(GameEvent.Create(EVENT_NEWMEMBERJOIN, this, data));
            }
            if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(itd.cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Add(itd.cid, itd.name);
            }
        }
Ejemplo n.º 8
0
        void SetCreateTeam(Variant data)
        {
            //teamPosMapid1.Clear();
            if (MyTeamData != null)
            {
                MyTeamData = null; MyTeamData = new ItemTeamMemberData();
            }
            else
            {
                MyTeamData = new ItemTeamMemberData();
            }
            joinedTeam = true;

            uint teamId = data["teamid"];

            ItemTeamData itd = new ItemTeamData();

            itd.name                = PlayerModel.getInstance().name;
            itd.lvl                 = PlayerModel.getInstance().lvl;
            itd.knightage           = PlayerModel.getInstance().clanid.ToString();
            itd.mapId               = PlayerModel.getInstance().mapid;
            itd.MembCount           = 1;
            itd.cid                 = PlayerModel.getInstance().cid;
            itd.zhuan               = PlayerModel.getInstance().up_lvl;
            itd.combpt              = PlayerModel.getInstance().combpt;
            itd.teamId              = teamId;
            itd.isCaptain           = true;
            itd.showRemoveMemberBtn = false;
            itd.online              = true;
            MyTeamData.teamId       = teamId;
            MyTeamData.dirJoin      = true;
            MyTeamData.membInv      = false;
            MyTeamData.leaderCid    = itd.cid;
            MyTeamData.meIsCaptain  = true;
            MyTeamData.ltpid        = data["ltpid"];
            MyTeamData.itemTeamDataList.Add(itd);
            dispatchEvent(GameEvent.Create(EVENT_CREATETEAM, this, data));
            SendEditorInfoDirJoin(true);//是否允许玩家加入
            if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(itd.cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Add(itd.cid, itd.name);
            }
            //if (trage == true)
            //{

            //}
            //点击他人信息组队(若没有队伍先创建在组队)
            if (now_Team)
            {
                TeamProxy.getInstance().SendInvite(trage_cid);
                now_Team = false;
            }
        }
Ejemplo n.º 9
0
        void SetNoticeHaveMemberLeave(Variant data)//22通知有成员离开队伍
        {
            uint cid         = data["cid"];
            int  memberCount = MyTeamData.itemTeamDataList.Count;

            for (int i = 0; i < memberCount; i++)
            {
                if (MyTeamData.itemTeamDataList[i].cid == cid)
                {
                    MyTeamData.itemTeamDataList.Remove(MyTeamData.itemTeamDataList[i]);
                    MyTeamData.removedIndex = (uint)i;
                    dispatchEvent(GameEvent.Create(EVENT_NOTICEHAVEMEMBERLEAVE, this, data));
                    break;
                }
            }
            if (A3_TeamModel.getInstance().cidNameElse.ContainsKey(cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Remove(cid);
            }
        }
Ejemplo n.º 10
0
        void SetKickOut(Variant data)
        {
            uint cid         = data["cid"];
            int  memberCount = MyTeamData.itemTeamDataList.Count;

            for (int i = 0; i < memberCount; i++)
            {
                if (MyTeamData.itemTeamDataList[i].cid == cid)
                {
                    MyTeamData.itemTeamDataList.Remove(MyTeamData.itemTeamDataList[i]);
                    MyTeamData.removedIndex = (uint)i;//踢出的位置
                    dispatchEvent(GameEvent.Create(EVENT_KICKOUT, this, data));
                    break;
                }
            }
            if (A3_TeamModel.getInstance().cidNameElse.ContainsKey(cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Remove(cid);
            }
        }
        private void team_object_dropdownClick(int i)
        {
            if (!A3_TeamModel.getInstance().Limit_Change_Teammubiao(i))
            {
                flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_nofunction"));
                team_object_change.GetComponent <Dropdown>().value = 0;
                return;
            }
            if (TeamProxy.getInstance().MyTeamData != null)
            {
                if (TeamProxy.getInstance().MyTeamData.meIsCaptain == true)
                {
                    TeamProxy.getInstance().sendobject_change(change_v(i, true));
                }
                else
                {
                    string v = "";
                    v = ContMgr.getCont("a3_currentTeamPanel_type" + i);
                    //switch (i)
                    //{
                    //    case 0:
                    //        v = "队伍目标为:自定义";
                    //        break;
                    //    case 1:
                    //        v = "队伍目标为:挂机";
                    //        break;
                    //    case 2:
                    //        v = "队伍目标为:托维尔墓穴";
                    //        break;
                    //    case 3:
                    //        v = "队伍目标为:兽灵秘境";
                    //        break;
                    //    case 4:
                    //        v = "队伍目标为:魔物猎人";
                    //        break;

                    //}
                    flytxt.instance.fly(v);
                }
            }
        }
Ejemplo n.º 12
0
        private void onbtn_1_Click(GameObject go)
        {
            int v = 0;

            object_num = team_object.transform.FindChild("Dropdown").GetComponent <Dropdown>().value;

            if (!A3_TeamModel.getInstance().Limit_Change_Teammubiao(object_num))
            {
                flytxt.instance.fly(ContMgr.getCont("a3_teamPanel_noopen"));
                team_object.transform.FindChild("Dropdown").GetComponent <Dropdown>().value = 0;
                return;
            }
            TeamProxy.getInstance().SendGetMapTeam(begin_index, end_index);
            //switch (object_num)
            //{
            //    case 0:
            //        v = 0;//自定义
            //        break;
            //    case 1:
            //        v = 1;//挂机
            //        break;
            //    case 2://托维尔墓穴
            //        v = 108;
            //        break;
            //    case 3://兽灵秘境
            //        v = 105;
            //        break;
            //    case 4://魔物猎人
            //        v = 2;
            //        break;
            //}
            TeamProxy.getInstance().SendCreateTeam(a3_currentTeamPanel._instance.change_v(object_num, true));
            team_object.SetActive(false);
            if (a3_currentTeamPanel._instance != null)
            {
                a3_currentTeamPanel._instance.team_object.GetComponent <Dropdown>().value = object_num;
            }
        }
Ejemplo n.º 13
0
        void SetNoticeCaptainNewInfo(Variant data)
        {
            uint         cid    = data["cid"];
            string       name   = data["name"];
            uint         lvl    = data["lvl"];
            uint         zhuan  = data["zhuan"];
            uint         carr   = data["carr"];
            uint         combpt = data["combpt"];
            ItemTeamData itd    = new ItemTeamData();

            itd.cid    = cid;
            itd.name   = name;
            itd.lvl    = lvl;
            itd.zhuan  = zhuan;
            itd.carr   = carr;
            itd.combpt = (int)combpt;
            itd.showRemoveMemberBtn = true;
            if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(itd.cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Add(itd.cid, itd.name);
            }
            a3_teamApplyPanel.mInstance.Show(itd);
        }
Ejemplo n.º 14
0
        void creatrveTremOnClick(GameObject go)
        {
            switch (ids)
            {
            case 0:
                mapid = 0;
                break;

            case 1:
                mapid = 1;
                break;

            case 2:
                mapid = 2;
                break;

            case 3:
                mapid = 108;
                break;

            case 4:
                mapid = 105;
                break;
            }
            if (!A3_TeamModel.getInstance().Limit_Change_Teammubiao(ids))
            {
                flytxt.instance.fly(ContMgr.getCont("a3_teamPanel_noopen"));
                return;
            }
            else
            {
                TeamProxy.getInstance().SendGetMapTeam(begin_index, end_index);
                TeamProxy.getInstance().SendCreateTeam(mapid);
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_SPEEDTEAM);
            }
        }
Ejemplo n.º 15
0
        void SetAffirmInvite(Variant data)//10 确认邀请
        {
            ItemTeamMemberData AffirmInviteData = new ItemTeamMemberData();

            if (data.ContainsKey("cofirmed"))
            {
                bool cofirmed = data["cofirmed"]; AffirmInviteData.cofirmed = cofirmed;
            }
            if (data.ContainsKey("tid"))
            {
                uint tid = data["tid"];
                AffirmInviteData.teamId = tid;
                List <ItemTeamData> itdList  = new List <ItemTeamData>();
                List <Variant>      plysList = data["plys"]._arr;
                uint leaderCid = data["leader_cid"];
                bool dirJoin   = data["dir_join"];
                bool membInv   = data["memb_inv"];
                uint ltpid     = data["ltpid"];
                AffirmInviteData.ltpid     = ltpid;
                AffirmInviteData.leaderCid = leaderCid;
                AffirmInviteData.dirJoin   = dirJoin;
                AffirmInviteData.membInv   = membInv;
                if (MyTeamData == null)
                {
                    MyTeamData = new ItemTeamMemberData();
                }

                MyTeamData.teamId    = tid;
                MyTeamData.leaderCid = leaderCid;
                MyTeamData.dirJoin   = dirJoin;
                MyTeamData.membInv   = membInv;
                MyTeamData.ltpid     = ltpid;
                foreach (Variant pl in plysList)
                {
                    uint         cid    = pl["cid"];
                    string       name   = pl["name"];
                    uint         lvl    = pl["lvl"];
                    uint         zhuan  = pl["zhuan"];
                    uint         combpt = pl["combpt"];
                    uint         carr   = pl["carr"];
                    bool         online = pl["online"];
                    ItemTeamData itd    = new ItemTeamData();
                    itd.cid                 = cid;
                    itd.name                = name;
                    itd.lvl                 = lvl;
                    itd.zhuan               = zhuan;
                    itd.combpt              = (int)combpt;
                    itd.carr                = carr;
                    itd.online              = online;
                    itd.isCaptain           = leaderCid == cid ? true : false;
                    itd.showRemoveMemberBtn = false;
                    itdList.Add(itd);
                    MyTeamData.itemTeamDataList.Add(itd);
                    if ((ltpid == 108 || ltpid == 109 || ltpid == 110 || ltpid == 111) && !A3_TeamModel.getInstance().cidName.ContainsKey(cid))
                    {
                        A3_TeamModel.getInstance().cidName.Add(cid, name);
                    }
                    if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(cid))
                    {
                        A3_TeamModel.getInstance().cidNameElse.Add(cid, name);
                    }
                }
                if (ltpid == 108 || ltpid == 109 || ltpid == 110 || ltpid == 111)//组队副本直接跳到组队页面
                {
                    //ArrayList arr = new ArrayList();
                    //arr.Add(1);
                    //InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_COUNTERPART, arr);
                    //a3_counterpart.instance?.transform.SetAsLastSibling();
                    //a3_counterpart.instance?.getGameObjectByPath("currentTeam").SetActive(true);
                    A3_TeamModel.getInstance().bein   = true;
                    A3_TeamModel.getInstance().ltpids = ltpid;
                }
                //服务器返回的是不包含自己在内的人,需要把自己加进去
                ItemTeamData itdSelf = new ItemTeamData();
                itdSelf.cid                 = PlayerModel.getInstance().cid;
                itdSelf.name                = PlayerModel.getInstance().name;
                itdSelf.lvl                 = PlayerModel.getInstance().lvl;
                itdSelf.zhuan               = PlayerModel.getInstance().up_lvl;
                itdSelf.combpt              = (int)PlayerModel.getInstance().combpt;
                itdSelf.carr                = (uint)PlayerModel.getInstance().profession;
                itdSelf.online              = true;
                itdSelf.isCaptain           = false;
                itdSelf.showRemoveMemberBtn = false;
                itdSelf.ltpid               = data["ltpid"];
                itdList.Add(itdSelf);

                AffirmInviteData.itemTeamDataList = itdList;
                MyTeamData.itemTeamDataList.Add(itdSelf);
                A3_TeamModel.getInstance().AffirmInviteData = AffirmInviteData;
                dispatchEvent(GameEvent.Create(EVENT_AFFIRMINVITE, this, data));
                joinedTeam = true;
                MonsterMgr._inst.RefreshVaildMonster();
            }
        }