private void GoToStageDetailDialog(int stageID) { LevelDataItem levelData = Singleton <LevelModule> .Instance.TryGetLevelById(stageID); if (levelData == null) { levelData = new LevelDataItem(stageID); } if (levelData.UnlockPlayerLevel > Singleton <PlayerModule> .Instance.playerData.teamLevel) { object[] replaceParams = new object[] { levelData.UnlockPlayerLevel }; Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_ActivityLock", replaceParams), 2f), UIType.Any); } else { int totalFinishedChanllengeNum = Singleton <LevelModule> .Instance.GetChapterById(levelData.ChapterID).GetTotalFinishedChanllengeNum(levelData.Diffculty); if (levelData.UnlockChanllengeNum > totalFinishedChanllengeNum) { object[] objArray2 = new object[] { levelData.UnlockChanllengeNum }; Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_ChallengeLackLock", objArray2), 2f), UIType.Any); } else { Singleton <MainUIManager> .Instance.ShowPage(new ChapterSelectPageContext(levelData), UIType.Page); } } }
private void AddAllActivityFromMetaData() { this._allWeekDayActivityDict.Clear(); this._allSeriesDict.Clear(); foreach (WeekDayActivityMetaData data in WeekDayActivityMetaDataReader.GetItemList()) { WeekDayActivityDataItem item = new WeekDayActivityDataItem(data.weekDayActivityID); this._allWeekDayActivityDict.Add(data.weekDayActivityID, item); int seriesID = item.GetSeriesID(); if (!this._allSeriesDict.ContainsKey(seriesID)) { this._allSeriesDict.Add(seriesID, new SeriesDataItem(seriesID)); } this._allSeriesDict[seriesID].weekActivityList.Add(item); foreach (int num2 in item.GetLevelIDList()) { if (!this._allLevelDict.ContainsKey(num2) && (LevelMetaDataReader.GetLevelMetaDataByKey(num2) != null)) { LevelDataItem item2 = new LevelDataItem(num2) { ActID = item.GetActivityID(), ChapterID = seriesID }; this._allLevelDict.Add(item2.levelId, item2); } } } }
private void SetupTitle() { this._levelSuccess = Singleton <LevelScoreManager> .Instance.endStatus == 1; this._levelData = Singleton <LevelModule> .Instance.GetLevelById(Singleton <LevelScoreManager> .Instance.LevelId); if (this._levelData == null) { base.view.transform.Find("Title/LevelInfo").gameObject.SetActive(false); } else { base.view.transform.Find("Title/LevelInfo").gameObject.SetActive(true); switch (this._levelData.LevelType) { case 1: { ActDataItem item = new ActDataItem(this._levelData.ActID); base.view.transform.Find("Title/LevelInfo/ActName").GetComponent <Text>().text = item.actTitle + " " + item.actName; break; } case 2: case 3: base.view.transform.Find("Title/LevelInfo/ActName").GetComponent <Text>().text = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(this._levelData.ActID).GetActitityTitle(); break; } base.view.transform.Find("Title/LevelInfo/LevelName").GetComponent <Text>().text = this._levelData.Title; } }
public ChapterSelectPageContext(LevelDataItem levelData) { this._actScrollerSpeedDownRatio = 5f; ContextPattern pattern = new ContextPattern { contextName = "ChapterSelectPageContext", viewPrefabPath = "UI/Menus/Page/Map/ChapterSelectPage", cacheType = ViewCacheType.AlwaysCached }; base.config = pattern; base.findViewSavedInScene = true; this._toShowLevelData = levelData; this._justShowLevelDetail = this._toShowLevelData != null; this._chapterType = levelData.LevelType; switch (this._chapterType) { case 1: this.chapter = Singleton <LevelModule> .Instance.GetChapterById(levelData.ChapterID); this.difficulty = levelData.Diffculty; this._showActIndex = new ActDataItem(levelData.ActID).actIndex; break; case 2: case 3: this._weekDayActivityData = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(levelData.ActID); break; } }
public override ActivityDataItemBase.Status GetStatus() { bool flag = false; if (base._status != ActivityDataItemBase.Status.Unavailable) { if (TimeUtil.Now < base.beginTime) { base._status = ActivityDataItemBase.Status.WaitToStart; } else if (TimeUtil.Now > base.endTime) { base._status = ActivityDataItemBase.Status.Over; } else { base._status = ActivityDataItemBase.Status.InProgress; flag = true; } if ((base._status != ActivityDataItemBase.Status.Unavailable) && (Singleton <PlayerModule> .Instance.playerData.teamLevel < this._metaData.minPlayerLevel)) { base._status = ActivityDataItemBase.Status.Locked; } foreach (int num in this._metaData.levelIDList) { LevelDataItem item = Singleton <LevelModule> .Instance.TryGetLevelById(num); if (item != null) { item.status = !flag ? ((StageStatus)1) : ((StageStatus)2); } } } return(base._status); }
private void InitChapterProgress() { if (this._chapterData.Unlocked) { this._normal_star = 0; List <LevelDataItem> levelList = this._chapterData.GetLevelList(LevelDiffculty.Normal); for (int i = 0; i < levelList.Count; i++) { LevelDataItem item = levelList[i]; if (item.progress > 0) { this._normal_star++; } for (int m = 0; m < item.challengeList.Count; m++) { if (item.challengeList[m].Finished) { this._normal_star++; } } } this._normal_sum = levelList.Count * this._maxStar; this._hard_star = 0; List <LevelDataItem> list2 = this._chapterData.GetLevelList(LevelDiffculty.Hard); for (int j = 0; j < list2.Count; j++) { LevelDataItem item2 = list2[j]; if (item2.progress > 0) { this._hard_star++; } for (int n = 0; n < item2.challengeList.Count; n++) { if (item2.challengeList[n].Finished) { this._hard_star++; } } } this._hard_sum = list2.Count * this._maxStar; this._hell_star = 0; List <LevelDataItem> list3 = this._chapterData.GetLevelList(LevelDiffculty.Hell); for (int k = 0; k < list3.Count; k++) { LevelDataItem item3 = list3[k]; if (item3.progress > 0) { this._hell_star++; } for (int num6 = 0; num6 < item3.challengeList.Count; num6++) { if (item3.challengeList[num6].Finished) { this._hell_star++; } } } this._hell_sum = list3.Count * this._maxStar; } }
private void DoBeginLevel() { if (Singleton <LevelScoreManager> .Instance == null) { Singleton <LevelScoreManager> .Create(); } LevelScoreManager instance = Singleton <LevelScoreManager> .Instance; Transform transform = base.view.transform.Find("LevelDebugPanel"); if (transform != null) { instance.isDebugDynamicLevel = transform.GetComponent <MonoLevelDebug>().useDynamicLevel; } instance.collectAntiCheatData = this._stageBeginRsp.get_is_collect_cheat_data(); instance.signKey = this._stageBeginRsp.get_sign_key(); int progress = !this._stageBeginRsp.get_progressSpecified() ? 0 : ((int)this._stageBeginRsp.get_progress()); LevelDataItem level = !this._stageBeginRsp.get_stage_idSpecified() ? this.level : Singleton <LevelModule> .Instance.GetLevelById((int)this._stageBeginRsp.get_stage_id()); instance.SetLevelBeginIntent(level, progress, this._stageBeginRsp.get_drop_item_list(), this.level.BattleType, this._helperDetailData); this.ResetWaitPacketData(); Singleton <MainUIManager> .Instance.PopTopPageOnly(); ChapterSelectPageContext currentPageContext = Singleton <MainUIManager> .Instance.CurrentPageContext as ChapterSelectPageContext; if (currentPageContext != null) { currentPageContext.OnDoLevelBegin(); } bool toKeepContextStack = Singleton <MainUIManager> .Instance.SceneCanvas is MonoMainCanvas; Singleton <MainUIManager> .Instance.MoveToNextScene("TestLevel01", toKeepContextStack, true, true, null, true); }
public List <LevelDataItem> AddLevel(LevelDataItem m_level) { if (m_level.LevelType == 1) { return(this.AddStoryLevel(m_level)); } return(new List <LevelDataItem> { m_level }); }
private void AddLevelDataItem(LevelDataItem level) { List <LevelDataItem> collection = this._allChapterDict[level.ChapterID].AddLevel(level); this.AllLevelList.AddRange(collection); foreach (LevelDataItem item in collection) { this._allLevelDict.Add(item.levelId, item); } }
private void SetupDropLinks() { Transform transform = base.view.transform.Find("Dialog/Content/DropLinks/Content"); for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); LevelDataItem levelData = (i < this._dropLevelDataList.Count) ? this._dropLevelDataList[i] : null; child.GetComponent <MonoDropLink>().SetupView(levelData, this._customDropLinkCallBack); } }
public ResetLevelDialogContext(LevelDataItem levelData, LevelDetailDialogContextV2 parentDialog) { ContextPattern pattern = new ContextPattern { contextName = "ResetLevelDialogContext", viewPrefabPath = "UI/Menus/Dialog/ResetLevelDialog" }; base.config = pattern; this._levelData = levelData; this._parentDialog = parentDialog; }
public LevelDetailDialogContextV2(LevelDataItem levelData, LevelDiffculty difficulty) { ContextPattern pattern = new ContextPattern { contextName = "LevelDetailDialogContext1", viewPrefabPath = "UI/Menus/Dialog/LevelDetailDialogV2", ignoreNotify = false }; base.config = pattern; this.levelData = levelData; this.difficulty = difficulty; base.uiType = UIType.SpecialDialog; }
public LevelPreparePageContext(LevelDataItem level) { ContextPattern pattern = new ContextPattern { contextName = "LevelPreparePageContext", viewPrefabPath = "UI/Menus/Page/Map/LevelPreparePage", cacheType = ViewCacheType.AlwaysCached }; base.config = pattern; this.level = level; this._playerUidToShow = -1; this._isWaitingLevelBegin = false; this._showDataList = new List <FriendBriefDataItem>(); }
private List <LevelDataItem> AddStoryLevel(LevelDataItem m_level) { List <LevelDataItem> list = new List <LevelDataItem>(); foreach (int num in LevelMetaDataReaderExtend.GetChapterLevelIdList(m_level.ChapterID)) { LevelDataItem item = (m_level.levelId != num) ? new LevelDataItem(num) : m_level; if (!this._chapterLevelDict.ContainsKey(item.Diffculty)) { this._chapterLevelDict.Add(item.Diffculty, new List <LevelDataItem>()); } this._chapterLevelDict[item.Diffculty].Add(item); list.Add(item); } return(list); }
private void DoBeginLevel(StageBeginRsp rsp) { if (Singleton <LevelScoreManager> .Instance == null) { Singleton <LevelScoreManager> .Create(); } Singleton <LevelScoreManager> .Instance.collectAntiCheatData = rsp.get_is_collect_cheat_data(); Singleton <LevelScoreManager> .Instance.signKey = rsp.get_sign_key(); LevelDataItem level = Singleton <LevelModule> .Instance.TryGetLevelById(0x2775); Singleton <LevelScoreManager> .Instance.SetLevelBeginIntent(level, 0, rsp.get_drop_item_list(), level.BattleType, null); if (this._loadingWheelDialogContext != null) { this._loadingWheelDialogContext.Finish(); } Singleton <MainUIManager> .Instance.MoveToNextScene("TestLevel01", false, true, true, null, false); }
public void SetupView(LevelDataItem levelData, Action <LevelDataItem> customeLevelClickCallBack = null) { this._levelData = levelData; this._customeLevelClickCallBack = customeLevelClickCallBack; if (levelData == null) { base.gameObject.SetActive(false); } else { base.gameObject.SetActive(true); bool flag = (levelData.status != 1) && (levelData.UnlockPlayerLevel <= Singleton <PlayerModule> .Instance.playerData.teamLevel); base.transform.Find("Open").gameObject.SetActive(flag); base.transform.Find("Lock").gameObject.SetActive(!flag); Text text = !flag?base.transform.Find("Lock/Text").GetComponent <Text>() : base.transform.Find("Open/Text").GetComponent <Text>(); text.text = levelData.StageName; Button component = base.transform.Find("Open").GetComponent <Button>(); component.onClick.RemoveAllListeners(); component.onClick.AddListener(new UnityAction(this.OnDropLinkBtnClick)); } }
private void SetupLevelList(Action <LevelDataItem> onDropLinkClick) { this._dropLevelDataList = new List <LevelDataItem>(); this._customDropLinkCallBack = onDropLinkClick; List <int> dropList = this.dropItem.GetDropList(); List <uint> levelIDList = new List <uint>(); foreach (int num in dropList) { LevelDataItem item = Singleton <LevelModule> .Instance.TryGetLevelById(num); if (item == null) { item = new LevelDataItem(num); } this._dropLevelDataList.Add(item); if (!item.dropDisplayInfoReceived) { levelIDList.Add((uint)item.levelId); } } if (< > f__am$cache3 == null) {
private void SetupStatusTab() { GameObject gameObject = base.view.transform.Find("Dialog/StatusTab").gameObject; Button component = base.view.transform.Find("Dialog/TabBtns/TabBtn_1").GetComponent <Button>(); this._tabManager.SetTab("StatusTab", component, gameObject); this._levelScoreManager = Singleton <LevelScoreManager> .Instance; if ((this._levelScoreManager.isTryLevel || this._levelScoreManager.isDebugLevel) || (this._levelScoreManager.LevelType == 4)) { this.SetupViewForTryOrDebugLevel(); } else { string str; this._levelData = Singleton <LevelModule> .Instance.GetLevelById(this._levelScoreManager.LevelId); if (this._levelData.LevelType == 1) { string[] textArray1 = new string[] { this._levelScoreManager.chapterTitle, " ", this._levelScoreManager.actTitle, " ", this._levelScoreManager.stageName, " ", this._levelScoreManager.LevelTitle }; str = string.Concat(textArray1); } else { str = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(this._levelData.ActID).GetActitityTitle() + " " + this._levelData.Title; } base.view.transform.Find("Dialog/StatusTab/Content/Title/Text").GetComponent <Text>().text = str; base.view.transform.Find("Dialog/StatusTab/Content/CurrentGetItems/Scoin/Num").GetComponent <Text>().text = Mathf.FloorToInt(this._levelScoreManager.scoinInside).ToString(); Transform transform = base.view.transform.Find("Dialog/StatusTab/Content/CurrentGetItems/Items"); this._dropItemList = this._levelScoreManager.GetDropListToShow(); transform.gameObject.SetActive(this._dropItemList.Count > 0); this._dropGridScroller = transform.Find("ScrollView").GetComponent <MonoGridScroller>(); this._dropGridScroller.Init(new MonoGridScroller.OnChange(this.OnScrollerChange), this._dropItemList.Count, null); bool flag = this._dropItemList.Count > this._dropGridScroller.GetMaxItemCountWithouScroll(); transform.Find("PrevBtn").gameObject.SetActive(flag); transform.Find("NextBtn").gameObject.SetActive(flag); Transform transform2 = base.view.transform.Find("Dialog/StatusTab/Content/ChallengePanel"); List <LevelChallengeDataItem> list = new List <LevelChallengeDataItem>(); LevelScoreManager instance = Singleton <LevelScoreManager> .Instance; LevelMetaData levelMetaDataByKey = LevelMetaDataReader.GetLevelMetaDataByKey(this._levelData.levelId); foreach (int num in instance.configChallengeIds) { LevelChallengeDataItem item = new LevelChallengeDataItem(num, levelMetaDataByKey, 0); list.Add(item); } Dictionary <int, BaseLevelChallenge> dictionary = new Dictionary <int, BaseLevelChallenge>(); foreach (BaseLevelChallenge challenge in Singleton <LevelManager> .Instance.levelActor.GetPlugin <LevelChallengeHelperPlugin>().challengeList) { dictionary[challenge.challengeId] = challenge; } for (int i = 0; i < list.Count; i++) { LevelChallengeDataItem item2 = list[i]; Transform child = transform2.GetChild(i); child.Find("Content").GetComponent <Text>().text = item2.DisplayTarget; bool flag2 = !(dictionary.ContainsKey(item2.challengeId) && !dictionary[item2.challengeId].IsFinished()); bool flag3 = dictionary.ContainsKey(item2.challengeId); child.Find("Achieve").gameObject.SetActive(flag2); child.Find("Unachieve").gameObject.SetActive(!flag2); child.Find("Achieve/CompleteMark").gameObject.SetActive(!flag3); child.Find("Achieve/Progress").gameObject.SetActive(flag3); child.Find("Unachieve/Progress").gameObject.SetActive(flag3); if (flag3) { string localizedText = this.GetLocalizedText(dictionary[item2.challengeId].GetProcessMsg()); child.Find("Achieve/Progress").GetComponent <Text>().text = localizedText; child.Find("Unachieve/Progress").GetComponent <Text>().text = localizedText; } } } }
private void OnDropLinkClick(LevelDataItem levelData) {