Exemplo n.º 1
0
        public static Vector2 LoadBounds <T>()
        {
            Vector2 bounds = new Vector2(float.NegativeInfinity, float.PositiveInfinity);

            try
            {
                KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <T>();

                config.load();

                bounds = config.GetValue("bounds", bounds);

                config.save();
            }
            catch (Exception e)
            {
                Logging.PostErrorMessage(
                    "{0} handled while loading PluginData for type {1}: do you have a malformed XML file?",
                    e.GetType().FullName,
                    typeof(T).Name
                    );

                Logging.PostDebugMessage(e.ToString());
            }

            return(bounds);
        }
Exemplo n.º 2
0
        public static float LoadStep <T>(float defStep = 1f)
        {
            double stepMult;

            stepMult = (double)defStep;

            try
            {
                KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <T>();

                config.load();

                stepMult = config.GetValue("stepMult", stepMult);

                config.save();
            }
            catch (Exception e)
            {
                Logging.PostErrorMessage(
                    "{0} handled while loading PluginData for type {1}: do you have a malformed XML file?",
                    e.GetType().FullName,
                    typeof(T).Name
                    );

                Logging.PostDebugMessage(e.ToString());
            }

            return((float)stepMult);
        }
        internal void SaveConfig()
        {
            Debug.Log("[Adjustable Mod Panel] Saving settings.");
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <AdjustableModPanel> (null);
            int i = 1;

            foreach (var mod in descriptors)
            {
                if (mod.unmanageable)
                {
                    continue;
                }
                // artifact from an old config
                if (mod.textureHashNeeded && mod.textureHash == 0u)
                {
                    continue;
                }
                config["module" + i.ToString()]     = mod.module;
                config["method" + i.ToString()]     = mod.method;
                config["hashNeeded" + i.ToString()] = mod.textureHashNeeded;
                if (mod.textureHashNeeded)
                {
                    config["hash" + i.ToString()] = (long)mod.textureHash;
                }
                config["scenes" + i.ToString()] = (int)currentScenes[mod];
                config["pinned" + i.ToString()] = pinnedMods[mod];
                i++;
            }
            config["count"] = i - 1;
            config.save();
        }
Exemplo n.º 4
0
        public static void LoadConfigs()
        {
            config = KSP.IO.PluginConfiguration.CreateForType <WingProceduralManager> ();
            config.load();

            WingProceduralManager.uiRectWindowEditor = config.GetValue("uiRectWindowEditor", UIUtility.SetToScreenCenterAlways(new Rect()));
            WingProceduralManager.uiRectWindowDebug  = config.GetValue <Rect> ("uiRectWindowDebug", UIUtility.SetToScreenCenterAlways(new Rect()));

            WPDebug.logCAV            = Convert.ToBoolean(config.GetValue("logCAV", "false"));
            WPDebug.logUpdate         = Convert.ToBoolean(config.GetValue("logUpdate", "false"));
            WPDebug.logUpdateGeometry = Convert.ToBoolean(config.GetValue("logUpdateGeometry", "false"));

            WPDebug.logUpdateMaterials = Convert.ToBoolean(config.GetValue("logUpdateMaterials", "false"));
            WPDebug.logMeshReferences  = Convert.ToBoolean(config.GetValue("logMeshReferences", "false"));
            WPDebug.logCheckMeshFilter = Convert.ToBoolean(config.GetValue("logCheckMeshFilter", "false"));

            WPDebug.logPropertyWindow = Convert.ToBoolean(config.GetValue("logPropertyWindow", "false"));
            WPDebug.logFlightSetup    = Convert.ToBoolean(config.GetValue("logFlightSetup", "false"));
            WPDebug.logFieldSetup     = Convert.ToBoolean(config.GetValue("logFieldSetup", "false"));

            WPDebug.logFuel   = Convert.ToBoolean(config.GetValue("logFuel", "false"));
            WPDebug.logLimits = Convert.ToBoolean(config.GetValue("logLimits", "false"));
            WPDebug.logEvents = Convert.ToBoolean(config.GetValue("logEvents", "false"));

            //prefs
            WingProcedural.sharedPropAnglePref = Convert.ToBoolean(config.GetValue("AnglePref", "false"));
            //WingProcedural.sharedPropEdgePref = Convert.ToBoolean(config.GetValue("EdgePref", "false"));
            WingProcedural.sharedPropEThickPref = Convert.ToBoolean(config.GetValue("ThickPref", "false"));
        }
Exemplo n.º 5
0
 void LoadConfigs()
 {
     KSP.IO.PluginConfiguration config = FARDebugAndSettings.config;
     mainGuiRect     = config.GetValue("flight_mainGuiRect", new Rect());
     dataGuiRect     = config.GetValue("flight_dataGuiRect", new Rect());
     settingsGuiRect = config.GetValue("flight_settingsGuiRect", new Rect());
 }
Exemplo n.º 6
0
        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<Settings>();
            config.load();

            Serialize(false);
        }
Exemplo n.º 7
0
        public void LoadConfig()
        {
            if (config == null)
            {
                config = KSP.IO.PluginConfiguration.CreateForType <SaturableRW> ();
            }

            config.load();

            if (!config.GetValue("DefaultStateIsActive", true) && vessel.atmDensity > 0.001)
            {
                wheelRef.State = ModuleReactionWheel.WheelState.Disabled;
            }

            if (!config.GetValue("DisplayCurrentTorque", false))
            {
                Fields ["availablePitchTorque"].guiActive = false;
                Fields ["availableRollTorque"].guiActive  = false;
                Fields ["availableYawTorque"].guiActive   = false;
            }

            dischargeTorque |= config.GetValue("dischargeTorque", false);

            // Save the file so it can be activated by anyone.

            config ["DefaultStateIsActive"] = config.GetValue("DefaultStateIsActive", true);
            config ["DisplayCurrentTorque"] = config.GetValue("DisplayCurrentTorque", false);
            config ["dischargeTorque"]      = config.GetValue("dischargeTorque", false);

            config.save();
        }
Exemplo n.º 8
0
        public void LoadConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <PartCatalog>();
            config.load();

            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)
                    {
                        MethodInfo   getValueMethod = null;
                        MethodInfo[] methods        = typeof(KSP.IO.PluginConfiguration).GetMethods();
                        foreach (MethodInfo method in methods)
                        {
                            if (method.IsGenericMethodDefinition && method.ContainsGenericParameters && method.GetParameters().Length == 2)
                            {
                                getValueMethod = method.MakeGenericMethod(new Type[] { field.FieldType });
                                break;
                            }
                        }
                        if (getValueMethod != null)
                        {
                            object val = getValueMethod.Invoke(config, new object[] { field.Name, ((SaveToConfig)at).DefaultValue });
                            field.SetValue(this, val);
                        }
                    }
                }
            }
        }
        /*
         * Called when plug in loaded
         */
        public void Awake()
        {
            _state = DisplayState.none;
            RenderingManager.AddToPostDrawQueue(0, OnDraw);
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <UbioZurWeldingLtd>();
            config.load();
            //TODO: manage the case there is no config file (and so no values)

            /* Save the value to create the config file
             * config.SetValue(Constants.settingEdiButX, 190);
             * config.SetValue(Constants.settingEdiButY, 50);
             * config.SetValue(Constants.settingDbAutoReload, true);
             * config.SetValue(Constants.settingAllNodes, false);
             * config.SetValue(Constants.settingAllowCareer, false);
             * config.save();
             */

            int editorButx = config.GetValue <int>(Constants.settingEdiButX);
            int editorButy = config.GetValue <int>(Constants.settingEdiButY);

            _databaseAutoReload    = config.GetValue <bool>(Constants.settingDbAutoReload);
            Welder.IncludeAllNodes = config.GetValue <bool>(Constants.settingAllNodes);
            _allowCareerMode       = config.GetValue <bool>(Constants.settingAllowCareer);
            _editorButton          = new Rect(Screen.width - editorButx, editorButy, Constants.guiWeldButWidth, Constants.guiWeldButHeight);
            _editorErrorDial       = new Rect(Screen.width / 2 - Constants.guiDialogX, Screen.height / 2 - Constants.guiDialogY, Constants.guiDialogW, Constants.guiDialogH);
            _editorWarningDial     = new Rect(Screen.width / 2 - Constants.guiDialogX, Screen.height / 2 - Constants.guiDialogY, Constants.guiDialogW, Constants.guiDialogH);
            _editorInfoWindow      = new Rect(Screen.width / 2 - Constants.guiInfoWindowX, Screen.height / 2 - Constants.guiInfoWindowY, Constants.guiInfoWindowW, Constants.guiInfoWindowH);
            _editorOverwriteDial   = new Rect(Screen.width / 2 - Constants.guiDialogX, Screen.height / 2 - Constants.guiDialogY, Constants.guiDialogW, Constants.guiDialogH);
            _editorSavedDial       = new Rect(Screen.width / 2 - Constants.guiDialogX, Screen.height / 2 - Constants.guiDialogY, Constants.guiDialogW, Constants.guiDialogH);
        }
Exemplo n.º 10
0
        public void Save(KSP.IO.PluginConfiguration config, string keyPrefix)
        {
            VOID_PanelLine line = this;

            string lineLabelPrecisionKey;
            string lineValuePrecisionKey;

            if (line.LabelIsVarPrecision)
            {
                lineLabelPrecisionKey = string.Format(
                    "{0}_Line{1}_LabelDigits",
                    keyPrefix,
                    line.LineNumber
                    );

                config.SetValue(lineLabelPrecisionKey, line.LabelVarPrecisionDigits);
            }

            if (line.ValueIsVarPrecision)
            {
                lineValuePrecisionKey = string.Format(
                    "{0}_Line{1}_ValueDigits",
                    keyPrefix,
                    line.LineNumber
                    );

                config.SetValue(lineValuePrecisionKey, line.ValueVarPrecisionDigits);
            }
        }
 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();
 }
 void LoadConfigs()
 {
     KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <FlightGUI>();
     config.load();
     mainGuiRect     = config.GetValue("flight_mainGuiRect", new Rect());
     dataGuiRect     = config.GetValue("flight_dataGuiRect", new Rect());
     settingsGuiRect = config.GetValue("flight_settingsGuiRect", new Rect());
 }
Exemplo n.º 13
0
 private static void LoadFromXml()
 {
     KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <SettingsLoader>(); // why use template T?
     config.load();
     guiwindowPosition = config.GetValue <Rect>("guiwindowPosition", guiwindowPosition);
     showConfigs       = config.GetValue <bool>("showConfig", showConfigs);
     guiIsActive       = config.GetValue <bool>("guiIsActive", guiIsActive);
 }
Exemplo n.º 14
0
 public static void SaveToXml()
 {
     KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <SettingsLoader>();
     config.SetValue("guiwindowPosition", guiwindowPosition);
     config.SetValue("showConfig", showConfigs);
     config.SetValue("guiIsActive", guiIsActive);
     config.save();
 }
Exemplo n.º 15
0
        public override void Save(KSP.IO.PluginConfiguration config, string sceneKey)
        {
            base.Save(config, sceneKey);

            foreach (var panel in this.validPanels)
            {
                panel.Save(config, sceneKey);
            }
        }
Exemplo n.º 16
0
        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<Settings>();
            config.load();

            Serialize(false);

            MapGUIWindowPos = new Rect(MapGUIWindowPos.xMin, MapGUIWindowPos.yMin, 1, MapGUIWindowPos.height); // width will be auto-sized to fit contents
        }
 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.º 18
0
        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType <Settings>();
            config.load();

            Serialize(false);

            MapGUIWindowPos = new Rect(MapGUIWindowPos.xMin, MapGUIWindowPos.yMin, 1, MapGUIWindowPos.height); // width will be auto-sized to fit contents
        }
Exemplo n.º 19
0
        public void Awake()
        {
            // load XML config file, set default values if file doesnt exist
            KSP.IO.PluginConfiguration cfg = KSP.IO.PluginConfiguration.CreateForType <GenesisRage.SafeChuteModule>(null);
            cfg.load();

            deWarpGrnd = (float)cfg.GetValue <double>("DeWarpGround", 15.0f);
            maxAlt     = (double)cfg.GetValue <double>("MaxAltitude", 10000.0f);
            SCprint(String.Format("DeWarpGround = {0}, MaxAltitude = {1}", deWarpGrnd, maxAlt));
        }
Exemplo n.º 20
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.º 21
0
        public static Units <T> UnitsFromConfig <T>(ref KSP.IO.PluginConfiguration config, Units <T> defaultUnits = null)
        {
            UnitTypeContainer <T> unitType = UnitType <T>();

            if (unitType == null)
            {
                throw new ArgumentException("Unit type " + typeof(T).ToString() + " has not been registered.  Cannot load from config.");
            }
            return(unitType.UnitsFromConfig(ref config, defaultUnits));
        }
Exemplo n.º 22
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);
        }
Exemplo n.º 23
0
        public static void LoadSettings(ref KSP.IO.PluginConfiguration config)
        {
            UnitsSettingsWindowPos = config.GetValue("unitsSettingsWindowPos", new Rect());

            PressureUnits    = GUIUnits.UnitsFromConfig <GUIUnits.Pressure>(ref config, GUIUnits.Pressure.kPa);
            TemperatureUnits = GUIUnits.UnitsFromConfig <GUIUnits.Temperature>(ref config, GUIUnits.Temperature.kelvin);
            ForceUnits       = GUIUnits.UnitsFromConfig <GUIUnits.Force>(ref config, GUIUnits.Force.kN);
            IspUnits         = GUIUnits.UnitsFromConfig <GUIUnits.Isp>(ref config, GUIUnits.Isp.s);
            TSFCUnits        = GUIUnits.UnitsFromConfig <GUIUnits.TSFC>(ref config, GUIUnits.TSFC.kg__kgf_h);
        }
Exemplo n.º 24
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.º 25
0
        public void LoadSettingsFromConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <EnginesFlightGUI>();
            config.load();

            FlightWindowPos = config.GetValue("flightWindowPos", new Rect());
            //FlightGUI.ShowFlightGUIWindow = config.GetValue("showFlightWindow", false);

            FlightGUISettings.LoadSettings(ref config);
            GUIUnitsSettings.LoadSettings(ref config);
        }
Exemplo n.º 26
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.º 27
0
        private void LoadSettings()
        {
            KSPLog.print("[kalculator.dll] Loading Config...");
            KSP.IO.PluginConfiguration _configfile = KSP.IO.PluginConfiguration.CreateForType <Kalculator>();
            _configfile.load();

            _calcsize       = _configfile.GetValue("windowpos", new Rect(360, 20, 308, 365));
            _keybind        = _configfile.GetValue("keybind", "k");
            _versionlastrun = _configfile.GetValue <string>("version");
            _useKspSkin     = _configfile.GetValue <bool>("KSPSkin", false);

            KSPLog.print("[kalculator.dll] Config Loaded Successfully");
        }
Exemplo n.º 28
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 ");
        }
Exemplo n.º 29
0
        private void Start()
        {
            instance = this;

            if (config == null)
            {
                config = KSP.IO.PluginConfiguration.CreateForType <LINEARWindow>();
            }

            config.load();

            windowRect           = config.GetValue("windowRect", new Rect(500, 500, 300, 0));
            config["windowRect"] = windowRect;
        }
Exemplo n.º 30
0
        public static void LoadConfigs(ConfigNode node)
        {
            config = KSP.IO.PluginConfiguration.CreateForType <FARSettingsScenarioModule>();
            config.load();

            bool tmp;

            if (node.HasValue("allowStructuralFailures") && bool.TryParse(node.GetValue("allowStructuralFailures"), out tmp))
            {
                FARDebugValues.allowStructuralFailures = tmp;
            }
            else
            {
                FARDebugValues.allowStructuralFailures = true;
            }

            if (node.HasValue("showMomentArrows") && bool.TryParse(node.GetValue("showMomentArrows"), out tmp))
            {
                FARDebugValues.showMomentArrows = tmp;
            }
            else
            {
                FARDebugValues.showMomentArrows = false;
            }

            if (node.HasValue("useBlizzyToolbar") && bool.TryParse(node.GetValue("useBlizzyToolbar"), out tmp))
            {
                FARDebugValues.useBlizzyToolbar = tmp;
            }
            else
            {
                FARDebugValues.useBlizzyToolbar = false;
            }

            if (node.HasValue("aeroFailureExplosions") && bool.TryParse(node.GetValue("aeroFailureExplosions"), out tmp))
            {
                FARDebugValues.aeroFailureExplosions = tmp;
            }
            else
            {
                FARDebugValues.aeroFailureExplosions = true;
            }

            FARAeroStress.LoadStressTemplates();
            FARAeroUtil.LoadAeroDataFromConfig();
            FARActionGroupConfiguration.LoadConfiguration();
            FARAnimOverrides.LoadAnimOverrides();

            hasScenarioChanged = true;
        }
Exemplo n.º 31
0
        public void Awake()
        {
            //First, we need to look for the FloorIt slim plugin. It conflicts with this one. We'll throw an exception for it.
            if (Array.Find(AppDomain.CurrentDomain.GetAssemblies(), item => item.FullName == "FloorIt") != null)
            {
                print("ERROR: FloorIt slim edition found. Initialization aborted.");
                throw new Exception("FloorIt slim edition found.");
            }

            configFile = KSP.IO.PluginConfiguration.CreateForType <FloorItPlugin>();
            configFile.load();

            addTriggers();
        }
        public static void LoadConfigs()
        {
            config = KSP.IO.PluginConfiguration.CreateForType <FARDebugOptions>();
            config.load();
            FARDebugValues.displayForces               = Convert.ToBoolean(config.GetValue("displayForces", "false"));
            FARDebugValues.displayCoefficients         = Convert.ToBoolean(config.GetValue("displayCoefficients", "false"));
            FARDebugValues.displayShielding            = Convert.ToBoolean(config.GetValue("displayShielding", "false"));
            FARDebugValues.useSplinesForSupersonicMath = Convert.ToBoolean(config.GetValue("useSplinesForSupersonicMath", "true"));
            FARDebugValues.allowStructuralFailures     = Convert.ToBoolean(config.GetValue("allowStructuralFailures", "true"));

            FARAeroStress.LoadStressTemplates();
            FARPartClassification.LoadClassificationTemplates();
            FARAeroUtil.LoadAeroDataFromConfig();
        }
Exemplo n.º 33
0
        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<Settings>();
			try
			{
				config.load();
			}
			catch (System.Xml.XmlException e)
			{
				if (ConfigError)
					throw; // if previous error handling failed, we give up

				ConfigError = true;

				Debug.Log("Error loading Trajectories config: " + e.ToString());

				string TrajPluginPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
				Debug.Log("Trajectories installed in: " + TrajPluginPath);
				if (System.IO.File.Exists(TrajPluginPath + "/PluginData/Trajectories/config.xml"))
				{
					Debug.Log("Clearing config file...");
					int idx = 1;
					while (System.IO.File.Exists(TrajPluginPath + "/PluginData/Trajectories/config.xml.bak." + idx))
						++idx;
					System.IO.File.Move(TrajPluginPath + "/PluginData/Trajectories/config.xml", TrajPluginPath + "/PluginData/Trajectories/config.xml.bak." + idx);

					Debug.Log("Creating new config...");
					config.load();

					Debug.Log("New config created");
				}
				else
				{
					Debug.Log("No config file exists");
					throw;
				}
			}

            Serialize(false);

            MapGUIWindowPos = new Rect(MapGUIWindowPos.xMin, MapGUIWindowPos.yMin, 1, MapGUIWindowPos.height); // width will be auto-sized to fit contents
        }
        public static void LoadConfigs(ConfigNode node)
        {
            config = KSP.IO.PluginConfiguration.CreateForType<FARSettingsScenarioModule>();
            config.load();

            bool tmp;
            if (node.HasValue("allowStructuralFailures") && bool.TryParse(node.GetValue("allowStructuralFailures"), out tmp))
                FARDebugValues.allowStructuralFailures = tmp;
            else
                FARDebugValues.allowStructuralFailures = true;

            if (node.HasValue("showMomentArrows") && bool.TryParse(node.GetValue("showMomentArrows"), out tmp))
                FARDebugValues.showMomentArrows = tmp;
            else
                FARDebugValues.showMomentArrows = false;

            if (node.HasValue("useBlizzyToolbar") && bool.TryParse(node.GetValue("useBlizzyToolbar"), out tmp))
                FARDebugValues.useBlizzyToolbar = tmp;
            else
                FARDebugValues.useBlizzyToolbar = false;

            if (node.HasValue("aeroFailureExplosions") && bool.TryParse(node.GetValue("aeroFailureExplosions"), out tmp))
                FARDebugValues.aeroFailureExplosions = tmp;
            else
                FARDebugValues.aeroFailureExplosions = true;

            FARAeroStress.LoadStressTemplates();
            FARAeroUtil.LoadAeroDataFromConfig();
            FARActionGroupConfiguration.LoadConfiguration();
            FARAnimOverrides.LoadAnimOverrides();

            Color tmpColor = GUIColors.Instance[0];
            ReColorTexture(ref tmpColor, ref cLTexture);
            GUIColors.Instance[0] = tmpColor;

            tmpColor = GUIColors.Instance[1];
            ReColorTexture(ref tmpColor, ref cDTexture);
            GUIColors.Instance[1] = tmpColor;

            tmpColor = GUIColors.Instance[2];
            ReColorTexture(ref tmpColor, ref cMTexture);
            GUIColors.Instance[2] = tmpColor;

            tmpColor = GUIColors.Instance[3];
            ReColorTexture(ref tmpColor, ref l_DTexture);
            GUIColors.Instance[3] = tmpColor;
        }
 public void LoadConfig()
 {
     Config = KSP.IO.PluginConfiguration.CreateForType<AtmosphericSoundEnhancement>();
     Config.load();
     InteriorVolumeScale = Config.GetValue<float>("InteriorVolumeScale", InteriorVolumeScale);
     InteriorMaxFreq = Config.GetValue<float>("InteriorMaxFreq", InteriorMaxFreq);
     LowerMachThreshold = Config.GetValue<float>("LowerMachThreshold", LowerMachThreshold);
     UpperMachThreshold = Config.GetValue<float>("UpperMachThreshold", UpperMachThreshold);
     MaxDistortion = Config.GetValue<float>("MaxDistortion", MaxDistortion);
     CondensationEffectStrength = Config.GetValue<float>( "CondensationEffectStrength"
                                                        , CondensationEffectStrength
                                                        );
     MaxVacuumFreq = Config.GetValue<float>("MaxVacuumFreq", MaxVacuumFreq);
     MaxSupersonicFreq = Config.GetValue<float>("MaxSupersonicFreq", MaxSupersonicFreq);
     Debug.Log("ASE -- Loaded settings: " + InteriorVolumeScale + " " + InteriorMaxFreq + " " + LowerMachThreshold + " " + UpperMachThreshold + " " + MaxDistortion + " " + CondensationEffectStrength + " " + MaxVacuumFreq + " " + MaxSupersonicFreq);
 }
        public static void LoadConfigs()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<WingProceduralManager> ();
            config.load ();

            WingProceduralManager.uiRectWindowEditor = config.GetValue("uiRectWindowEditor", UIUtility.SetToScreenCenterAlways(new Rect()));
            WingProceduralManager.uiRectWindowDebug = config.GetValue<Rect> ("uiRectWindowDebug", UIUtility.SetToScreenCenterAlways(new Rect()));

            WPDebug.logCAV = Convert.ToBoolean (config.GetValue ("logCAV", "false"));
            WPDebug.logUpdate = Convert.ToBoolean (config.GetValue ("logUpdate", "false"));
            WPDebug.logUpdateGeometry = Convert.ToBoolean (config.GetValue ("logUpdateGeometry", "false"));

            WPDebug.logUpdateMaterials = Convert.ToBoolean (config.GetValue ("logUpdateMaterials", "false"));
            WPDebug.logMeshReferences = Convert.ToBoolean (config.GetValue ("logMeshReferences", "false"));
            WPDebug.logCheckMeshFilter = Convert.ToBoolean (config.GetValue ("logCheckMeshFilter", "false"));

            WPDebug.logPropertyWindow = Convert.ToBoolean (config.GetValue ("logPropertyWindow", "false"));
            WPDebug.logFlightSetup = Convert.ToBoolean (config.GetValue ("logFlightSetup", "false"));
            WPDebug.logFieldSetup = Convert.ToBoolean (config.GetValue ("logFieldSetup", "false"));

            WPDebug.logFuel = Convert.ToBoolean (config.GetValue ("logFuel", "false"));
            WPDebug.logLimits = Convert.ToBoolean (config.GetValue ("logLimits", "false"));
            WPDebug.logEvents = Convert.ToBoolean (config.GetValue ("logEvents", "false"));
        }
        private void LoadPresets()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<IspAdjustmentGUIController>();
            config.load();
            int presetNum = 0;
            do
            {
                string tmpName;
                tmpName = config.GetValue("IspPreset" + presetNum + "Name", "NothingHere");
                //IspPreset tmp = config.GetValue("IspPreset" + presetNum, new IspPreset("NothingHere", "", 1, 1, false));
                if (tmpName == "NothingHere")
                    break;

                IspPreset tmp = new IspPreset();
                tmp.presetName = tmpName;
                tmp.presetDescription = config.GetValue<string>("IspPreset" + presetNum + "Description");
                tmp.vacIspMult = Convert.ToSingle(config.GetValue<string>("IspPreset" + presetNum + "Vac"));
                tmp.atmIspMult = Convert.ToSingle(config.GetValue<string>("IspPreset" + presetNum + "Atm"));

                tmp.extendToZero = config.GetValue<bool>("IspPreset" + presetNum + "Extend");
                tmp.thrustCorrection = config.GetValue<bool>("IspPreset" + presetNum + "ThrustCorrection");

                tmp.ratingIspCutoff = Convert.ToSingle(config.GetValue<string>("IspPreset" + presetNum + "RatingIspCutoff", "385"));
                tmp.ratingThrustCutoff = Convert.ToSingle(config.GetValue<string>("IspPreset" + presetNum + "RatingThrustCutoff", "300"));

                presetNum++;
                IspPresetList.Add(tmp);

            } while (true);

            string gameName = HighLogic.CurrentGame.Title;

            int selectedPresetNum = Convert.ToInt32(config.GetValue("SelectedPreset" + gameName, "0"));

            selectedPreset = IspPresetList[selectedPresetNum];

            print("Presets Loaded...");
        }
        public static void LoadConfigs()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<FARDebugOptions>();
            config.load();
            FARDebugValues.displayForces = Convert.ToBoolean(config.GetValue("displayForces", "false"));
            FARDebugValues.displayCoefficients = Convert.ToBoolean(config.GetValue("displayCoefficients", "false"));
            FARDebugValues.displayShielding = Convert.ToBoolean(config.GetValue("displayShielding", "false"));
            FARDebugValues.useSplinesForSupersonicMath = Convert.ToBoolean(config.GetValue("useSplinesForSupersonicMath", "true"));
            FARDebugValues.allowStructuralFailures = Convert.ToBoolean(config.GetValue("allowStructuralFailures", "true"));

            FARDebugValues.useBlizzyToolbar = Convert.ToBoolean(config.GetValue("useBlizzyToolbar", "false"));

            FARAeroStress.LoadStressTemplates();
            FARPartClassification.LoadClassificationTemplates();
            FARAeroUtil.LoadAeroDataFromConfig();
        }