Example #1
0
 public override void OnDisabled()
 {
     base.OnDisabled();
     CheckData.Clear();
     ScenarioQueue.Clear();
     AllScenarioTypesInAssemblies.Clear();
 }
Example #2
0
        public void LoadScenarioDataIntoGame()
        {
            while (ScenarioQueue.Count > 0)
            {
                var scenarioEntry = ScenarioQueue.Dequeue();
                if (scenarioEntry.ScenarioName == "ContractSystem")
                {
                    SpawnStrandedKerbalsForRescueMissions(scenarioEntry.ScenarioNode);
                    CreateMissingTourists(scenarioEntry.ScenarioNode);
                }
                if (scenarioEntry.ScenarioName == "ProgressTracking")
                {
                    CreateMissingKerbalsInProgressTrackingSoTheGameDoesntBugOut(scenarioEntry.ScenarioNode);
                }

                CheckForBlankSceneSoTheGameDoesntBugOut(scenarioEntry);

                var psm = new ProtoScenarioModule(scenarioEntry.ScenarioNode);
                if (IsScenarioModuleAllowed(psm.moduleName))
                {
                    Debug.Log($"[LMP]: Loading {psm.moduleName} scenario data");
                    HighLogic.CurrentGame.scenarios.Add(psm);
                }
                else
                {
                    Debug.Log($"[LMP]: Skipping {psm.moduleName} scenario data in {SettingsSystem.ServerSettings.GameMode} mode");
                }
            }
        }