private void OnClickBtnEnter(GameObject sender) { if (this.currentInstanceType == 102) { EliteDungeonManager.Instance.SendEliteChallengeReq(this.CfgID); return; } ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(this.currentInstanceID); if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv) { string text = GameDataUtils.GetChineseContent(510114, false); text = text.Replace("{s1}", zhuXianPeiZhi.minLv.ToString()); UIManagerControl.Instance.ShowToastText(text); return; } if (DungeonManager.Instance.GetDungeonInfo(this.currentInstanceID).remainingChallengeTimes == 0) { UIManagerControl.Instance.ShowToastText("当前挑战次数剩余0"); this.OnClickBtnAddTime(null); return; } if (zhuXianPeiZhi.expendVit > EntityWorld.Instance.EntSelf.Energy) { UIManagerControl.Instance.ShowToastText("没有足够的体力"); this.OnClickBtnAddEnergy(null); return; } if (InstanceManagerUI.IsPetLimit()) { return; } DungeonManager.Instance.SendChallengeDungeonReq(this.currentInstanceID); }
private void OnClickBtnNormal(GameObject sender) { ChapterResume chapterResume = DungeonManager.Instance.listChapterResume.Find((ChapterResume a) => a.dungeonType == DungeonType.ENUM.Normal); if (DungeonManager.Instance.NormalData.get_Count() == 0) { DungeonManager.Instance.SendGetDungeonDataReq(chapterResume.chapterId, chapterResume.dungeonType, delegate { this.OnClickBtnNormal(null); }); return; } if (InstanceSelectUI.currentDungeonType == DungeonType.ENUM.Normal) { return; } this.CacheCurrentChapterByType(); if (this.btnChapterNormalCache != 0) { this.RefreshUI(this.btnChapterNormalCache, DungeonType.ENUM.Normal); } else { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(DungeonManager.Instance.GetTheLastInstaceID(InstanceType.DungeonNormal)); this.RefreshUI(DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId).chapterOrder, DungeonType.ENUM.Normal); } UIManagerControl.Instance.HideUI("EliteDungeonUI"); }
public void ShowAccessChannels(int itemId, Action closeCallback = null) { this._ActionClose = closeCallback; this.AccessChannelUIItems.Clear(); Items items = DataReader <Items> .Get(itemId); if (items == null) { return; } this.ItemIcon = GameDataUtils.GetIcon(items.icon); this.ItemIconBg = GameDataUtils.GetItemFrame(items.id); this.ItemName = GameDataUtils.GetItemName(items, true); List <int> getType = items.getType; for (int i = 0; i < getType.get_Count(); i++) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(getType.get_Item(i)); if (zhuXianPeiZhi != null) { OOAccessChannelUIItem o = new OOAccessChannelUIItem { InstanceId = getType.get_Item(i), Icon = ResourceManager.GetIconSprite("i32300_s"), Title = GameDataUtils.GetChineseContent(zhuXianPeiZhi.name, false), TitleDesc = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId).chapterName, false), "fefedc", string.Empty) }; this.AccessChannelUIItems.Add(o); } } }
public void BuyChallengeTimes(int instanceID, Action buyChallengeTimesSuccessCallBack) { this.m_buyChallengeTimesSuccessCallBack = buyChallengeTimesSuccessCallBack; DungeonInfo di = DungeonManager.Instance.GetDungeonInfo(instanceID); if (di == null) { return; } ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); if (di.resetChallengeTimes >= VIPPrivilegeManager.Instance.GetVipTimesByType(4)) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(505118, false), 1f, 1f); return; } LeiXingXiaoHaoBiao leiXingXiaoHaoBiao = DataReader <LeiXingXiaoHaoBiao> .DataList.Find((LeiXingXiaoHaoBiao a) => a.ID == 1 && a.resetTime == di.resetChallengeTimes + 1); int needGoodNum = leiXingXiaoHaoBiao.needGoodNum; string text = GameDataUtils.GetChineseContent(505071, false); text = text.Replace("x{0}", needGoodNum.ToString()); text = text.Replace("x{1}", zhuXianPeiZhi.num.ToString()); text = text.Replace("x{2}", (VIPPrivilegeManager.Instance.GetVipTimesByType(4) - di.resetChallengeTimes).ToString()); text = text.Replace("x{3}", VIPPrivilegeManager.Instance.GetVipTimesByType(4).ToString()); DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(500032, false), text, delegate { }, delegate { DungeonManager.Instance.SendResetChallengeTimesReq(instanceID); }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true); }
public static void OpenInstanceUI(int instanceID, bool hideTheVisible = false, UIType type = UIType.FullScreen) { InstanceManagerUI.InstanceID = instanceID; ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); int chapterID = zhuXianPeiZhi.chapterId; ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .Get(chapterID); List <ChapterInfo> dataByInstanceType = DungeonManager.Instance.GetDataByInstanceType(zhuXianZhangJiePeiZhi.chapterType); if (dataByInstanceType.get_Count() == 0 || dataByInstanceType.Find((ChapterInfo a) => a.chapterId == chapterID) == null) { DungeonManager.Instance.SendGetDungeonDataReq(chapterID, (DungeonType.ENUM)zhuXianZhangJiePeiZhi.chapterType, delegate { InstanceManagerUI.OpenInstanceUI(instanceID, hideTheVisible, type); }); return; } FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID); if (fuBenJiChuPeiZhi.type == 103) { InstanceSelectUI instanceSelectUI = UIManagerControl.Instance.OpenUI("InstanceSelectUI", null, true, UIType.FullScreen) as InstanceSelectUI; instanceSelectUI.RefreshUIByInstanceID(instanceID); } else { InstanceSelectUI instanceSelectUI2 = UIManagerControl.Instance.OpenUI("InstanceSelectUI", null, true, UIType.FullScreen) as InstanceSelectUI; instanceSelectUI2.RefreshUIByInstanceID(instanceID); InstanceDetailUI instanceDetailUI = UIManagerControl.Instance.OpenUI("InstanceDetailUI", null, false, UIType.Pop) as InstanceDetailUI; instanceDetailUI.RefreshUI(instanceID); } }
private void OnClickBtnMulti(GameObject sender) { ChapterResume chapterResume = DungeonManager.Instance.listChapterResume.Find((ChapterResume a) => a.dungeonType == DungeonType.ENUM.Team); if (DungeonManager.Instance.TeamData.get_Count() == 0) { DungeonManager.Instance.SendGetDungeonDataReq(chapterResume.chapterId, chapterResume.dungeonType, delegate { this.OnClickBtnMulti(null); }); return; } if (InstanceSelectUI.currentDungeonType == DungeonType.ENUM.Team) { return; } this.CacheCurrentChapterByType(); if (this.btnChapterMultiCache != 0) { this.RefreshUI(this.btnChapterMultiCache, DungeonType.ENUM.Team); } else { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(DungeonManager.Instance.GetTheLastInstaceID(InstanceType.DungeonMutiPeople)); this.RefreshUI(DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId).chapterOrder, DungeonType.ENUM.Team); } }
public bool IsFinish(int instanceID) { if (instanceID <= 0) { return(false); } FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID); if (fuBenJiChuPeiZhi == null) { return(false); } List <ChapterInfo> dataByInstanceType = this.GetDataByInstanceType(fuBenJiChuPeiZhi.type); if (dataByInstanceType == null) { return(false); } ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); if (zhuXianPeiZhi == null) { return(false); } ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId); if (zhuXianZhangJiePeiZhi == null) { return(false); } if (zhuXianZhangJiePeiZhi.chapterOrder - 1 < 0 || zhuXianZhangJiePeiZhi.chapterOrder - 1 >= dataByInstanceType.get_Count()) { return(false); } ChapterInfo chapterInfo = dataByInstanceType.get_Item(zhuXianZhangJiePeiZhi.chapterOrder - 1); for (int i = 0; i < chapterInfo.dungeons.get_Count(); i++) { if (instanceID == chapterInfo.dungeons.get_Item(i).dungeonId) { return(chapterInfo.dungeons.get_Item(i).clearance); } } return(false); }
private void SetConsummation() { this.descs.Clear(); List <uint> list = new List <uint>(); if (InstanceManager.CurrentInstance.Type == InstanceType.DungeonNormal) { if (DungeonManager.Instance.ChallengeData != null) { list = DungeonManager.Instance.ChallengeData.condIdsPassed; } } else if (InstanceManager.CurrentInstance.Type == InstanceType.DungeonElite) { } for (int i = 0; i < list.get_Count(); i++) { this.SetStar((int)list.get_Item(i)); } List <int> list2 = new List <int>(); if (InstanceManager.CurrentInstanceData != null) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(InstanceManager.CurrentInstance.InstanceDataID); if (zhuXianPeiZhi != null) { list2 = zhuXianPeiZhi.star; } } for (int j = 0; j < list2.get_Count(); j++) { int num = list2.get_Item(j); if (!list.Contains((uint)num)) { this.SetStar(num); } } BattlePassUIView.Instance.SetConsummation(list.get_Count()); }
public void OnBtnAgainUp() { if (this.againCallback != null) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(InstanceManager.CurrentInstanceDataID); if (zhuXianPeiZhi == null) { return; } if (DungeonManager.Instance.GetDungeonInfo(InstanceManager.CurrentInstanceDataID).remainingChallengeTimes == 0) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(505067, false)); return; } if (EntityWorld.Instance.EntSelf.Energy < zhuXianPeiZhi.expendVit) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(505120, false)); return; } this.againCallback.Invoke(); } }
public static void OpenInstanceSelectUI(int instanceID, bool hideTheVisible = true, UIType type = UIType.FullScreen) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); int chapterId = zhuXianPeiZhi.chapterId; ZhuXianZhangJiePeiZhi datazj = DataReader <ZhuXianZhangJiePeiZhi> .Get(chapterId); ChapterResume chapterResume = DungeonManager.Instance.listChapterResume.Find((ChapterResume a) => a.dungeonType == (DungeonType.ENUM)datazj.chapterType); List <ChapterInfo> dataByInstanceType = DungeonManager.Instance.GetDataByInstanceType(datazj.chapterType); if (dataByInstanceType.get_Count() == 0) { DungeonManager.Instance.SendGetDungeonDataReq(chapterResume.chapterId, chapterResume.dungeonType, delegate { InstanceManagerUI.OpenInstanceSelectUI(instanceID, hideTheVisible, type); }); return; } InstanceManagerUI.LastOpenInstanceID = instanceID; InstanceSelectUI instanceSelectUI = UIManagerControl.Instance.OpenUI("InstanceSelectUI", null, true, UIType.FullScreen) as InstanceSelectUI; instanceSelectUI.RefreshUIByInstanceID(InstanceManagerUI.LastOpenInstanceID); }
public static string GetTaskName(ZhuanZhiRenWu dataRW) { string result = string.Empty; if (dataRW.missionType == 1) { if (dataRW.missionData.get_Count() >= 1) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(dataRW.missionData.get_Item(0)); if (zhuXianPeiZhi != null) { result = string.Format(dataRW.message, GameDataUtils.GetChineseContent(zhuXianPeiZhi.name, false)); } } } else if (dataRW.missionType == 2) { result = dataRW.message; } else if (dataRW.missionType == 3) { if (dataRW.missionData.get_Count() >= 2) { result = string.Format(dataRW.message, GemGlobal.GetGemName(dataRW.missionData.get_Item(0), dataRW.missionData.get_Item(1))); } } else if (dataRW.missionType == 4) { result = dataRW.message; } else if (dataRW.missionType == 5 && dataRW.missionData.get_Count() >= 1) { result = string.Format(dataRW.message, dataRW.missionData.get_Item(0)); } return(result); }
private void OnGetAllDungeonChallengeTimesResetNty(short state, AllDungeonChallengeTimesResetNty down = null) { if (state == 0) { Debug.Log("--------------OnGetAllDungeonChallengeTimesResetNty"); using (Dictionary <int, DungeonInfo> .Enumerator enumerator = this.dicDungeonInfo.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, DungeonInfo> current = enumerator.get_Current(); DungeonInfo value = current.get_Value(); ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(value.dungeonId); current.get_Value().remainingChallengeTimes = zhuXianPeiZhi.num; current.get_Value().resetChallengeTimes = 0; } } EventDispatcher.Broadcast(EventNames.OnGetAllDungeonChallengeTimesResetNty); } else { StateManager.Instance.StateShow(state, 0); } }
public void RefreshUI(int instanceID) { this.currentInstanceID = instanceID; FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID); if (fuBenJiChuPeiZhi != null) { this.currentInstanceType = fuBenJiChuPeiZhi.type; } if (base.get_gameObject().get_activeSelf()) { this.OpenCPC(); } this.BtnClean.get_gameObject().SetActive(true); this.RefreshPetLimit(); ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); this.TextInstanceTitle.set_text(GameDataUtils.GetChineseContent(zhuXianPeiZhi.name, false)); this.TextEnergy.set_text(zhuXianPeiZhi.expendVit.ToString()); this.TextPower.set_text(zhuXianPeiZhi.suitCapabilitie.ToString()); Icon icon = DataReader <Icon> .Get(zhuXianPeiZhi.backgroundPic); if (icon == null) { Debug.LogError("icon == null " + zhuXianPeiZhi.backgroundPic); } ResourceManager.SetTexture(this.ImageMap, icon.icon); this.Condition1.get_gameObject().SetActive(false); this.Condition2.get_gameObject().SetActive(false); this.Condition3.get_gameObject().SetActive(false); List <int> star = zhuXianPeiZhi.star; DungeonInfo dungeonInfo = DungeonManager.Instance.GetDungeonInfo(instanceID); int star2 = dungeonInfo.star; for (int i = 0; i < star.get_Count(); i++) { int num = star.get_Item(i); DungeonStarLv dungeonStarLv = DataReader <DungeonStarLv> .Get(num); if (dungeonStarLv == null) { Debuger.Error("DungeonStarLv 不存在 starID id = " + num, new object[0]); } else if (i == 0) { this.Condition1.get_gameObject().SetActive(true); this.Condition1.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false)); } else if (i == 1) { this.Condition2.get_gameObject().SetActive(true); this.Condition2.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false)); } else if (i == 2) { this.Condition3.get_gameObject().SetActive(true); this.Condition3.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false)); } } if (star2 == 0) { this.ImageStar1_1.get_gameObject().SetActive(true); this.ImageStar1_2.get_gameObject().SetActive(false); this.ImageStar2_1.get_gameObject().SetActive(true); this.ImageStar2_2.get_gameObject().SetActive(false); this.ImageStar3_1.get_gameObject().SetActive(true); this.ImageStar3_2.get_gameObject().SetActive(false); } else if (star2 == 1) { this.ImageStar1_1.get_gameObject().SetActive(false); this.ImageStar1_2.get_gameObject().SetActive(true); this.ImageStar2_1.get_gameObject().SetActive(true); this.ImageStar2_2.get_gameObject().SetActive(false); this.ImageStar3_1.get_gameObject().SetActive(true); this.ImageStar3_2.get_gameObject().SetActive(false); } else if (star2 == 2) { this.ImageStar1_1.get_gameObject().SetActive(false); this.ImageStar1_2.get_gameObject().SetActive(true); this.ImageStar2_1.get_gameObject().SetActive(false); this.ImageStar2_2.get_gameObject().SetActive(true); this.ImageStar3_1.get_gameObject().SetActive(true); this.ImageStar3_2.get_gameObject().SetActive(false); } else if (star2 == 3) { this.ImageStar1_1.get_gameObject().SetActive(false); this.ImageStar1_2.get_gameObject().SetActive(true); this.ImageStar2_1.get_gameObject().SetActive(false); this.ImageStar2_2.get_gameObject().SetActive(true); this.ImageStar3_1.get_gameObject().SetActive(false); this.ImageStar3_2.get_gameObject().SetActive(true); } for (int j = 0; j < this.listDropItems.get_Count(); j++) { Object.Destroy(this.listDropItems.get_Item(j)); } this.listDropItems.Clear(); if (zhuXianPeiZhi.reward.get_Count() > 0) { string text = string.Empty; for (int k = 0; k < zhuXianPeiZhi.reward.get_Count(); k++) { if (zhuXianPeiZhi.reward.get_Item(k).key == EntityWorld.Instance.EntSelf.TypeID) { text = zhuXianPeiZhi.reward.get_Item(k).value; } } if (text != string.Empty) { string[] array = text.Split(new char[] { ',' }); for (int l = 0; l < array.Length; l++) { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("InstanceDropItem"); instantiate2Prefab.get_transform().SetParent(this.Drop); this.listDropItems.Add(instantiate2Prefab); InstanceDropItem component = instantiate2Prefab.GetComponent <InstanceDropItem>(); component.RefreshUI(int.Parse(array[l])); component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickInstanceDropItem); } } } if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type == 102) { this.TextChallengeTime.set_text(GameDataUtils.GetChineseContent(510029, false)); this.TextTimeLast.get_gameObject().SetActive(true); string text2 = GameDataUtils.GetChineseContent(510104, false); text2 = text2.Replace("{s1}", "<color=red>" + dungeonInfo.remainingChallengeTimes.ToString() + "</color>"); this.TextTimeLast.set_text(text2); } else { this.TextChallengeTime.set_text(GameDataUtils.GetChineseContent(510029, false)); this.TextTimeLast.get_gameObject().SetActive(false); } }
public Hashtable CheckLock(int instanceID) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); bool flag = true; if (zhuXianPeiZhi.linkTask != 0 && MainTaskManager.Instance.CurTaskId != zhuXianPeiZhi.linkTask) { flag = false; } bool flag2 = false; string text = GameDataUtils.GetChineseContent(505094, false); for (int i = 0; i < zhuXianPeiZhi.frontInstance.get_Count(); i++) { int num = zhuXianPeiZhi.frontInstance.get_Item(i); if (num != 0 && num != instanceID) { DungeonInfo dungeonInfo = DungeonManager.Instance.GetDungeonInfo(num); if ((dungeonInfo != null && (!dungeonInfo.clearance || !flag)) || dungeonInfo == null) { flag2 = true; FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(num); ZhuXianPeiZhi zhuXianPeiZhi2 = DataReader <ZhuXianPeiZhi> .Get(num); if (fuBenJiChuPeiZhi.type == 101) { text = text + string.Format(GameDataUtils.GetChineseContent(505095, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n"; } else if (fuBenJiChuPeiZhi.type == 102) { text = text + string.Format(GameDataUtils.GetChineseContent(505096, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n"; } else if (fuBenJiChuPeiZhi.type == 103) { text = text + string.Format(GameDataUtils.GetChineseContent(505097, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n"; } } } } text = text.Substring(0, text.get_Length() - 1); if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv) { flag2 = true; } if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv) { text = GameDataUtils.GetChineseContent(510114, false); text = text.Replace("{s1}", zhuXianPeiZhi.minLv.ToString()); } else if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type != 2 || zhuXianPeiZhi.instance != 1) { if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type == 3) { } } Hashtable hashtable = new Hashtable(); hashtable.Add("ISLock", flag2); hashtable.Add("LockReason", text); return(hashtable); }
public void ShowSourceReference(int itemId, Action actionClickGoToItem = null) { SourceReferenceUI.m_actionClickGoToItem = actionClickGoToItem; this.Scroll.set_verticalNormalizedPosition(1f); for (int i = 0; i < this.ListFromItem.get_Count(); i++) { Object.Destroy(this.ListFromItem.get_Item(i)); } this.ListFromItem.Clear(); GridLayoutGroup component = this.Grid.GetComponent <GridLayoutGroup>(); Items items = DataReader <Items> .Get(itemId); if (items == null) { Debug.LogError("GameData.Items no exist, id = " + itemId); return; } ResourceManager.SetSprite(this.Icon.FindChild("ImageIcon").GetComponent <Image>(), GameDataUtils.GetItemIcon(itemId)); ResourceManager.SetSprite(this.Icon.FindChild("ImageFrame").GetComponent <Image>(), GameDataUtils.GetItemFrame(itemId)); this.TextTitle.set_text(GameDataUtils.GetChineseContent(items.name, false)); if (itemId == 5) { this.TextLastNum.set_text(EntityWorld.Instance.EntSelf.CompetitiveCurrency.ToString()); } else { this.TextLastNum.set_text(BackpackManager.Instance.OnGetGoodCount(itemId).ToString()); } List <int> list = new List <int>(); List <int> list2 = new List <int>(); List <int> list3 = new List <int>(); for (int j = 0; j < items.getWay.get_Count(); j++) { int key = items.getWay.get_Item(j); DLuJingShuXing dLuJingShuXing = DataReader <DLuJingShuXing> .Get(key); bool flag = true; if (dLuJingShuXing.systemOpenID != 0) { Hashtable hashtable = this.CheckIsOpen(dLuJingShuXing.systemOpenID); flag = (bool)hashtable.get_Item("isOpen"); } if (flag) { list2.Add(items.getWay.get_Item(j)); } else { list3.Add(items.getWay.get_Item(j)); } } list.AddRange(list2); list.AddRange(list3); int k = 0; while (k < list.get_Count()) { int key2 = list.get_Item(k); DLuJingShuXing dLuJingShuXing2 = DataReader <DLuJingShuXing> .Get(key2); bool flag2 = true; int imageNum = 0; if (dLuJingShuXing2.systemOpenID != 0) { Hashtable hashtable2 = this.CheckIsOpen(dLuJingShuXing2.systemOpenID); flag2 = (bool)hashtable2.get_Item("isOpen"); imageNum = (int)hashtable2.get_Item("openLevel"); } string text = string.Empty; string text2 = string.Empty; text = dLuJingShuXing2.name; text2 = dLuJingShuXing2.desc; GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("EquipFromItem"); GameObject gameObject = instantiate2Prefab.get_transform().FindChild("ImageGo").get_gameObject(); GameObject gameObject2 = instantiate2Prefab.get_transform().FindChild("ImageNotOpen").get_gameObject(); GameObject gameObject3 = instantiate2Prefab.get_transform().FindChild("LevelOpen").get_gameObject(); GameObject gameObject4 = instantiate2Prefab.get_transform().FindChild("ImageBuy").get_gameObject(); ImageNums component2 = instantiate2Prefab.get_transform().FindChild("LevelOpen").FindChild("ImageNum").GetComponent <ImageNums>(); component2.Init(new Vector2(26f, 33f), "font_vip_"); if (dLuJingShuXing2.type == 0) { int num = (int)float.Parse(dLuJingShuXing2.invokeParam); ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(num); if (zhuXianPeiZhi != null) { Hashtable hashtable3 = DungeonManager.Instance.CheckLock(num); bool flag3 = (bool)hashtable3.get_Item("ISLock"); if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv) { instantiate2Prefab.get_transform().FindChild("LevelOpen").FindChild("ImageNum").GetComponent <ImageNums>().SetImageNum(zhuXianPeiZhi.minLv); gameObject3.SetActive(true); gameObject.SetActive(false); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(false); } else if (flag3) { gameObject3.SetActive(false); gameObject.SetActive(false); gameObject2.SetActive(true); gameObject4.get_gameObject().SetActive(false); } else { gameObject3.SetActive(false); gameObject.SetActive(true); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(false); } goto IL_55C; } Debug.LogError(string.Concat(new string[] { "获取途径副本失败:Id =" + num })); } else { if (dLuJingShuXing2.type == 15) { if (flag2) { gameObject3.SetActive(false); gameObject.SetActive(false); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(true); } else { instantiate2Prefab.get_transform().FindChild("LevelOpen").FindChild("ImageNum").GetComponent <ImageNums>().SetImageNum(imageNum); gameObject3.SetActive(true); gameObject.SetActive(false); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(false); } goto IL_55C; } if (flag2) { gameObject3.SetActive(false); gameObject.SetActive(true); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(false); goto IL_55C; } instantiate2Prefab.get_transform().FindChild("LevelOpen").FindChild("ImageNum").GetComponent <ImageNums>().SetImageNum(imageNum); gameObject3.SetActive(true); gameObject.SetActive(false); gameObject2.SetActive(false); gameObject4.get_gameObject().SetActive(false); goto IL_55C; } IL_60D: k++; continue; IL_55C: instantiate2Prefab.get_transform().SetParent(component.get_transform(), false); instantiate2Prefab.get_transform().FindChild("TextTitle").GetComponent <Text>().set_text(text); ResourceManager.SetSprite(instantiate2Prefab.get_transform().FindChild("Icon").FindChild("ImageIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(dLuJingShuXing2.icon)); instantiate2Prefab.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(text2); instantiate2Prefab.set_name(key2.ToString()); instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickFromItem); this.ListFromItem.Add(instantiate2Prefab); goto IL_60D; } }
private void RefreshInstanceItems(int chapter, DungeonType.ENUM dungeonType) { this.ResetItems(); ChapterInfo chapterInfo = this.listData.get_Item(chapter - 1); List <DungeonInfo> list = new List <DungeonInfo>(); list.AddRange(chapterInfo.dungeons); for (int i = 0; i < list.get_Count(); i++) { int num = i; for (int j = i + 1; j < list.get_Count(); j++) { DungeonInfo dungeonInfo = list.get_Item(num); ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo.dungeonId); if (zhuXianPeiZhi == null) { Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo.dungeonId); } else { DungeonInfo dungeonInfo2 = list.get_Item(j); ZhuXianPeiZhi zhuXianPeiZhi2 = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo2.dungeonId); if (zhuXianPeiZhi2 == null) { Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo2.dungeonId); } else if (zhuXianPeiZhi.instance > zhuXianPeiZhi2.instance) { num = j; } } } if (num != i) { XUtility.ListExchange <DungeonInfo>(list, i, num); } } for (int k = 0; k < list.get_Count(); k++) { DungeonInfo di = list.get_Item(k); if (k == 0) { FuBenJiChuPeiZhi icTmp = DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId); ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .DataList.Find((ZhuXianZhangJiePeiZhi a) => a.chapterType == icTmp.type && a.chapterOrder == DataReader <ZhuXianZhangJiePeiZhi> .Get(DataReader <ZhuXianPeiZhi> .Get(di.dungeonId).chapterId).chapterOrder); string chineseContent = GameDataUtils.GetChineseContent(zhuXianZhangJiePeiZhi.chapterName, false); string[] array = chineseContent.Split(new char[] { ' ' }); this.TextChapterTitle.set_text(array[1] + "<size=25>(" + array[0] + ")</size>"); } ZhuXianPeiZhi zhuXianPeiZhi3 = DataReader <ZhuXianPeiZhi> .Get(di.dungeonId); InstancesLayoutItem component; if (zhuXianPeiZhi3.bossInstanceBoss == 1) { GameObject boss = this.GetBoss(); component = boss.GetComponent <InstancesLayoutItem>(); boss.get_transform().SetParent(this.InstancesLayout); boss.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); boss.set_name(di.dungeonId.ToString()); } else { GameObject normal = this.GetNormal(); component = normal.GetComponent <InstancesLayoutItem>(); normal.get_transform().SetParent(this.InstancesLayout); normal.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); normal.set_name(di.dungeonId.ToString()); } component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClcikInstancesLayoutItem); this.listInstanceItem.Add(component); bool isLock = (bool)DungeonManager.Instance.CheckLock(di.dungeonId).get_Item("ISLock"); component.RefreshUI(DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId), isLock, k, di.star); } }
public void RefreshUIByInstanceID(int instanceID) { ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID); this.RefreshUI(DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId).chapterOrder, (DungeonType.ENUM)DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type); }