private void NoticeOnlineStateChange() { int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count; List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList; int count2 = this.itemMemberObjList.Count; for (int i = 0; i < count; i++) { for (int j = 0; j < count2; j++) { bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid; if (flag) { this.itemMemberObjList[j].SetInfo(itemTeamDataList[i], BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain); a3_currentTeamPanel.ItemMemberObj item = this.itemMemberObjList[j]; this.itemMemberObjList.RemoveAt(j); this.itemMemberObjList.Insert(i, item); this.itemMemberObjList[i].root.SetSiblingIndex(i); } } } this.setTeamBuffTxt(); }
private void changeCaptainPos() { int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count; ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData; List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList; int count2 = this.itemMemberObjList.Count; for (int i = 0; i < count; i++) { for (int j = 0; j < this.itemMemberObjList.Count; j++) { bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid; if (flag) { bool isCaptain = itemTeamDataList[i].isCaptain; if (isCaptain) { a3_currentTeamPanel.ItemMemberObj item = this.itemMemberObjList[j]; this.itemMemberObjList.RemoveAt(j); this.itemMemberObjList.Insert(0, item); } } } } for (int k = 0; k < this.itemMemberObjList.Count; k++) { this.itemMemberObjList[k].root.SetSiblingIndex(k); } }
private void onKickOut(GameEvent e) { Variant data = e.data; uint num = data["cid"]; int removedIndex = (int)BaseProxy <TeamProxy> .getInstance().MyTeamData.removedIndex; a3_currentTeamPanel.ItemMemberObj itemMemberObj = this.itemMemberObjList[removedIndex]; this.itemMemberObjList.RemoveAt(removedIndex); this.itemMemberObjList.Add(itemMemberObj); itemMemberObj.ClearInfo(false); for (int i = removedIndex; i < this.itemMemberObjList.Count; i++) { this.itemMemberObjList[i].gameObject.transform.SetSiblingIndex(i); } this.setTeamBuffTxt(); }
private void onNoticeHaveMemberLeave(GameEvent e) { Variant data = e.data; uint num = data["cid"]; int removedIndex = (int)BaseProxy <TeamProxy> .getInstance().MyTeamData.removedIndex; a3_currentTeamPanel.ItemMemberObj itemMemberObj = this.itemMemberObjList[removedIndex]; this.itemMemberObjList.RemoveAt(removedIndex); this.itemMemberObjList.Add(itemMemberObj); itemMemberObj.ClearInfo(false); for (int i = removedIndex; i < this.itemMemberObjList.Count; i++) { this.itemMemberObjList[i].root.SetSiblingIndex(i); } int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count; for (int j = removedIndex; j < count; j++) { ItemTeamData itd = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList[j]; this.itemMemberObjList[j].SetInfo(itd, BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain); } for (int k = count; k < this.itemMemberObjList.Count; k++) { bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain || BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv; if (flag) { this.itemMemberObjList[k].ClearInfo(true); } else { this.itemMemberObjList[k].ClearInfo(false); } } bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain; if (meIsCaptain) { this.togInvite.gameObject.SetActive(true); this.togJoin.gameObject.SetActive(true); bool flag2 = this.togInvite.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv; if (flag2) { this.togInvite.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv; } bool flag3 = this.togJoin.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin; if (flag3) { this.togJoin.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin; } } else { this.togInvite.gameObject.SetActive(false); this.togJoin.gameObject.SetActive(false); } this.setTeamBuffTxt(); ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData; this.Show(myTeamData); }
public void init(Transform trans) { a3_currentTeamPanel._instance = this; this.itemMemberObjList = new List <a3_currentTeamPanel.ItemMemberObj>(); this.txtTeambuff = trans.FindChild("right/bottom/teambuff").GetComponent <Text>(); Transform transform = trans.FindChild("right/main/body/contains"); this.team_object = base.transform.FindChild("right/bottom/team_object/Dropdown").gameObject; this.team_object_change = this.team_object.GetComponent <Dropdown>(); this.team_object_change.onValueChanged.AddListener(new UnityAction <int>(this.team_object_dropdownClick)); for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); a3_currentTeamPanel.ItemMemberObj item = new a3_currentTeamPanel.ItemMemberObj(child); this.itemMemberObjList.Add(item); } this.togInvite = trans.FindChild("right/bottom/togInvite").GetComponent <Toggle>(); this.togJoin = trans.FindChild("right/bottom/togJoin").GetComponent <Toggle>(); this.togInvite.onValueChanged.AddListener(new UnityAction <bool>(this.onTogAgreenAddOtherClick)); this.togJoin.onValueChanged.AddListener(new UnityAction <bool>(this.onTogAgreeOtherApplyClick)); this.materialGrey = Resources.Load <Material>("uifx/uiGray"); this.carrSpriteDic = new Dictionary <uint, Sprite>(); for (int j = 0; j < 3; j++) { bool flag = j == 0; if (flag) { this.carrSpriteDic.Add(2u, Resources.Load <Sprite>("icon/team/warrior_team")); } bool flag2 = j == 1; if (flag2) { this.carrSpriteDic.Add(3u, Resources.Load <Sprite>("icon/team/mage_team")); } bool flag3 = j == 2; if (flag3) { this.carrSpriteDic.Add(5u, Resources.Load <Sprite>("icon/team/assassin_team")); } } BaseButton baseButton = new BaseButton(trans.FindChild("right/bottom/btnQuitTeam"), 1, 1); baseButton.onClick = new Action <GameObject>(this.onBtnQuitTeamClick); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, new Action <GameEvent>(this.onCreateTeam)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, new Action <GameEvent>(this.onAffirminvite)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, new Action <GameEvent>(this.onNewMemberJoin)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, new Action <GameEvent>(this.onNoticeHaveMemberLeave)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, new Action <GameEvent>(this.onChangeTeamInfo)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, new Action <GameEvent>(this.onNoticeHaveMemberLeave)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, new Action <GameEvent>(this.onLeaveTeam)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, new Action <GameEvent>(this.onNoticeOnlineStateChange)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CHANGECAPTAIN, new Action <GameEvent>(this.onChangeCaptain)); BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_TEAMOBJECT_CHANGE, new Action <GameEvent>(this.onChangeTeamObject)); bool flag4 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null; if (flag4) { this.team_object_change.value = this.change_v((int)BaseProxy <TeamProxy> .getInstance().MyTeamData.ltpid, false); } }