public void Save(ConfigNode globalNode) { Utilities.Log_Debug("AYSCController Save"); _aYsettings.SCwindowPosX = SCwindowPos.x; _aYsettings.SCwindowPosY = SCwindowPos.y; _aYsettings.RECHARGE_RESERVE_THRESHOLD = RECHARGE_RESERVE_THRESHOLD; _aYsettings.POWER_LOW_WARNING_AMT = POWER_LOW_WARNING_AMT; _aYsettings.UseAppLauncher = Useapplauncher; _aYsettings.debugging = _debugging; Utilities.debuggingOn = _debugging; _aYsettings.TooltipsOn = _toolTipsOn; _aYsettings.ESPHighThreshold = ESPHighThreshold; _aYsettings.ESPMediumThreshold = ESPMediumThreshold; _aYsettings.ESPLowThreshold = ESPLowThreshold; _aYsettings.EmgcyShutOverrideCooldown = EmgcyShutOverrideCooldown; _aYsettings.AYMonitoringUseEC = AYMonitoringUseEC; _aYsettings.ProdPartHighlightColor = ProdPartHighlightColor; _aYsettings.ConsPartHighlightColor = ConsPartHighlightColor; _aYsettings.PartModuleEmergShutDnDflt.Clear(); foreach (KeyValuePair <ValidEmergencyPartModule, ESPValues> validentry in PartModuleEmergShutDnDflt) { _aYsettings.PartModuleEmergShutDnDflt.Add(new KeyValuePair <ValidEmergencyPartModule, ESPValues>(validentry.Key, validentry.Value)); } Textures.SetupHighLightStyles(ProdPartHighlightColor, ConsPartHighlightColor); Utilities.Log_Debug("AYSController Save end"); }
//Settings Functions Follow public void Load(ConfigNode node) { if (node.HasNode(configNodeName)) { ConfigNode AYsettingsNode = new ConfigNode(); if (!node.TryGetNode(configNodeName, ref AYsettingsNode)) { return; } AYsettingsNode.TryGetValue("FwindowPosX", ref this.FwindowPosX); AYsettingsNode.TryGetValue("FwindowPosY", ref FwindowPosY); AYsettingsNode.TryGetValue("EwindowPosX", ref EwindowPosX); AYsettingsNode.TryGetValue("EwindowPosY", ref EwindowPosY); AYsettingsNode.TryGetValue("SCwindowPosX", ref SCwindowPosX); AYsettingsNode.TryGetValue("SCwindowPosY", ref SCwindowPosY); AYsettingsNode.TryGetValue("EPLwindowPosX", ref EPLwindowPosX); AYsettingsNode.TryGetValue("EPLwindowPosY", ref EPLwindowPosY); AYsettingsNode.TryGetValue("RECHARGE_RESERVE_THRESHOLD", ref RECHARGE_RESERVE_THRESHOLD); AYsettingsNode.TryGetValue("POWER_LOW_WARNING_AMT", ref POWER_LOW_WARNING_AMT); AYsettingsNode.TryGetValue("UseAppLauncher", ref UseAppLauncher); AYsettingsNode.TryGetValue("debugging", ref debugging); RSTUtils.Utilities.debuggingOn = debugging; AYsettingsNode.TryGetValue("TooltipsOn", ref TooltipsOn); AYsettingsNode.TryGetValue("ShowSI", ref showSI); AYsettingsNode.TryGetValue("ESPHighThreshold", ref ESPHighThreshold); AYsettingsNode.TryGetValue("ESPMediumThreshold", ref ESPMediumThreshold); AYsettingsNode.TryGetValue("ESPLowThreshold", ref ESPLowThreshold); AYsettingsNode.TryGetValue("EmgcyShutOverrideCooldown", ref EmgcyShutOverrideCooldown); AYsettingsNode.TryGetValue("AYMonitoringUseEC", ref AYMonitoringUseEC); AYsettingsNode.TryGetValue("ProdPartHighlightColor", ref ProdPartHighlightColor); AYsettingsNode.TryGetValue("ConsPartHighlightColor", ref ConsPartHighlightColor); foreach (ValidEmergencyPartModule validentry in ValidPartModuleEmergShutDn) { ESPValues tmpESPVals = new ESPValues(true, ESPPriority.MEDIUM); string tmpStr = ""; if (AYsettingsNode.TryGetValue(validentry.Name, ref tmpStr)) { string[] tmpStrStrings = tmpStr.Split(','); if (tmpStrStrings.Length == 2) { bool tmpBool = false; if (bool.TryParse(tmpStrStrings[0], out tmpBool)) { tmpESPVals.EmergShutDnDflt = tmpBool; } int tmpInt = 2; if (int.TryParse(tmpStrStrings[1], out tmpInt)) { tmpESPVals.EmergShutPriority = (ESPPriority)tmpInt; } } } PartModuleEmergShutDnDflt.Add(new KeyValuePair <ValidEmergencyPartModule, ESPValues>(validentry, tmpESPVals)); } Textures.SetupHighLightStyles(ProdPartHighlightColor, ConsPartHighlightColor); RSTUtils.Utilities.Log_Debug("AYSettings load complete"); } }