public override void OnSave(ConfigNode node)
        {
            if (FirstRun)
            {
                FirstRun = false;
                return;
            }
            else
            {
                var hoursDay = GameSettings.KERBIN_TIME ? 6 : 24;
                TacStartOnce.Instance.globalSettings.FoodConsumptionRate               = FoodConsumptionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.WaterConsumptionRate              = WaterConsumptionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.OxygenConsumptionRate             = OxygenConsumptionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.BaseElectricityConsumptionRate    = BaseElectricityConsumptionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.ElectricityConsumptionRate        = ElectricityConsumptionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.EvaElectricityConsumptionRate     = EvaElectricityConsumptionRate / 60;
                TacStartOnce.Instance.globalSettings.EvaLampElectricityConsumptionRate = EvaLampElectricityConsumptionRate / 60;
                TacStartOnce.Instance.globalSettings.CO2ProductionRate        = CO2ProductionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.WasteProductionRate      = WasteProductionRate / 60 / 60 / hoursDay;
                TacStartOnce.Instance.globalSettings.WasteWaterProductionRate = WasteWaterProductionRate / 60 / 60 / hoursDay;

                //Change EVA resource values
                AddLifeSupport als = new AddLifeSupport();
                als.ChangeValues();
            }
        }
 public override void OnSave(ConfigNode node)
 {
     if (FirstRun)
     {
         FirstRun = false;
         return;
     }
     else
     {
         //Convert Hourly amounts from UI back to per second.
         TacStartOnce.Instance.globalSettings.MaxDeltaTime              = MaxDeltaTime;
         TacStartOnce.Instance.globalSettings.ElectricityMaxDeltaTime   = ElectricityMaxDeltaTime;
         TacStartOnce.Instance.globalSettings.MaxTimeWithoutFood        = MaxTimeWithoutFood * 60 * 60;
         TacStartOnce.Instance.globalSettings.MaxTimeWithoutOxygen      = MaxTimeWithoutOxygen * 60;
         TacStartOnce.Instance.globalSettings.MaxTimeWithoutWater       = MaxTimeWithoutWater * 60 * 60;
         TacStartOnce.Instance.globalSettings.MaxTimeWithoutElectricity = MaxTimeWithoutElectricity * 60;
         double TOLERANCE = 1;
         if (Math.Abs(TacStartOnce.Instance.globalSettings.EvaDefaultResourceAmount - EvaDefaultResourceAmount) > TOLERANCE)
         {
             TacStartOnce.Instance.globalSettings.EvaDefaultResourceAmount = EvaDefaultResourceAmount;
             //Change EVA resource values
             AddLifeSupport als = new AddLifeSupport();
             als.ChangeValues();
         }
     }
 }
        public override void OnSave(ConfigNode node)
        {
            if (upgrade135)
            {
                //Save the actual per second values that TAC LS uses.
                node.SetValue("FoodConsumptionRate", FoodConsumptionRate);
                node.SetValue("WaterConsumptionRate", WaterConsumptionRate);
                node.SetValue("OxygenConsumptionRate", OxygenConsumptionRate);
                node.SetValue("BaseElectricityConsumptionRate", BaseElectricityConsumptionRate);
                node.SetValue("ElectricityConsumptionRate", ElectricityConsumptionRate);
                node.SetValue("EvaElectricityConsumptionRate", EvaElectricityConsumptionRate);
                node.SetValue("EvaLampElectricityConsumptionRate", EvaLampElectricityConsumptionRate);
                node.SetValue("CO2ProductionRate", CO2ProductionRate);
                node.SetValue("WasteProductionRate", WasteProductionRate);
                node.SetValue("WasteWaterProductionRate", WasteWaterProductionRate);
                OnLoad(node);
                node.SetValue("displayFoodConsumptionRate", displayFoodConsumptionRate);
                node.SetValue("displayWaterConsumptionRate", displayWaterConsumptionRate);
                node.SetValue("displayOxygenConsumptionRate", displayOxygenConsumptionRate);
                node.SetValue("displayBaseElectricityConsumptionRate", displayBaseElectricityConsumptionRate);
                node.SetValue("displayElectricityConsumptionRate", displayElectricityConsumptionRate);
                node.SetValue("displayEvaElectricityConsumptionRate", displayEvaElectricityConsumptionRate);
                node.SetValue("displayEvaLampElectricityConsumptionRate", displayEvaLampElectricityConsumptionRate);
                node.SetValue("displayCO2ProductionRate", displayCO2ProductionRate);
                node.SetValue("displayWasteProductionRate", displayWasteProductionRate);
                node.SetValue("displayWasteWaterProductionRate", displayWasteWaterProductionRate);
                upgrade135 = false;
                node.SetValue("upgrade135", false);
                return;
            }
            if (HighLogic.LoadedScene != GameScenes.MAINMENU)
            {   //Change EVA resource values
                AddLifeSupport als = new AddLifeSupport();
                als.ChangeValues();
            }
            //Set the actual values from the display values at per second values.
            float hoursDay = GameSettings.KERBIN_TIME ? 6f : 24f;

            FoodConsumptionRate               = displayFoodConsumptionRate / 60f / 60f / hoursDay;
            WaterConsumptionRate              = displayWaterConsumptionRate / 60f / 60f / hoursDay;
            OxygenConsumptionRate             = displayOxygenConsumptionRate / 60f / 60f / hoursDay;
            BaseElectricityConsumptionRate    = displayBaseElectricityConsumptionRate / 60f / 60f / hoursDay;
            ElectricityConsumptionRate        = displayElectricityConsumptionRate / 60f / 60f / hoursDay;
            EvaElectricityConsumptionRate     = displayEvaElectricityConsumptionRate / 60f;
            EvaLampElectricityConsumptionRate = displayEvaLampElectricityConsumptionRate / 60f;
            CO2ProductionRate        = displayCO2ProductionRate / 60f / 60f / hoursDay;
            WasteProductionRate      = displayWasteProductionRate / 60f / 60f / hoursDay;
            WasteWaterProductionRate = displayWasteWaterProductionRate / 60 / 60 / hoursDay;
            //Save the actual per second values that TAC LS uses.
            node.SetValue("FoodConsumptionRate", FoodConsumptionRate);
            node.SetValue("WaterConsumptionRate", WaterConsumptionRate);
            node.SetValue("OxygenConsumptionRate", OxygenConsumptionRate);
            node.SetValue("BaseElectricityConsumptionRate", BaseElectricityConsumptionRate);
            node.SetValue("ElectricityConsumptionRate", ElectricityConsumptionRate);
            node.SetValue("EvaElectricityConsumptionRate", EvaElectricityConsumptionRate);
            node.SetValue("EvaLampElectricityConsumptionRate", EvaLampElectricityConsumptionRate);
            node.SetValue("CO2ProductionRate", CO2ProductionRate);
            node.SetValue("WasteProductionRate", WasteProductionRate);
            node.SetValue("WasteWaterProductionRate", WasteWaterProductionRate);
        }