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 SetTotalDropList(StageEndRsp rsp, out List <DropItem> totalList, out DropItem normalDropItem, out DropItem fastDropItem, out DropItem sonicDropItem) { totalList = Singleton <LevelScoreManager> .Instance.GetTotalDropList(); normalDropItem = null; fastDropItem = null; sonicDropItem = null; List <int> configChallengeIds = Singleton <LevelScoreManager> .Instance.configChallengeIds; LevelMetaData levelMeta = LevelMetaDataReader.TryGetLevelMetaDataByKey((int)rsp.get_stage_id()); foreach (StageSpecialChallengeData data2 in rsp.get_special_challenge_list()) { int num = (int)data2.get_challenge_index(); if (num < configChallengeIds.Count) { LevelChallengeDataItem item = new LevelChallengeDataItem(configChallengeIds[num], levelMeta, 0); if (item.IsFinishStageNomalChallenge()) { normalDropItem = data2.get_drop_item(); totalList.Add(normalDropItem); } else if (item.IsFinishStageFastChallenge()) { fastDropItem = data2.get_drop_item(); totalList.Add(fastDropItem); } else if (item.IsFinishStageVeryFastChallenge()) { sonicDropItem = data2.get_drop_item(); totalList.Add(sonicDropItem); } } } }
public SpecialLevelTimeChallenge(LevelChallengeHelperPlugin helper, LevelChallengeMetaData metaData) : base(helper, metaData) { this._finished = true; if (metaData.conditionId != 0x1b) { LevelMetaData levelMetaDataByKey = LevelMetaDataReader.GetLevelMetaDataByKey(Singleton <LevelScoreManager> .Instance.LevelId); this.targetLevelTime = (metaData.conditionId != 0x1d) ? ((float)levelMetaDataByKey.fastBonusTime) : ((float)levelMetaDataByKey.sonicBonusTime); } else { this.targetLevelTime = (float)base._metaData.paramList[0]; } }
public static void LoadFromFileAndBuildMap() { LevelMetaDataReader.LoadFromFile(); List <LevelMetaData> itemList = LevelMetaDataReader.GetItemList(); _chapterMap = new Dictionary <int, List <int> >(); foreach (LevelMetaData data in itemList) { if (!_chapterMap.ContainsKey(data.chapterId)) { _chapterMap.Add(data.chapterId, new List <int>()); } _chapterMap[data.chapterId].Add(data.levelId); } }
public LevelDataItem(int levelID) : this(levelID, LevelMetaDataReader.GetLevelMetaDataByKey(levelID)) { }
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; } } } }