private bool FilterMission(MissionDataItem mission) { LinearMissionData data = LinearMissionDataReader.TryGetLinearMissionDataByKey(mission.id); if ((data != null) && (data.IsAchievement == 1)) { return(true); } if ((data != null) && (data.PreMissionId > 0)) { foreach (MissionDataItem item in Singleton <MissionModule> .Instance.GetMissionDict().Values) { if ((item.id == data.PreMissionId) && ((item.status == 2) || (item.status == 3))) { return(true); } } } if (this.IsPreviewMission(mission)) { TimeSpan span = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp((uint)mission.beginTime) - TimeUtil.Now); if (span.TotalSeconds > mission.metaData.PreviewTime) { return(true); } } return(false); }
private void FilterMissions() { List <MissionDataItem> list = Enumerable.ToList <MissionDataItem>(Singleton <MissionModule> .Instance.GetMissionDict().Values); this._missionList.Clear(); foreach (MissionDataItem item in list) { bool flag = false; if (item.status == 5) { flag = true; } else { LinearMissionData data = LinearMissionDataReader.TryGetLinearMissionDataByKey(item.id); if ((data != null) && (data.PreMissionId > 0)) { foreach (MissionDataItem item2 in list) { if ((item2.id == data.PreMissionId) && ((item2.status == 2) || (item2.status == 3))) { flag = true; break; } } } if (this.IsPreviewMission(item)) { TimeSpan span = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp((uint)item.beginTime) - TimeUtil.Now); if (span.TotalSeconds > item.metaData.PreviewTime) { flag = true; this._util.AddPreviewMission(item); } } if ((data != null) && (data.IsAchievement == 1)) { flag = true; } } if (!flag) { this._missionList.Add(item); } } }
private bool SetupByMissionInfo(int missionId) { this._missionId = missionId; this._missionData = Singleton <MissionModule> .Instance.GetMissionDataItem(this._missionId); if ((this._missionData == null) || (this._missionData.status != 3)) { return(false); } LinearMissionData data = LinearMissionDataReader.TryGetLinearMissionDataByKey(missionId); if ((data == null) || (data.IsAchievement == 0)) { return(false); } Transform transform = base.view.transform.Find("Dialog/AchieveName"); if (transform != null) { transform.GetComponent <Text>().text = LocalizationGeneralLogic.GetText(this._missionData.metaData.title, new object[0]); } return(true); }