private IEnumerator SetupPage() { yield return(null); yield return(null); // TODO: Double yield return null to ensure this goes after Multiple Bombs? Big oof. Collaborate with the MB team. // TODO: Maybe at this point just permanently erase it from the mission binder and store it in the property thing instead? Mission currentMission = (Mission)page.GetType().BaseType.GetField("currentMission", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(page); ExtendedMissionDetails extendedMissionDetails = ExtendedMissionDetails.ReadMission(currentMission); if (extendedMissionDetails.ExtendedSettings.Count == 0) { Debug.LogFormat("[Extended Mission Settings] Found no settings for {0}", currentMission.DisplayNameTerm); yield break; } foreach (string k in extendedMissionDetails.ExtendedSettings.Keys) { Debug.LogFormat("[Extended Mission Settings] Found setting for {0}: {1} of size {2}", currentMission.DisplayNameTerm, k, extendedMissionDetails.ExtendedSettings[k].Count); } bool canStart = UpdateMissionDetailInformation(currentMission, currentMission.DescriptionTerm, page, extendedMissionDetails); FieldInfo canStartField = typeof(MissionDetailPage).GetField("canStartMission", BindingFlags.Instance | BindingFlags.NonPublic); canStartField.SetValue(page, canStart); }
private IEnumerator SetupGameplay() { CurrentMissionDetails = null; Mission mission = null; ComponentPool componentPool = null; if (GameplayState.MissionToLoad != ModMission.CUSTOM_MISSION_ID && GameplayState.MissionToLoad != FreeplayMissionGenerator.FREEPLAY_MISSION_ID) { mission = MissionManager.Instance.GetMission(GameplayState.MissionToLoad); Debug.Log("Extended Mission Settings doing the thing"); CurrentMissionDetails = ExtendedMissionDetails.ReadMission(mission, true, out componentPool); } else { yield break; } Debug.Log("[Extended Mission Settings] Done."); yield return(null); if (GameplayState.MissionToLoad != ModMission.CUSTOM_MISSION_ID && GameplayState.MissionToLoad != FreeplayMissionGenerator.FREEPLAY_MISSION_ID) { mission.GeneratorSetting.ComponentPools.Add(componentPool); } }