Exemplo n.º 1
0
 void SaveConfigs()
 {
     KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <FlightGUI>();
     config.SetValue("flight_mainGuiRect", mainGuiRect);
     config.SetValue("flight_dataGuiRect", dataGuiRect);
     config.SetValue("flight_settingsGuiRect", settingsGuiRect);
     config.save();
 }
Exemplo n.º 2
0
 void SaveConfigs()
 {
     if (FARDebugAndSettings.config != null)
     {
         KSP.IO.PluginConfiguration config = FARDebugAndSettings.config;
         config.SetValue("flight_mainGuiRect", mainGuiRect);
         config.SetValue("flight_dataGuiRect", dataGuiRect);
         config.SetValue("flight_settingsGuiRect", settingsGuiRect);
     }
 }
Exemplo n.º 3
0
 public void SaveLoadObjects()
 {
     KACWorker.DebugLogFormatted("Saving Load Objects");
     KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType <KerbalAlarmClock>();
     configfile.load();
     configfile.SetValue("LoadManNode", this.LoadManNode);
     configfile.SetValue("LoadVesselTarget", this.LoadVesselTarget);
     configfile.save();
     KACWorker.DebugLogFormatted("Saved Load Objects");
 }
Exemplo n.º 4
0
        private void SaveSettings()
        {
            KSPLog.print("[kalculator.dll] Saving Config...");
            KSP.IO.PluginConfiguration _configfile = KSP.IO.PluginConfiguration.CreateForType <Kalculator>();

            _configfile.SetValue("windowpos", _calcsize);
            _configfile.SetValue("keybind", _keybind);
            _configfile.SetValue("version", _version);
            _configfile.SetValue("KSPSkin", _useKspSkin);

            _configfile.save();
            print("[kalculator.dll] Config Saved ");
        }
        public static void SaveConfigs()
        {
            config.SetValue("displayForces", FARDebugValues.displayForces.ToString());
            config.SetValue("displayCoefficients", FARDebugValues.displayCoefficients.ToString());
            config.SetValue("displayShielding", FARDebugValues.displayShielding.ToString());

            config.SetValue("useSplinesForSupersonicMath", FARDebugValues.useSplinesForSupersonicMath.ToString());
            config.SetValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures.ToString());

            FARAeroUtil.SaveCustomAeroDataToConfig();
            FARPartClassification.SaveCustomClassificationTemplates();
            FARAeroStress.SaveCustomStressTemplates();
            config.save();
        }
 public static void SaveConfigruration()
 {
     KSP.IO.PluginConfiguration config = FARDebugAndSettings.config;
     for (int i = 0; i < ACTION_COUNT; ++i)
     {
         Debug.Log(String.Format("FAR: save AG {0} as {1}", configKeys[i], id2actionGroup[i]));
         config.SetValue(configKeys[i], id2actionGroup[i].ToString());
     }
 }
Exemplo n.º 7
0
        public static void SaveSettings(ref KSP.IO.PluginConfiguration config)
        {
            config.SetValue("unitsSettingsWindowPos", UnitsSettingsWindowPos);

            PressureUnits.SaveToConfig(ref config);
            TemperatureUnits.SaveToConfig(ref config);
            ForceUnits.SaveToConfig(ref config);
            IspUnits.SaveToConfig(ref config);
            TSFCUnits.SaveToConfig(ref config);
        }
 public void SaveConfig()
 {
     Log.dbg("Saving settings: {0} {1} {2} {3} {4} {5} {6} {7}", InteriorVolumeScale, InteriorMaxFreq, LowerMachThreshold, UpperMachThreshold, MaxDistortion, CondensationEffectStrength, MaxVacuumFreq, MaxSupersonicFreq);
     Config.SetValue("InteriorVolumeScale", InteriorVolumeScale.ToString());
     Config.SetValue("InteriorMaxFreq", InteriorMaxFreq.ToString());
     Config.SetValue("LowerMachThreshold", LowerMachThreshold.ToString());
     Config.SetValue("UpperMachThreshold", UpperMachThreshold.ToString());
     Config.SetValue("MaxDistortion", MaxDistortion.ToString());
     Config.SetValue("CondensationEffectStrength", CondensationEffectStrength.ToString());
     Config.SetValue("MaxVacuumFreq", MaxVacuumFreq.ToString());
     Config.SetValue("MaxSupersonicFreq", MaxSupersonicFreq.ToString());
     Config.save();
 }
 public void SaveConfig()
 {
     Debug.Log("ASE -- Saving settings: " + InteriorVolumeScale + " " + InteriorMaxFreq + " " + LowerMachThreshold + " " + UpperMachThreshold + " " + MaxDistortion + " " + CondensationEffectStrength + " " + MaxVacuumFreq + " " + MaxSupersonicFreq);
     Config.SetValue("InteriorVolumeScale", InteriorVolumeScale.ToString());
     Config.SetValue("InteriorMaxFreq", InteriorMaxFreq.ToString());
     Config.SetValue("LowerMachThreshold", LowerMachThreshold.ToString());
     Config.SetValue("UpperMachThreshold", UpperMachThreshold.ToString());
     Config.SetValue("MaxDistortion", MaxDistortion.ToString());
     Config.SetValue("CondensationEffectStrength", CondensationEffectStrength.ToString());
     Config.SetValue("MaxVacuumFreq", MaxVacuumFreq.ToString());
     Config.SetValue("MaxSupersonicFreq", MaxSupersonicFreq.ToString());
     Config.save();
 }
Exemplo n.º 10
0
        //private static readonly Color _maneuverColour = new Color(0, 0.1137f, 1, _manueverAlpha);

        public void Save()
        {
            Utilities.DebugLogFormatted(LogLevel.Diagnostic, "Settings save");
            KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType <EnhancedNavBall>();
            configfile.load();

            configfile.SetValue(_iconpos, IconPos);
            configfile.SetValue(_windowvisiblebyactivescene, WindowVisibleByActiveScene);
            configfile.SetValue(_navballposition, HandleFloatSave(NavballPosition));
            configfile.SetValue(_navballscale, HandleFloatSave(NavballScale));
            configfile.SetValue(_ghostposition, HandleFloatSave(GhostPosition));
            configfile.SetValue(_proRetColour, HandleColourSave(ProRetColour));
            configfile.SetValue(_normalColour, HandleColourSave(NormalColour));
            configfile.SetValue(_radialColour, HandleColourSave(RadialColour));
            configfile.SetValue(_enbManeuver, ENBManeuver);
            configfile.SetValue(_radialNormalDuringManeuver, RadialNormalDuringManeuver);
            //configfile.SetValue("");


            configfile.save();
        }
Exemplo n.º 11
0
        public void SaveSettingsToConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <EnginesFlightGUI>();
            //config.SetValue("showFlightWindow", FlightGUI.ShowFlightGUIWindow);

            config.SetValue("flightWindowPos", FlightWindowPos);

            FlightGUISettings.SaveSettings(ref config);
            GUIUnitsSettings.SaveSettings(ref config);

            config.save();
        }
Exemplo n.º 12
0
        public override void Save(KSP.IO.PluginConfiguration config, string sceneKey)
        {
            base.Save(config, sceneKey);

            HUDWindow window;

            for (int idx = 0; idx < this.Windows.Count; idx++)
            {
                window = this.Windows[idx];

                string saveName = string.Format("{0}_{1}", this.GetType().Name, window.WindowName);
                config.SetValue(saveName, window.WindowPos);
            }
        }
Exemplo n.º 13
0
        public void SaveConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <PartCatalog>();

            foreach (FieldInfo field in GetType().GetFields(BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public))
            {
                foreach (Attribute at in field.GetCustomAttributes(false))
                {
                    if (at is SaveToConfig)
                    {
                        config.SetValue(field.Name, field.GetValue(this));
                    }
                }
            }
            config.save();
        }
        public static void SaveConfigs()
        {
            config.SetValue("displayForces", FARDebugValues.displayForces.ToString());
            config.SetValue("displayCoefficients", FARDebugValues.displayCoefficients.ToString());
            config.SetValue("displayShielding", FARDebugValues.displayShielding.ToString());

            config.SetValue("useSplinesForSupersonicMath", FARDebugValues.useSplinesForSupersonicMath.ToString());
            config.SetValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures.ToString());

            config.SetValue("useBlizzyToolbar", FARDebugValues.useBlizzyToolbar.ToString());
            config.SetValue("aeroFailureExplosions", FARDebugValues.aeroFailureExplosions.ToString());

            FARDebugValues.useBlizzyToolbar &= ToolbarManager.ToolbarAvailable;

            FARAeroUtil.SaveCustomAeroDataToConfig();
            FARPartClassification.SaveCustomClassificationTemplates();
            FARAeroStress.SaveCustomStressTemplates();
            FARActionGroupConfiguration.SaveConfigruration();
            FAREditorGUI.SaveCustomColors();
            config.save();
        }
Exemplo n.º 15
0
        private void Serialize(bool write)
        {
            var props = from p in this.GetType().GetProperties()
                        let attr = p.GetCustomAttributes(typeof(Persistent), true)
                                   where attr.Length == 1
                                   select new { Property = p, Attribute = attr.First() as Persistent };

            foreach (var prop in props)
            {
                if (write)
                {
                    config.SetValue(prop.Property.Name, prop.Property.GetValue(this, null));
                }
                else
                {
                    prop.Property.SetValue(this, config.GetValue <object>(prop.Property.Name, prop.Attribute.DefaultValue), null);
                }
            }

            if (write)
            {
                config.save();
            }
        }
Exemplo n.º 16
0
        public override void Save(KSP.IO.PluginConfiguration config, string sceneKey)
        {
            base.Save(config, sceneKey);

            VOID_PanelLineGroup group;
            VOID_PanelLine      line;

            string groupKeyPrefix;
            string groupIsShownKey;

            for (int lIdx = 0; lIdx < this.PanelLines.Count; lIdx++)
            {
                line = this.PanelLines[lIdx];

                line.Save(config, this.saveKeyName);
            }

            for (int gIdx = 0; gIdx < this.lineGroups.Count; gIdx++)
            {
                group = this.lineGroups[gIdx];

                groupKeyPrefix = string.Format("{0}_{1}", this.saveKeyName, group.Name);

                groupIsShownKey = string.Format("{0}_{1}{2}",
                                                this.saveKeyName, group.Name, VOID_PanelLineGroup.ISSHOWN_KEY);

                config.SetValue(groupIsShownKey, group.IsShown);

                for (int lIdx = 0; lIdx < this.PanelLines.Count; lIdx++)
                {
                    line = this.PanelLines[lIdx];

                    line.Save(config, groupKeyPrefix);
                }
            }
        }
Exemplo n.º 17
0
        public static void SaveConfigs()
        {
            config.SetValue("uiRectWindowEditor", uiRectWindowEditor);
            config.SetValue("uiRectWindowDebug", uiRectWindowDebug);

            config.SetValue("logCAV", WPDebug.logCAV.ToString());
            config.SetValue("logUpdate", WPDebug.logUpdate.ToString());
            config.SetValue("logUpdateGeometry", WPDebug.logUpdateGeometry.ToString());

            config.SetValue("logUpdateMaterials", WPDebug.logUpdateMaterials.ToString());
            config.SetValue("logMeshReferences", WPDebug.logMeshReferences.ToString());
            config.SetValue("logCheckMeshFilter", WPDebug.logCheckMeshFilter.ToString());

            config.SetValue("logPropertyWindow", WPDebug.logPropertyWindow.ToString());
            config.SetValue("logFlightSetup", WPDebug.logFlightSetup.ToString());
            config.SetValue("logFieldSetup", WPDebug.logFieldSetup.ToString());

            config.SetValue("logFuel", WPDebug.logFuel.ToString());
            config.SetValue("logLimits", WPDebug.logLimits.ToString());
            config.SetValue("logEvents", WPDebug.logEvents.ToString());

            config.save();
        }
Exemplo n.º 18
0
        public void SaveConfig()
        {
            KACWorker.DebugLogFormatted("Saving Config");

            KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType <KerbalAlarmClock>();
            configfile.load();

            configfile.SetValue("DailyUpdateCheck", this.DailyVersionCheck);
            configfile.SetValue("VersionCheckDate_Attempt", this.VersionCheckDate_AttemptString);
            configfile.SetValue("VersionCheckDate_Success", this.VersionCheckDate_SuccessString);
            configfile.SetValue("VersionWeb", this.VersionWeb);

            configfile.SetValue("WindowVisible", this.WindowVisible);
            configfile.SetValue("WindowMinimized", this.WindowMinimized);
            configfile.SetValue("WindowPos", this.WindowPos);

            configfile.SetValue("WindowVisible_SpaceCenter", this.WindowVisible_SpaceCenter);
            configfile.SetValue("WindowMinimized_SpaceCenter", this.WindowMinimized_SpaceCenter);
            configfile.SetValue("WindowPos_SpaceCenter", this.WindowPos_SpaceCenter);

            configfile.SetValue("WindowVisible_TrackingStation", this.WindowVisible_TrackingStation);
            configfile.SetValue("WindowMinimized_TrackingStation", this.WindowMinimized_TrackingStation);
            configfile.SetValue("WindowPos_TrackingStation", this.WindowPos_TrackingStation);

            configfile.SetValue("IconPos", this.IconPos);
            configfile.SetValue("IconPos_SpaceCenter", this.IconPos_SpaceCenter);
            configfile.SetValue("IconShow_SpaceCenter", this.IconShow_SpaceCenter);
            configfile.SetValue("IconPos_TrackingStation", this.IconPos_TrackingStation);
            configfile.SetValue("IconShow_TrackingStation", this.IconShow_TrackingStation);

            configfile.SetValue("UseBlizzyToolbarIfAvailable", this.UseBlizzyToolbarIfAvailable);
            configfile.SetValue("WindowMinimizedType", (int)this.WindowMinimizedType);

            configfile.SetValue("UIBlockersEnabled", this.KSCUIBlockersEnabled);

            configfile.SetValue("BehaviourChecksPerSec", this.BehaviourChecksPerSec);

            configfile.SetValue("BackupSaves", this.BackupSaves);
            configfile.SetValue("BackupSavesToKeep", this.BackupSavesToKeep);
            configfile.SetValue("CancelFlightModeJumpOnBackupFailure", this.CancelFlightModeJumpOnBackupFailure);

            configfile.SetValue("AllowJumpFromViewOnly", this.AllowJumpFromViewOnly);
            configfile.SetValue("AllowJumpToAsteroid", this.AllowJumpToAsteroid);

            configfile.SetValue("AlarmListMaxAlarms", this.AlarmListMaxAlarms);
            configfile.SetValue("AlarmPosition", this.AlarmPosition);
            configfile.SetValue("AlarmDefaultAction", this.AlarmDefaultAction);
            configfile.SetValue("AlarmDefaultMargin", this.AlarmDefaultMargin);
            configfile.SetValue("AlarmDeleteOnClose", this.AlarmDeleteOnClose);
            configfile.SetValue("ShowTooltips", this.ShowTooltips);
            configfile.SetValue("ShowEarthTime", this.ShowEarthTime);
            configfile.SetValue("HideOnPause", this.HideOnPause);
            configfile.SetValue("TimeFormat", Enum.GetName(typeof(KACTime.PrintTimeFormat), this.TimeFormat));

            configfile.SetValue("AlarmXferRecalc", this.AlarmXferRecalc);
            configfile.SetValue("AlarmXferRecalcThreshold", this.AlarmXferRecalcThreshold);
            configfile.SetValue("AlarmXferDisplayList", this.AlarmXferDisplayList);
            configfile.SetValue("XferUseModelData", this.XferUseModelData);

            configfile.SetValue("AlarmNodeRecalc", this.AlarmNodeRecalc);
            configfile.SetValue("AlarmNodeRecalcThreshold", this.AlarmNodeRecalcThreshold);

            configfile.SetValue("AlarmAddSOIAuto", this.AlarmAddSOIAuto);
            configfile.SetValue("AlarmAddSOIAutoThreshold", this.AlarmAddSOIAutoThreshold);
            //configfile.SetValue("AlarmAddSOIMargin", this.AlarmAddSOIMargin);
            configfile.SetValue("AlarmAutoSOIMargin", this.AlarmAutoSOIMargin);
            configfile.SetValue("AlarmAddSOIAuto_ExcludeEVA", this.AlarmAddSOIAuto_ExcludeEVA);
            configfile.SetValue("AlarmOnSOIChange", this.AlarmCatchSOIChange);
            configfile.SetValue("AlarmOnSOIChange_Action", this.AlarmOnSOIChange_Action);

            configfile.SetValue("AlarmSOIRecalc", this.AlarmSOIRecalc);
            configfile.SetValue("AlarmSOIRecalcThreshold", this.AlarmSOIRecalcThreshold);

            configfile.SetValue("AlarmAddManAuto", this.AlarmAddManAuto);
            configfile.SetValue("AlarmAddManAuto_andRemove", this.AlarmAddManAuto_andRemove);
            configfile.SetValue("AlarmAddManAutoThreshold", this.AlarmAddManAutoThreshold);
            configfile.SetValue("AlarmAddManAutoMargin", this.AlarmAddManAutoMargin);
            configfile.SetValue("AddManAutoMargin", this.AlarmAddManAutoMargin.ToString());
            configfile.SetValue("AlarmAddManAuto_Action", this.AlarmAddManAuto_Action);

            configfile.SetValue("AlarmCrewDefaultStoreNode", this.AlarmCrewDefaultStoreNode);

            configfile.save();
            KACWorker.DebugLogFormatted("Saved Config");
        }
Exemplo n.º 19
0
        public void Load()
        {
            try
            {
                KACWorker.DebugLogFormatted("Loading Config");
                KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType <KerbalAlarmClock>();
                configfile.load();

                this.DailyVersionCheck = configfile.GetValue("DailyUpdateCheck", true);

                try { this.VersionCheckDate_Attempt = DateTime.ParseExact(configfile.GetValue("VersionCheckDate_Attempt", ""), "yyyy-MM-dd", CultureInfo.CurrentCulture); }
                catch (Exception) { this.VersionCheckDate_Attempt = new DateTime(); }

                try { this.VersionCheckDate_Success = DateTime.ParseExact(configfile.GetValue("VersionCheckDate_Success", ""), "yyyy-MM-dd", CultureInfo.CurrentCulture); }
                catch (Exception) { this.VersionCheckDate_Success = new DateTime(); }

                this.VersionWeb = configfile.GetValue("VersionWeb", "");

                this.WindowVisible   = configfile.GetValue("WindowVisible", false);
                this.WindowMinimized = configfile.GetValue("WindowMinimized", false);
                this.WindowPos       = configfile.GetValue <Rect>("WindowPos", new Rect(3, 55, 300, 45));

                this.WindowVisible_SpaceCenter   = configfile.GetValue("WindowVisible_SpaceCenter", false);
                this.WindowMinimized_SpaceCenter = configfile.GetValue("WindowMinimized_SpaceCenter", false);
                this.WindowPos_SpaceCenter       = configfile.GetValue <Rect>("WindowPos_SpaceCenter", new Rect(3, 36, 300, 45));

                this.WindowVisible_TrackingStation   = configfile.GetValue("WindowVisible_TrackingStation", false);
                this.WindowMinimized_TrackingStation = configfile.GetValue("WindowMinimized_TrackingStation", false);
                this.WindowPos_TrackingStation       = configfile.GetValue <Rect>("WindowPos_TrackingStation", new Rect(202, 45, 300, 45));

                this.IconPos                        = configfile.GetValue <Rect>("IconPos", new Rect(152, 0, 32, 32));
                this.IconPos.height                 = 32; this.IconPos.width = 32;
                this.IconPos_SpaceCenter            = configfile.GetValue <Rect>("IconPos_SpaceCenter", new Rect(3, 3, 32, 32));
                this.IconPos_SpaceCenter.height     = 32; this.IconPos_TrackingStation.width = 32;
                this.IconPos_TrackingStation        = configfile.GetValue <Rect>("IconPos_TrackingStation", new Rect(196, 0, 32, 32));
                this.IconPos_TrackingStation.height = 32; this.IconPos_TrackingStation.width = 32;

                this.IconShow_SpaceCenter     = configfile.GetValue("IconShow_SpaceCenter", true);
                this.IconShow_TrackingStation = configfile.GetValue("IconShow_TrackingStation", true);

                this.UseBlizzyToolbarIfAvailable = configfile.GetValue <Boolean>("UseBlizzyToolbarIfAvailable", true);
                this.WindowMinimizedType         = (MiminalDisplayType)configfile.GetValue("WindowMinimizedType", 0);

                this.KSCUIBlockersEnabled = configfile.GetValue <Boolean>("UIBlockersEnabled", true);

                this.BehaviourChecksPerSec        = configfile.GetValue("BehaviourChecksPerSec", 10);
                this.BehaviourChecksPerSec_Custom = configfile.GetValue("BehaviourChecksPerSecCustom", 40);

                this.BackupSaves       = configfile.GetValue("BackupSaves", true);
                this.BackupSavesToKeep = configfile.GetValue("BackupSavesToKeep", 20);
                this.CancelFlightModeJumpOnBackupFailure = configfile.GetValue("CancelFlightModeJumpOnBackupFailure", false);

                this.AllowJumpFromViewOnly = configfile.GetValue("AllowJumpFromViewOnly", true);
                this.AllowJumpToAsteroid   = configfile.GetValue("AllowJumpToAsteroid", false);

                this.AlarmListMaxAlarms = configfile.GetValue("AlarmListMaxAlarms", "10");
                this.AlarmDefaultAction = configfile.GetValue <int>("AlarmDefaultAction", 1);
                this.AlarmDefaultMargin = configfile.GetValue <Double>("AlarmDefaultMargin", 60);
                this.AlarmPosition      = configfile.GetValue <int>("AlarmPosition", 1);
                this.AlarmDeleteOnClose = configfile.GetValue("AlarmDeleteOnClose", false);
                this.ShowTooltips       = configfile.GetValue("ShowTooltips", true);
                this.ShowEarthTime      = configfile.GetValue("ShowEarthTime", false);
                this.HideOnPause        = configfile.GetValue("HideOnPause", true);
                String strTimeFormat = configfile.GetValue("TimeFormat", "KSPString");
                //KACWorker.DebugLogFormatted("{0}",strTimeFormat);
                this.TimeFormat = (KACTime.PrintTimeFormat)Enum.Parse(typeof(KACTime.PrintTimeFormat), strTimeFormat);
                //this.TimeFormat = configfile.GetValue<KACTime.PrintTimeFormat>("TimeFormat", KACTime.PrintTimeFormat.KSPString);
                //KACWorker.DebugLogFormatted("{0}",this.TimeFormat.ToString());
                if (configfile.GetValue <bool>("TimeAsUT", false) == true)
                {
                    KACWorker.DebugLogFormatted("Forcing New Format");
                    this.TimeFormat = KACTime.PrintTimeFormat.TimeAsUT;
                    configfile.SetValue("TimeAsUT", false);
                    configfile.SetValue("TimeFormat", Enum.GetName(typeof(KACTime.PrintTimeFormat), this.TimeFormat));
                    configfile.save();
                }

                this.AlarmXferRecalc          = configfile.GetValue("AlarmXferRecalc", true);
                this.AlarmXferRecalcThreshold = configfile.GetValue <Double>("AlarmXferRecalcThreshold", 180);
                this.AlarmXferDisplayList     = configfile.GetValue("AlarmXferDisplayList", false);
                this.XferUseModelData         = configfile.GetValue("XferUseModelData", false);

                this.AlarmNodeRecalc          = configfile.GetValue("AlarmNodeRecalc", false);
                this.AlarmNodeRecalcThreshold = configfile.GetValue <Double>("AlarmNodeRecalcThreshold", 180);

                this.AlarmAddSOIAuto          = configfile.GetValue("AlarmAddSOIAuto", false);
                this.AlarmAddSOIAutoThreshold = configfile.GetValue <Double>("AlarmAddSOIAutoThreshold", 180);
                //this.AlarmAddSOIMargin = configfile.GetValue("AlarmAddSOIMargin", 120);
                this.AlarmAutoSOIMargin         = configfile.GetValue <Double>("AlarmAutoSOIMargin", 900);
                this.AlarmAddSOIAuto_ExcludeEVA = configfile.GetValue("AlarmAddSOIAuto_ExcludeEVA", true);
                this.AlarmCatchSOIChange        = configfile.GetValue("AlarmOnSOIChange", false);
                this.AlarmOnSOIChange_Action    = configfile.GetValue("AlarmOnSOIChange_Action", 1);

                this.AlarmSOIRecalc          = configfile.GetValue("AlarmSOIRecalc", false);
                this.AlarmSOIRecalcThreshold = configfile.GetValue <Double>("AlarmSOIRecalcThreshold", 180);

                this.AlarmAddManAuto           = configfile.GetValue("AlarmAddManAuto", false);
                this.AlarmAddManAuto_andRemove = configfile.GetValue("AlarmAddManAuto_andRemove", false);
                this.AlarmAddManAutoThreshold  = configfile.GetValue <Double>("AlarmAddManAutoThreshold", 180);
                this.AlarmAddManAutoMargin     = configfile.GetValue <Double>("AlarmAddManAutoMargin", 180);
                this.AlarmAddManAuto_Action    = configfile.GetValue("AlarmAddManAuto_Action", 1);

                this.AlarmCrewDefaultStoreNode = configfile.GetValue("AlarmCrewDefaultStoreNode", false);

                this.LoadManNode      = configfile.GetValue("LoadManNode", "");
                this.LoadVesselTarget = configfile.GetValue("LoadVesselTarget", "");

                if (KSP.IO.File.Exists <KerbalAlarmClock>(String.Format("Alarms-{0}.txt", HighLogic.CurrentGame.Title)))
                {
                    KACWorker.DebugLogFormatted("Trying New Alarms file...");
                    LoadAlarms();
                }
                else
                {
                    //Loop through numbers to Load Alarms
                    Alarms = new KACAlarmList();
                    int    intAlarm = 0;
                    String strAlarm = "";
                    do
                    {
                        strAlarm = configfile.GetValue("Alarm_" + intAlarm, "");
                        KACWorker.DebugLogFormatted(strAlarm);
                        if (strAlarm != "")
                        {
                            KACAlarm tmpAlarm = new KACAlarm();
                            tmpAlarm.LoadFromString(strAlarm);
                            Alarms.Add(tmpAlarm);
                            intAlarm++;
                        }
                    } while (strAlarm != "");
                }
                KACWorker.DebugLogFormatted("Config Loaded Successfully");
            }

            catch (Exception ex)
            {
                KACWorker.DebugLogFormatted("Failed To Load Config");
                KACWorker.DebugLogFormatted(ex.Message);
            }
        }
Exemplo n.º 20
0
        public static void SaveSettings(ref KSP.IO.PluginConfiguration config)
        {
            config.SetValue("settingsWindowPos", SettingsWindowPos);

            config.SetValue("showAmbientTemp", ShowAmbientTemp);
            config.SetValue("showAmbientPressure", ShowAmbientPressure);
            config.SetValue("showRecoveryTemp", ShowRecoveryTemp);
            config.SetValue("showRecoveryPressure", ShowRecoveryPressure);
            config.SetValue("showInletPercent", ShowInletPercent);
            config.SetValue("showTPR", ShowTPR);
            config.SetValue("showInletPressureRatio", ShowInletPressureRatio);
            config.SetValue("showThrust", ShowThrust);
            config.SetValue("showTWR", ShowTWR);
            config.SetValue("showTDR", ShowTDR);
            config.SetValue("showIsp", ShowIsp);
            config.SetValue("showTSFC", ShowTSFC);
        }
Exemplo n.º 21
0
        public static void SaveConfigs()
        {
            config.SetValue("uiRectWindowEditor", uiRectWindowEditor);
            config.SetValue("uiRectWindowDebug", uiRectWindowDebug);

            config.SetValue("logCAV", WPDebug.logCAV.ToString());
            config.SetValue("logUpdate", WPDebug.logUpdate.ToString());
            config.SetValue("logUpdateGeometry", WPDebug.logUpdateGeometry.ToString());

            config.SetValue("logUpdateMaterials", WPDebug.logUpdateMaterials.ToString());
            config.SetValue("logMeshReferences", WPDebug.logMeshReferences.ToString());
            config.SetValue("logCheckMeshFilter", WPDebug.logCheckMeshFilter.ToString());

            config.SetValue("logPropertyWindow", WPDebug.logPropertyWindow.ToString());
            config.SetValue("logFlightSetup", WPDebug.logFlightSetup.ToString());
            config.SetValue("logFieldSetup", WPDebug.logFieldSetup.ToString());

            config.SetValue("logFuel", WPDebug.logFuel.ToString());
            config.SetValue("logLimits", WPDebug.logLimits.ToString());
            config.SetValue("logEvents", WPDebug.logEvents.ToString());

            //Prefs
            config.SetValue("AnglePref", WingProcedural.sharedPropAnglePref.ToString());
            //config.SetValue("EdgePref", WingProcedural.sharedPropEdgePref.ToString());
            config.SetValue("ThickPref", WingProcedural.sharedPropEThickPref.ToString());

            config.save();
        }
Exemplo n.º 22
0
 virtual public void SaveSettings()
 {
     configfile.SetValue(mangleName("gui_enabled"), gui_enabled);
     configfile.save();
 }
Exemplo n.º 23
0
 public void SaveToConfig(ref KSP.IO.PluginConfiguration config)
 {
     config.SetValue(UnitType.ConfigName, ConfigName);
 }
Exemplo n.º 24
0
        public virtual void Save(KSP.IO.PluginConfiguration config, string sceneKey)
        {
            if (config == null)
            {
                ToadicusTools.Logging.PostErrorMessage(
                    "{0}: config argument was null, bailing out.",
                    this.GetType().Name
                    );
            }

            if (sceneKey == null)
            {
                ToadicusTools.Logging.PostErrorMessage(
                    "{0}: sceneKey argument was null, bailing out.",
                    this.GetType().Name
                    );
            }

            MemberInfo[] members = this.GetType().GetMembers(
                BindingFlags.NonPublic |
                BindingFlags.Public |
                BindingFlags.Instance |
                BindingFlags.FlattenHierarchy
                );
            MemberInfo member;

            for (int fIdx = 0; fIdx < members.Length; fIdx++)
            {
                member = members[fIdx];

                object[] attrs = member.GetCustomAttributes(typeof(AVOID_SaveValue), false);

                AVOID_SaveValue attr;

                if (attrs.Length > 0)
                {
                    attr = (AVOID_SaveValue)attrs[0];
                }
                else
                {
                    continue;
                }

                string fieldName;

                if (this is VOIDCore)
                {
                    fieldName = string.Format("{0}_{1}", this.saveKeyName, attr.Name);
                }
                else
                {
                    fieldName = string.Format(
                        "{0}_{1}_{2}",
                        this.saveKeyName,
                        sceneKey,
                        attr.Name
                        );
                }

                object fieldValue;

                if (member is FieldInfo)
                {
                    fieldValue = (member as FieldInfo).GetValue(this);
                }
                else
                {
                    fieldValue = (member as PropertyInfo).GetValue(this, null);
                }

                if (fieldValue is IVOID_SaveValue)
                {
                    fieldValue = (fieldValue as IVOID_SaveValue).value;
                }

                config.SetValue(fieldName, fieldValue);

                ToadicusTools.Logging.PostDebugMessage(string.Format("{0}: Saved field {1}.", this.GetType().Name, fieldName));
            }
        }