private void SetPetItems(PetFormationUnit pfu, int formationID) { PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == formationID); if (petFormation == null || petFormation.petFormationArr == null || petFormation.petFormationArr.Int64Array == null) { for (int i = 0; i < 3; i++) { pfu.pets.get_Item(i).SetItem(null, null, false); } } else { for (int j = 0; j < petFormation.petFormationArr.Int64Array.get_Count(); j++) { Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(j); PetInfo petInfo = PetManager.Instance.GetPetInfo(int64IndexValue.value); Pet dataPet = DataReader <Pet> .Get(petInfo.petId); pfu.pets.get_Item(int64IndexValue.index).SetItem(petInfo, dataPet, PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(dataPet)); } for (int k = 0; k < 3; k++) { if (k >= petFormation.petFormationArr.Int64Array.get_Count()) { pfu.pets.get_Item(k).SetItem(null, null, false); } } } }
private void OnClickBtnChangeFormation(GameObject sender) { List <int> formationLvs = PetManager.Instance.GetFormationLvs(); bool flag = false; int changeFormationID = 1; if (PetManager.Instance.CurrentFormationID == 1 && EntityWorld.Instance.EntSelf.Lv >= formationLvs.get_Item(1)) { PetManager.Instance.SendSetCurFormationIdReq(2); changeFormationID = 2; } else if (PetManager.Instance.CurrentFormationID == 1 && EntityWorld.Instance.EntSelf.Lv < formationLvs.get_Item(1)) { string chineseContent = GameDataUtils.GetChineseContent(510092, false); UIManagerControl.Instance.ShowToastText(chineseContent.Replace("{s1}", formationLvs.get_Item(1).ToString())); flag = true; } else if (PetManager.Instance.CurrentFormationID == 2 && EntityWorld.Instance.EntSelf.Lv >= formationLvs.get_Item(2)) { PetManager.Instance.SendSetCurFormationIdReq(3); changeFormationID = 3; } else if (PetManager.Instance.CurrentFormationID == 2 && EntityWorld.Instance.EntSelf.Lv < formationLvs.get_Item(2)) { PetManager.Instance.SendSetCurFormationIdReq(1); changeFormationID = 1; } else if (PetManager.Instance.CurrentFormationID == 3) { PetManager.Instance.SendSetCurFormationIdReq(1); changeFormationID = 1; } if (!flag) { bool flag2 = true; int i; for (i = 1; i <= 3; i++) { PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == i); if (petFormation != null && petFormation.petFormationArr != null && petFormation.petFormationArr.Int64Array != null && petFormation.petFormationArr.Int64Array.get_Count() != 0) { flag2 = false; break; } } if (flag2) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(510093, false)); } else { PetFormation petFormation2 = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == changeFormationID); if (petFormation2 == null || petFormation2.petFormationArr == null || petFormation2.petFormationArr.Int64Array == null || petFormation2.petFormationArr.Int64Array.get_Count() == 0) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(510094, false)); } } } }
private void RefreshPetInfo() { ChangePetChooseUI.limit_pet = false; PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == PetManager.Instance.CurrentFormationID); for (int i = 0; i < this.PetUnitList.get_Count(); i++) { this.PetUnitList.get_Item(i).SetHavePet(false); this.PetUnitList.get_Item(i).SetImageTip(false); } if (petFormation == null || petFormation.petFormationArr == null || petFormation.petFormationArr.Int64Array == null) { for (int j = 0; j < PetManager.Instance.MaplistPet.get_Values().get_Count(); j++) { if (j >= this.PetUnitList.get_Count()) { break; } this.PetUnitList.get_Item(j).SetImageTip(true); } } else { int k; for (k = 0; k < petFormation.petFormationArr.Int64Array.get_Count(); k++) { Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(k); PetInfo petInfo = PetManager.Instance.GetPetInfo(int64IndexValue.value); Pet dataPet = DataReader <Pet> .Get(petInfo.petId); if (k >= this.PetUnitList.get_Count()) { break; } this.SetPet(this.PetUnitList.get_Item(k), dataPet, petInfo); this.PetUnitList.get_Item(k).SetHavePet(true); } for (int l = k; l < PetManager.Instance.MaplistPet.get_Keys().get_Count(); l++) { if (l >= this.PetUnitList.get_Count()) { break; } if (this.CheckCanShowChangePetTip() < l) { break; } this.PetUnitList.get_Item(l).SetImageTip(true); } } }
private void OnGetMatchRoleData(short state, MatchRoleInfo down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { InstanceManager.ChangeInstanceManager(PVPInstance.Instance, false); this.isEnterPVP = true; this.matchData = down; PVPVSUI pVPVSUI = UIManagerControl.Instance.OpenUI("PVPVSUI", UINodesManager.TopUIRoot, false, UIType.NonPush) as PVPVSUI; PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == PetManager.Instance.CurrentFormationID); for (int i = 0; i < 3; i++) { pVPVSUI.MyPets[i].SetActive(false); } if (petFormation != null && petFormation.petFormationArr != null && petFormation.petFormationArr.Int64Array != null) { for (int j = 0; j < petFormation.petFormationArr.Int64Array.get_Count(); j++) { Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(j); PetInfo petInfo = PetManager.Instance.GetPetInfo(int64IndexValue.value); Pet pet = DataReader <Pet> .Get(petInfo.petId); ResourceManager.SetSprite(pVPVSUI.MyPets[int64IndexValue.index].get_transform().Find("Icon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon(pet)); ResourceManager.SetSprite(pVPVSUI.MyPets[int64IndexValue.index].get_transform().Find("Type").GetComponent <Image>(), ResourceManager.GetIconSprite("fight_pet_biaoshi" + pet.function)); pVPVSUI.MyPets[int64IndexValue.index].SetActive(true); } } for (int k = 0; k < 3; k++) { pVPVSUI.OpponentPets[k].SetActive(false); } for (int l = 0; l < down.petInfos.get_Count(); l++) { Pet pet2 = DataReader <Pet> .Get(down.petInfos.get_Item(l).typeId); ResourceManager.SetSprite(pVPVSUI.OpponentPets[l].get_transform().Find("Icon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon(pet2)); ResourceManager.SetSprite(pVPVSUI.OpponentPets[l].get_transform().Find("Type").GetComponent <Image>(), ResourceManager.GetIconSprite("fight_pet_biaoshi" + pet2.function)); pVPVSUI.OpponentPets[l].SetActive(true); } } }
private void PetSelectsIsInstance() { if (this.mMode != PetSelectUI.Mode.Instance) { return; } this.listPetsSelected.Clear(); PetFormation formationData = PetManager.Instance.GetFormationData(this.m_formationId); if (formationData == null) { return; } if (formationData != null && formationData.petFormationArr != null && formationData.petFormationArr.Int64Array != null) { List <long> list = new List <long>(); for (int i = 0; i < formationData.petFormationArr.Int64Array.get_Count(); i++) { for (int j = 0; j < formationData.petFormationArr.Int64Array.get_Count(); j++) { Int64IndexValue int64IndexValue = formationData.petFormationArr.Int64Array.get_Item(j); if (int64IndexValue.index == i) { list.Add(int64IndexValue.value); break; } } } for (int k = 0; k < list.get_Count(); k++) { long num = list.get_Item(k); for (int l = 0; l < this.listPetsShow.get_Count(); l++) { PetInfo petInfo = this.listPetsShow.get_Item(l); if (petInfo.id == num) { this.listPetsSelected.Add(petInfo.id); } } } } }
private void RefreshRight(int formationID) { int num = 0; int num2 = 0; int num3 = 0; PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == formationID); if (petFormation != null && petFormation.petFormationArr != null && petFormation.petFormationArr.Int64Array != null) { PetManager.Instance.GetFormationAddAttrValue(petFormation, out num, out num2, out num3); List <int> list = new List <int>(); for (int i = 0; i < petFormation.petFormationArr.Int64Array.get_Count(); i++) { Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(i); PetInfo petInfo = PetManager.Instance.GetPetInfo(int64IndexValue.value); list.Add(petInfo.petId); } List <ChongWuJiBan> list2 = new List <ChongWuJiBan>(); for (int j = 0; j < DataReader <ChongWuJiBan> .DataList.get_Count(); j++) { bool flag = true; ChongWuJiBan chongWuJiBan = DataReader <ChongWuJiBan> .DataList.get_Item(j); for (int k = 0; k < chongWuJiBan.linkedPetId.get_Count(); k++) { int num4 = chongWuJiBan.linkedPetId.get_Item(k); if (!list.Contains(num4)) { flag = false; break; } } if (flag) { list2.Add(chongWuJiBan); } } if (list2.get_Count() > 0) { for (int l = 0; l < list2.get_Count(); l++) { ChongWuJiBan chongWuJiBan2 = list2.get_Item(l); Transform transform = null; if (l == 0) { transform = this.linkedPet1; } if (l == 2) { transform = this.linkedPet2; } if (l == 3) { transform = this.linkedPet3; } transform.FindChild("Title").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(chongWuJiBan2.name, false)); string text = string.Empty; Attrs attrs = DataReader <Attrs> .Get(chongWuJiBan2.linkedAttrId); for (int m = 0; m < attrs.attrs.get_Count(); m++) { text += AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(m), attrs.values.get_Item(m)); } transform.FindChild("Content").GetComponent <Text>().set_text(text); } if (list2.get_Count() == 1) { this.linkedPet1.get_gameObject().SetActive(true); this.linkedPet2.get_gameObject().SetActive(false); this.linkedPet3.get_gameObject().SetActive(false); } else if (list2.get_Count() == 2) { this.linkedPet1.get_gameObject().SetActive(true); this.linkedPet2.get_gameObject().SetActive(true); this.linkedPet3.get_gameObject().SetActive(false); } else if (list2.get_Count() == 3) { this.linkedPet1.get_gameObject().SetActive(true); this.linkedPet2.get_gameObject().SetActive(true); this.linkedPet3.get_gameObject().SetActive(true); } } } this.Property1.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.Atk) + ":"); this.Property2.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.Defence) + ":"); this.Property3.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.HpLmt) + ":"); this.Property1.FindChild("Value").GetComponent <Text>().set_text(num.ToString()); this.Property2.FindChild("Value").GetComponent <Text>().set_text(num2.ToString()); this.Property3.FindChild("Value").GetComponent <Text>().set_text(num3.ToString()); }
private void OpenGangFightMatchingFinishUI() { this.isMatching = false; UIManagerControl.Instance.UnLoadUIPrefab("MatchingTimeCalUI"); (UIManagerControl.Instance.OpenUI("MatchUI", null, false, UIType.NonPush) as MatchUI).CloseMatchUI(); GangFightMatchingFinishUI gangFightMatchingFinishUI = UIManagerControl.Instance.OpenUI("GangFightMatchingFinishUI", null, false, UIType.NonPush) as GangFightMatchingFinishUI; gangFightMatchingFinishUI.RefreshUI(); PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == PetManager.Instance.CurrentFormationID); for (int i = 0; i < 3; i++) { gangFightMatchingFinishUI.MyPets[i].SetActive(false); } if (petFormation != null && petFormation.petFormationArr != null && petFormation.petFormationArr.Int64Array != null) { for (int j = 0; j < petFormation.petFormationArr.Int64Array.get_Count(); j++) { Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(j); PetInfo petInfo = PetManager.Instance.GetPetInfo(int64IndexValue.value); Pet pet = DataReader <Pet> .Get(petInfo.petId); ResourceManager.SetSprite(gangFightMatchingFinishUI.MyPets[int64IndexValue.index].get_transform().Find("Icon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon(pet)); ResourceManager.SetSprite(gangFightMatchingFinishUI.MyPets[int64IndexValue.index].get_transform().Find("Type").GetComponent <Image>(), ResourceManager.GetIconSprite("fight_pet_biaoshi" + pet.function)); gangFightMatchingFinishUI.MyPets[int64IndexValue.index].SetActive(true); } } for (int k = 0; k < 3; k++) { gangFightMatchingFinishUI.OpponentPets[k].SetActive(false); } for (int l = 0; l < this.gangFightMatchRoleSummary.petInfo.get_Count(); l++) { Pet pet2 = DataReader <Pet> .Get(this.gangFightMatchRoleSummary.petInfo.get_Item(l).petId); ResourceManager.SetSprite(gangFightMatchingFinishUI.OpponentPets[l].get_transform().Find("Icon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon(pet2)); ResourceManager.SetSprite(gangFightMatchingFinishUI.OpponentPets[l].get_transform().Find("Type").GetComponent <Image>(), ResourceManager.GetIconSprite("fight_pet_biaoshi" + pet2.function)); gangFightMatchingFinishUI.OpponentPets[l].SetActive(true); } if (GangFightManager.Instance.gangFightBattleResult != null) { Debug.Log(string.Concat(new object[] { "GangFightManager.Instance.gangFightBattleResult.winnerId ", GangFightManager.Instance.gangFightBattleResult.winnerId, " EntityWorld.Instance.EntSelf.ID ", EntityWorld.Instance.EntSelf.ID })); } else { Debug.Log("GangFightManager.Instance.gangFightBattleResult == null"); } if (GangFightManager.Instance.gangFightBattleResult != null && GangFightManager.Instance.gangFightBattleResult.winnerId == EntityWorld.Instance.EntSelf.ID) { EntityWorld.Instance.EntSelf.ReloadServerBattleState(); InstanceManager.SetIsWaitingEnter(true); } else { InstanceManager.ChangeInstanceManager(GangFightInstance.Instance, false); } }