Exemplo n.º 1
0
        public new void init()
        {
            friendList._instance = this;
            this.root            = toggleGropFriendBase.mTransform.FindChild("mainBody/myFriendsPanel");
            BaseButton baseButton  = new BaseButton(this.root.FindChild("right/bottom/btnClickOnceAddFriend"), 1, 1);
            BaseButton baseButton2 = new BaseButton(this.root.FindChild("right/bottom/btnAddFriend"), 1, 1);

            this.showOnlineFriends = this.root.FindChild("right/bottom/Toggle").GetComponent <Toggle>();
            this.showOnlineFriends.onValueChanged.AddListener(new UnityAction <bool>(this.onShowOnlineFriendsChanged));
            this.personalsPanel = this.root.FindChild("hidPanels/personalsPanel");
            BaseButton baseButton3 = new BaseButton(this.personalsPanel.FindChild("bottom/btnSelectAll"), 1, 1);

            this.btnAdd = new BaseButton(this.personalsPanel.FindChild("bottom/btnAdd"), 1, 1);
            BaseButton baseButton4 = new BaseButton(this.personalsPanel.FindChild("title/btnClose"), 1, 1);

            baseButton4.onClick  = new Action <GameObject>(this.onPersonalPanelClose);
            this.btnAdd.onClick  = new Action <GameObject>(this.onAddAllSelectClick);
            baseButton3.onClick  = new Action <GameObject>(this.onSelectAllClick);
            this.addFriendsPanel = this.root.FindChild("hidPanels/addFriendsPanel");
            BaseButton baseButton5 = new BaseButton(this.addFriendsPanel.transform.FindChild("bottom/btnAdd"), 1, 1);

            this.iptfAFPName = this.addFriendsPanel.transform.FindChild("main/InputField").GetComponent <InputField>();
            BaseButton baseButton6 = new BaseButton(this.addFriendsPanel.transform.FindChild("bottom/btnCancel"), 1, 1);
            BaseButton baseButton7 = new BaseButton(this.addFriendsPanel.transform.FindChild("title/btnClose"), 1, 1);

            this.friendLimit    = this.root.FindChild("right/main/body/firendsCount/count").GetComponent <Text>();
            this.containt       = this.root.FindChild("right/main/body/scroll/contains");
            this.contains       = this.containt.GetComponent <RectTransform>();
            this.addFriend      = this.root.FindChild("hidPanels/personalsPanel/main/scroll/containts");
            baseButton.onClick  = new Action <GameObject>(this.onBtnClickOnceAddFriendClick);
            baseButton2.onClick = new Action <GameObject>(this.onBtnAddFriendClick);
            baseButton5.onClick = new Action <GameObject>(this.onBtnAdd);
            baseButton6.onClick = new Action <GameObject>(this.onBtnAFPClose);
            baseButton7.onClick = new Action <GameObject>(this.onBtnAFPClose);
            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_FRIENDLIST, new Action <GameEvent>(this.onFriendList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_BLACKLIST, new Action <GameEvent>(this.onBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ENEMYLIST, new Action <GameEvent>(this.onEnemyList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_RECOMMEND, new Action <GameEvent>(this.onRecommendList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEFRIEND, new Action <GameEvent>(this.onDeleteFriend));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_RECEIVEADDBLACKLIST, new Action <GameEvent>(this.onReceiveAddBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_AGREEAPLYRFRIEND, new Action <GameEvent>(this.onAgreeAplyFriend));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEENEMY, new Action <GameEvent>(this.onDeleteEnemy));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ENEMYPOSTION, new Action <GameEvent>(this.onEnemyPostion));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEBLACKLIST, new Action <GameEvent>(this.onDeleteBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_REMOVENEARYBY, new Action <GameEvent>(this.onRemoveNearybyLeave));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ADDNEARYBY, new Action <GameEvent>(this.onAddNearbyPeople));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_REFRESHNEARYBY, new Action <GameEvent>(this.onFreshNearby));
        }
Exemplo n.º 2
0
 public static void init()
 {
     toggleGropFriendBase.mFriendList          = new friendList();
     toggleGropFriendBase.mBlackList           = new blackList();
     toggleGropFriendBase.mEnemyList           = new enemyList();
     toggleGropFriendBase.mNeighborList        = new neighborList();
     toggleGropFriendBase.mToggleGropFriend    = new toggleGropFriend();
     toggleGropFriendBase.mRecommendList       = new recommendList();
     toggleGropFriendBase.addToBalckListWaring = new AddToBalckListWaring();
     toggleGropFriendBase.actionBlackListPanel = new actionBlackListPanelPrefab();
     toggleGropFriendBase._actionEnemyPanel    = new actionEnemyPanel();
     toggleGropFriendBase._actionEnemyPanel.init();
     toggleGropFriendBase.actionBlackListPanel.init();
     toggleGropFriendBase.mRecommendList.init();
     toggleGropFriendBase.mFriendList.init();
     toggleGropFriendBase.mBlackList.init();
     toggleGropFriendBase.mEnemyList.init();
     toggleGropFriendBase.mNeighborList.init();
     toggleGropFriendBase.mToggleGropFriend.init();
     toggleGropFriendBase.app.init();
     toggleGropFriendBase.anpp.init();
     toggleGropFriendBase.addToBalckListWaring.init();
 }
Exemplo n.º 3
0
        private void setAgreeAplyFriend(Variant data)
        {
            itemFriendData itemFriendData = default(itemFriendData);

            itemFriendData.cid   = data["cid"]._uint;
            itemFriendData.name  = data["name"]._str;
            itemFriendData.carr  = data["carr"]._uint;
            itemFriendData.lvl   = data["lvl"]._int;
            itemFriendData.zhuan = data["zhuan"]._uint;
            bool flag = data.ContainsKey("mlzd_diff");

            if (flag)
            {
                itemFriendData.mlzd_lv = data["mlzd_diff"]._int;
            }
            itemFriendData.clan_name = (string.IsNullOrEmpty(data["clan_name"]._str) ? "无" : data["clan_name"]._str);
            itemFriendData.combpt    = data["combpt"]._uint;
            itemFriendData.online    = data["online"]._bool;
            bool flag2 = !itemFriendData.online;

            if (flag2)
            {
                itemFriendData.map_id = -1;
            }
            bool flag3 = data.ContainsKey("map_id");

            if (flag3)
            {
                itemFriendData.map_id = data["map_id"]._int;
            }
            bool flag4 = data.ContainsKey("llid");

            if (flag4)
            {
                itemFriendData.llid = (uint)data["llid"]._int;
            }
            itemFriendData.isNew = false;
            this.FriendDataList[data["cid"]._uint] = itemFriendData;
            bool flag5 = this.requestFriendListNoAgree.Contains(itemFriendData.name);

            if (flag5)
            {
                flytxt.instance.fly(itemFriendData.name + "已同意了您的好友申请.", 0, default(Color), null);
                this.requestFriendListNoAgree.Remove(itemFriendData.name);
            }
            else
            {
                flytxt.instance.fly(itemFriendData.name + "与您已成为好友.", 0, default(Color), null);
            }
            bool flag6 = this.BlackDataList.ContainsKey(itemFriendData.cid);

            if (flag6)
            {
                this.sendRemoveBlackList(itemFriendData.cid);
            }
            base.dispatchEvent(GameEvent.Create(FriendProxy.EVENT_AGREEAPLYRFRIEND, this, data, false));
            friendList expr_24D = friendList._instance;

            if (expr_24D != null)
            {
                expr_24D.onShowOnlineFriendsChanged(true);
            }
        }