コード例 #1
0
        /// <summary>
        /// called at the OnLoad()
        /// </summary>
        /// <param name="node">The name of the config node</param>
        public override void OnLoad(ConfigNode 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);
            }

            RemoteNet.LoadGroundStations();
        }
コード例 #2
0
        public void Start()
        {
            Log.Normal("Carrer Module Start Called");

            if (!initialized)
            {
                Log.Normal("Resetting OpenCloseStates for new Games");
                CareerState.ResetFacilitiesOpenState();
                RemoteNet.LoadGroundStations();
            }

            initialized = true;
        }
コード例 #3
0
        /// <summary>
        /// called at the OnSave()
        /// </summary>
        /// <param name="node">The name of the config node</param>
        public override void OnSave(ConfigNode node)
        {
            // save the state, that we got the initialisation done
            node.SetValue("initialized", initialized, true);

            KerbalKonstructs.instance.SaveKKConfig(node);

            if (CareerUtils.isCareerGame)
            {
                Log.Normal("KKScenario saving career state");
                CareerState.Save(node);
            }
        }
コード例 #4
0
        /// <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();
        }
コード例 #5
0
        /// <summary>
        /// called at the OnSave()
        /// </summary>
        /// <param name="node">The name of the config node</param>
        public override void OnSave(ConfigNode node)
        {
            KerbalKonstructs.gameTime = HighLogic.CurrentGame.UniversalTime;
            saveTime = KerbalKonstructs.gameTime;

            // save the state, that we got the initialisation done
            node.SetValue("initialized", initialized, true);

            node.SetValue("savetime", saveTime, true);


            KerbalKonstructs.instance.SaveKKConfig(node);

            //if (CareerUtils.isCareerGame)
            //{
            Log.Normal("KKScenario saving career state");
            CareerState.Save(node);
            //}

            CareerObjects.SaveBuildings(node);
        }