/// <summary> /// called at the OnLoad() /// </summary> /// <param name="node">The name of the config node</param> public override void OnLoad(ConfigNode node) { CareerObjects.LoadBuildings(node); // resetting old state in caase it is needed CareerState.ResetFacilitiesOpenState(); if (node.HasValue("initialized")) { initialized = bool.Parse(node.GetValue("initialized")); } if (!initialized) { return; } KerbalKonstructs.instance.LoadKKConfig(node); //if (CareerUtils.isCareerGame) //{ Log.Normal("KKScenario loading facility states"); CareerState.Load(node); //} ConnectionManager.LoadGroundStations(); }
/// <summary> /// called at the OnLoad() /// </summary> /// <param name="node">The name of the config node</param> public override void OnLoad(ConfigNode node) { // check if we have been in the mainmenue before (gameTime == -1) or if we saved just before we load (scene switch) if (KerbalKonstructs.gameTime == -1d || KerbalKonstructs.gameTime > HighLogic.CurrentGame.UniversalTime) { } else { return; } CareerObjects.LoadBuildings(node); // resetting old state in caase it is needed CareerState.ResetFacilitiesOpenState(); if (node.HasValue("initialized")) { initialized = bool.Parse(node.GetValue("initialized")); } if (!initialized) { Log.Normal("Resetting OpenCloseStates for new Games"); CareerState.ResetFacilitiesOpenState(); initialized = true; } if (node.HasValue("savetime")) { saveTime = double.Parse(node.GetValue("savetime")); KerbalKonstructs.gameTime = saveTime; } if (!initialized) { return; } KerbalKonstructs.instance.LoadKKConfig(node); //if (CareerUtils.isCareerGame) //{ Log.Normal("KKScenario loading facility states"); CareerState.Load(node); //} ConnectionManager.LoadGroundStations(); }