Ejemplo n.º 1
0
        //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");
            }
        }
Ejemplo n.º 2
0
        private void WindowSc(int id)
        {
            //Init styles
            if (!Textures.StylesSet)
            {
                Textures.SetupStyles();
            }

            Utilities._TooltipStyle.normal.background = Textures.TooltipBox;
            Utilities._TooltipStyle.normal.textColor  = new Color32(207, 207, 207, 255);
            Utilities._TooltipStyle.hover.textColor   = Color.blue;

            GUIContent closeContent = new GUIContent(Textures.BtnRedCross, Localizer.Format("#autoLOC_AmpYear_1000007"));     //#autoLOC_AmpYear_1000007 = Close Window
            Rect       closeRect    = new Rect(SCwindowPos.width - 21, 4, 16, 16);

            if (GUI.Button(closeRect, closeContent, Textures.PartListbtnStyle))
            {
                AYSCMenuAppLToolBar.GuiVisible = false;
                LoadSettingsSC = true;
                return;
            }

            GUILayout.BeginVertical();
            _bodscrollViewVector = GUILayout.BeginScrollView(_bodscrollViewVector, GUILayout.Height(WINDOW_BASE_HEIGHT - 30), GUILayout.Width(SCWINDOW_WIDTH - 10));


            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000170"), Localizer.Format("#autoLOC_AmpYear_1000171")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000170 = AmpYear Monitoring uses EC		// #autoLOC_AmpYear_1000171 = If ON AmpYear uses EC for it's monitoring functions. If Off it does not.
            _inputAYMonitoringUseEC = GUILayout.Toggle(_inputAYMonitoringUseEC, "", GUILayout.MinWidth(30.0F));                                                                    //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000172"), Localizer.Format("#autoLOC_AmpYear_1000173")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000172 = Reserve Battery Recharge Percentage		// #autoLOC_AmpYear_1000173 = The percentage of Main Power available before AmpYear begins recharging Reserve Batteries
            _inputSrrt = Regex.Replace(GUILayout.TextField(_inputSrrt, 3, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                              //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000174"), Localizer.Format("#autoLOC_AmpYear_1000175")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000174 = Power Low Warning Percentage		// #autoLOC_AmpYear_1000175 = A Warning window will open when the percentage of Main Power Available reaches this percentage value
            _inputSplw = Regex.Replace(GUILayout.TextField(_inputSplw, 3, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                              //you can play with the width of the text box
            GUILayout.EndHorizontal();

            if (KKPresent)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000176"), Localizer.Format("#autoLOC_AmpYear_1000177")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000176 = Climate Control Elec. Drain		// #autoLOC_AmpYear_1000177 = The amount of EC the Climate Control system will use per second
                _inputSccbdf = Regex.Replace(GUILayout.TextField(_inputSccbdf, 2, GUILayout.MinWidth(10.0F)), "[^.0-9]", "");                                                          //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000178"), Localizer.Format("#autoLOC_AmpYear_1000179")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000178 = Climate Control Target Temp.		// #autoLOC_AmpYear_1000179 = The temperature in Celcius the Climate Control System will try to maintain in teh cabin
                _inputSctt = Regex.Replace(GUILayout.TextField(_inputSctt, 2, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                              //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000180"), Localizer.Format("#autoLOC_AmpYear_1000181")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000180 = Massage Electrical Drain		// #autoLOC_AmpYear_1000181 = The amount of EC the Massage Chair system will use per second
                _inputSmbdf = Regex.Replace(GUILayout.TextField(_inputSmbdf, 2, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000182"), Localizer.Format("#autoLOC_AmpYear_1000183")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000182 = Kraziness Base Growth Amount		// #autoLOC_AmpYear_1000183 = The percentage amount that Kraziness will grow per second
                _inputScbdf = Regex.Replace(GUILayout.TextField(_inputScbdf, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000184"), Localizer.Format("#autoLOC_AmpYear_1000185")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000184 = Temp Uncomfortable Kraziness		// #autoLOC_AmpYear_1000185 = The degrees Celcius where the actual cabin temperature is < less than or > greater than the target temperature. If this occurs Kraziness will go up faster
                _inputSccuf = Regex.Replace(GUILayout.TextField(_inputSccuf, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000186"), Localizer.Format("#autoLOC_AmpYear_1000187")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000186 = Climate Kraziness Reduction		// #autoLOC_AmpYear_1000187 = The percentage amount that Climate Control system will reduce Kraziness per second
                _inputSccrf = Regex.Replace(GUILayout.TextField(_inputSccrf, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000188"), Localizer.Format("#autoLOC_AmpYear_1000189")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000188 = Music Kraziness Reduction		// #autoLOC_AmpYear_1000189 = The percentage amount that the music system will reduce Kraziness per second
                _inputScrrf = Regex.Replace(GUILayout.TextField(_inputScrrf, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000190"), Localizer.Format("#autoLOC_AmpYear_1000191")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000190 = Massage Kraziness Reduction		// #autoLOC_AmpYear_1000191 = The percentage amount that the Massage chairs will reduce Kraziness per second
                _inputScmrf = Regex.Replace(GUILayout.TextField(_inputScmrf, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                            //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000192"), Localizer.Format("#autoLOC_AmpYear_1000193")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000192 = Kraziness Minor Problem Limit		// #autoLOC_AmpYear_1000193 = The percentage amount of Kraziness where minor bad things will start happening
                _inputScMinL = Regex.Replace(GUILayout.TextField(_inputScMinL, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                          //you can play with the width of the text box
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000194"), Localizer.Format("#autoLOC_AmpYear_1000195")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000194 = Kraziness Major Problem Limit		// #autoLOC_AmpYear_1000195 = The percentage amount of Kraziness where major bad things will start happening
                _inputScMajL = Regex.Replace(GUILayout.TextField(_inputScMajL, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                                          //you can play with the width of the text box
                GUILayout.EndHorizontal();
            }

            if (!ToolbarManager.ToolbarAvailable)
            {
                GUI.enabled = false;
                tmpToolTip  = Localizer.Format("#autoLOC_AmpYear_1000196");             // #autoLOC_AmpYear_1000196 = Not available unless ToolBar mod is installed
            }
            else
            {
                tmpToolTip =
                    Localizer.Format("#autoLOC_AmpYear_1000197");               // #autoLOC_AmpYear_1000197 = If ON Icon will appear in the stock Applauncher, if OFF Icon will appear in ToolBar mod
            }

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000198"), tmpToolTip), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000198 = Use Application Launcher Button
            _inputAppL = GUILayout.Toggle(_inputAppL, "", GUILayout.MinWidth(30.0F));                                                            //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUI.enabled = true;

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000199"), Localizer.Format("#autoLOC_AmpYear_1000200")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000199 = Debug Mode		// #autoLOC_AmpYear_1000200 = Creates logs of logging messages to help when there are problems, but will slow KSP down
            _inputSdebug = GUILayout.Toggle(_inputSdebug, "", GUILayout.MinWidth(30.0F));                                                                                          //you can play with the width of the text box
            _inputVdebug = _inputSdebug;
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000201"), Localizer.Format("#autoLOC_AmpYear_1000202")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000201 = ToolTips On		// #autoLOC_AmpYear_1000202 = If On then you will see ToolTips like this one, If off - well you won't
            _inputToolTipsOn = GUILayout.Toggle(_inputToolTipsOn, "", GUILayout.MinWidth(30.0F));                                                                                  //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000203"), Localizer.Format("#autoLOC_AmpYear_1000204")), Textures.StatusStyle);            // #autoLOC_AmpYear_1000203 = EC Producer Module Highlight Color:		// #autoLOC_AmpYear_1000204 = The color that EC production modules will be highlighted with.\nMove the sliders to set the Color.
            GUILayout.BeginHorizontal();
            prodPartRedValue   = _inputProdPartHighlightColor.r * 255f;
            prodPartGreenValue = _inputProdPartHighlightColor.g * 255f;
            prodPartBlueValue  = _inputProdPartHighlightColor.b * 255f;
            prodPartRedValue   = GUILayout.HorizontalSlider(prodPartRedValue, 0f, 255f);
            prodPartGreenValue = GUILayout.HorizontalSlider(prodPartGreenValue, 0f, 255f);
            prodPartBlueValue  = GUILayout.HorizontalSlider(prodPartBlueValue, 0f, 255f);
            GUILayout.EndHorizontal();

            GUIStyle prodPartstyle = new GUIStyle();

            _inputProdPartHighlightColor = new Color(prodPartRedValue / 255f, prodPartGreenValue / 255f, prodPartBlueValue / 255f);
            prodPartstyleTexture.SetPixel(0, 0, _inputProdPartHighlightColor);
            prodPartstyleTexture.Apply();
            prodPartstyle.normal.background = prodPartstyleTexture;
            GUILayout.Box(new GUIContent(""), prodPartstyle, GUILayout.Height(20));


            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000205"), Localizer.Format("#autoLOC_AmpYear_1000206")), Textures.StatusStyle);            // #autoLOC_AmpYear_1000205 = EC Consumer Module Highlight Color:		// #autoLOC_AmpYear_1000206 = The color that EC consumer modules will be highlighted with.\nMove the sliders to set the Color.
            GUILayout.BeginHorizontal();
            consPartRedValue   = _inputConsPartHighlightColor.r * 255f;
            consPartGreenValue = _inputConsPartHighlightColor.g * 255f;
            consPartBlueValue  = _inputConsPartHighlightColor.b * 255f;
            consPartRedValue   = GUILayout.HorizontalSlider(consPartRedValue, 0f, 255f);
            consPartGreenValue = GUILayout.HorizontalSlider(consPartGreenValue, 0f, 255f);
            consPartBlueValue  = GUILayout.HorizontalSlider(consPartBlueValue, 0f, 255f);
            GUILayout.EndHorizontal();

            GUIStyle consPartstyle = new GUIStyle();

            _inputConsPartHighlightColor = new Color(consPartRedValue / 255f, consPartGreenValue / 255f, consPartBlueValue / 255f);
            consPartstyleTexture.SetPixel(0, 0, _inputConsPartHighlightColor);
            consPartstyleTexture.Apply();
            consPartstyle.normal.background = consPartstyleTexture;
            GUILayout.Box(new GUIContent(""), consPartstyle, GUILayout.Height(20));

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000207"), Localizer.Format("#autoLOC_AmpYear_1000208")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000207 = ESP High Threshold		// #autoLOC_AmpYear_1000208 = The percentage of Main Power where Emergency Shutdow Procedure will shutdown/restart High priority modules. Must be >= 1%
            _inputSESPHighThreshold = Regex.Replace(GUILayout.TextField(_inputSESPHighThreshold, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                    //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000209"), Localizer.Format("#autoLOC_AmpYear_1000210")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000209 = ESP Medium Threshold		// #autoLOC_AmpYear_1000210 = The percentage of Main Power where Emergency Shutdow Procedure will shutdown/restart Medium priority modules. Must be >= High Threshold + 1%
            _inputSESPMediumThreshold = Regex.Replace(GUILayout.TextField(_inputSESPMediumThreshold, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000211"), Localizer.Format("#autoLOC_AmpYear_1000212")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000211 = ESP Low Threshold		// #autoLOC_AmpYear_1000212 = The percentage of Main Power where Emergency Shutdow Procedure will shutdown/restart Low priority modules. Must be >= Medium Threshold + 1%
            _inputSESPLowThreshold = Regex.Replace(GUILayout.TextField(_inputSESPLowThreshold, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                                      //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000213"), Localizer.Format("#autoLOC_AmpYear_1000214")), Textures.StatusStyle, GUILayout.Width(300)); // #autoLOC_AmpYear_1000213 = Emergency Shutdown Cooldown Period		// #autoLOC_AmpYear_1000214 = The Cooldown period of time in seconds after an Emergency Shutdown is performed
            _inputSEmgcyShutOverrideCooldown = Regex.Replace(GUILayout.TextField(_inputSEmgcyShutOverrideCooldown, 5, GUILayout.MinWidth(30.0F)), "[^.0-9]", "");                  //you can play with the width of the text box
            GUILayout.EndHorizontal();

            GUILayout.Box(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000215"), Localizer.Format("#autoLOC_AmpYear_1000216")), Textures.SectionTitleStyle, GUILayout.Width(300));                // #autoLOC_AmpYear_1000215 = Emergency Shutdown Procedures - Module Defaults		// #autoLOC_AmpYear_1000216 = Default values for ESP system

            for (int i = _inputPartModuleEmergShutDnDflt.Count; i-- > 0;)
            {
                KeyValuePair <ValidEmergencyPartModule, ESPValues> validentry = _inputPartModuleEmergShutDnDflt[i];
                if (!KKPresent &&
                    (validentry.Key.Name == "ClimateControl" || validentry.Key.Name == "SmoothJazz" || validentry.Key.Name == "MassageChair"))
                {
                    continue;
                }
                GUILayout.BeginHorizontal();
                GUILayout.Box(Localizer.Format(validentry.Key.displayName), Textures.StatusStyle, GUILayout.Width(300));
                bool tmpBool = validentry.Value.EmergShutDnDflt;
                tmpBool = GUILayout.Toggle(tmpBool, new GUIContent("", Localizer.Format("#autoLOC_AmpYear_1000217")), GUILayout.MinWidth(30.0F)); //you can play with the width of the text box		// #autoLOC_AmpYear_1000217 = If ON any Parts with this Module will be included in Emergency Shutdown Procedures, If OFF then it won't be included
                List <GUIContent> tmpList = new List <GUIContent>();
                tmpList.Add(new GUIContent(Textures.BtnPriority1, Localizer.Format("#autoLOC_AmpYear_1000218")));                                 // #autoLOC_AmpYear_1000218 = Emergency Shutdown Procedures - Set Default for this Module to Priority One
                tmpList.Add(new GUIContent(Textures.BtnPriority2, Localizer.Format("#autoLOC_AmpYear_1000219")));                                 // #autoLOC_AmpYear_1000219 = Emergency Shutdown Procedures - Set Default for this Module to Priority Two
                tmpList.Add(new GUIContent(Textures.BtnPriority3, Localizer.Format("#autoLOC_AmpYear_1000220")));                                 // #autoLOC_AmpYear_1000220 = Emergency Shutdown Procedures - Set Default for this Module to Priority Three
                GUIContent[]    tmpToggles    = tmpList.ToArray();
                List <GUIStyle> tmpStylesList = new List <GUIStyle>();
                tmpStylesList.Add(Textures.PrioritybtnStyle);
                tmpStylesList.Add(Textures.PrioritybtnStyle);
                tmpStylesList.Add(Textures.PrioritybtnStyle);
                GUIStyle[] tmpStylesToggles = tmpStylesList.ToArray();
                int        tmpESPPriority   = Utilities.ToggleList((int)validentry.Value.EmergShutPriority - 1, tmpToggles, tmpStylesToggles, 20);
                var        tmpIndex         = _inputPartModuleEmergShutDnDflt.FindIndex(a => a.Key == validentry.Key);
                ESPValues  tmpEspValues     = new ESPValues(tmpBool, (ESPPriority)(tmpESPPriority + 1));
                _inputPartModuleEmergShutDnDflt[tmpIndex] = new KeyValuePair <ValidEmergencyPartModule, ESPValues>(validentry.Key, tmpEspValues);
                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();

            GUILayout.EndVertical();

            if (!Double.TryParse(_inputSrrt, out _inputVrrt))
            {
                _inputVrrt = RECHARGE_RESERVE_THRESHOLD;
            }
            if (!Double.TryParse(_inputSplw, out _inputVplw))
            {
                _inputVplw = POWER_LOW_WARNING_AMT;
            }
            if (!Double.TryParse(_inputSESPHighThreshold, out _inputVESPHighThreshold))
            {
                _inputVESPHighThreshold = ESPHighThreshold;
            }
            if (!Double.TryParse(_inputSESPMediumThreshold, out _inputVESPMediumThreshold))
            {
                _inputVESPMediumThreshold = ESPMediumThreshold;
            }
            if (!Double.TryParse(_inputSESPLowThreshold, out _inputVESPLowThreshold))
            {
                _inputVESPLowThreshold = ESPLowThreshold;
            }
            //Apply rules to the ESPThresholds. High must be 1% or higher
            // Medium must be 5% more than High or higher.
            // Low must be 5% more than Medium or higher.
            if (_inputVESPHighThreshold < 1)
            {
                _inputVESPHighThreshold = ESPHighThreshold = 1;
                _inputSESPHighThreshold = _inputVESPHighThreshold.ToString();
                ScreenMessages.PostScreenMessage(
                    Localizer.Format("#autoLOC_AmpYear_1000221"), 5.0f,                         // #autoLOC_AmpYear_1000221 = ESP High Threshold must be 1% or greater. Reset to 1%
                    ScreenMessageStyle.UPPER_CENTER);
            }
            if (_inputVESPMediumThreshold < ESPHighThreshold + 5)
            {
                _inputVESPMediumThreshold = ESPMediumThreshold = ESPHighThreshold + 5;
                _inputSESPMediumThreshold = _inputVESPMediumThreshold.ToString();
                ScreenMessages.PostScreenMessage(
                    Localizer.Format("#autoLOC_AmpYear_1000222", _inputVESPMediumThreshold.ToString("##")), 5.0f,                               // #autoLOC_AmpYear_1000222 = ESP Medium Threshold must be 5% More than High Threshhold. Reset to
                    ScreenMessageStyle.UPPER_CENTER);
            }
            if (_inputVESPLowThreshold < ESPMediumThreshold + 5)
            {
                _inputVESPLowThreshold = ESPLowThreshold = ESPMediumThreshold + 5;
                _inputSESPLowThreshold = _inputVESPLowThreshold.ToString();
                ScreenMessages.PostScreenMessage(
                    Localizer.Format("#autoLOC_AmpYear_1000223", _inputVESPLowThreshold.ToString("##")), 5.0f,                          // #autoLOC_AmpYear_1000223 = ESP Low Threshold must be 5% More than Medium Threshhold. Reset to
                    ScreenMessageStyle.UPPER_CENTER);
            }
            if (!Double.TryParse(_inputSEmgcyShutOverrideCooldown, out _inputVEmgcyShutOverrideCooldown))
            {
                _inputVEmgcyShutOverrideCooldown = EmgcyShutOverrideCooldown;
            }
            if (_inputVEmgcyShutOverrideCooldown < 30)
            {
                _inputVEmgcyShutOverrideCooldown = 30;
                _inputSEmgcyShutOverrideCooldown = "30";
                ScreenMessages.PostScreenMessage(
                    Localizer.Format("#autoLOC_AmpYear_1000224"), 5.0f, ScreenMessageStyle.UPPER_CENTER);                               // #autoLOC_AmpYear_1000224 = ESP Cooldown Period must be at least 30 secs. Reset to 30 secs.
            }

            if (KKPresent)
            {
                if (!Double.TryParse(_inputSccbdf, out _inputVccbdf))
                {
                    _inputVccbdf = CLIMATE_BASE_DRAIN_FACTOR;
                }
                if (!float.TryParse(_inputSctt, out _inputVctt))
                {
                    _inputVctt = CLIMATE_TARGET_TEMP;
                }
                if (!Double.TryParse(_inputSmbdf, out _inputVmbdf))
                {
                    _inputVmbdf = MASSAGE_BASE_DRAIN_FACTOR;
                }
                if (!Double.TryParse(_inputScbdf, out _inputVcbdf))
                {
                    _inputVcbdf = CRAZY_BASE_DRAIN_FACTOR;
                }
                if (!Double.TryParse(_inputSccuf, out _inputVccuf))
                {
                    _inputVccuf = CRAZY_CLIMATE_UNCOMF_FACTOR;
                }
                if (!Double.TryParse(_inputSccrf, out _inputVccrf))
                {
                    _inputVccrf = CRAZY_CLIMATE_REDUCE_FACTOR;
                }
                if (!Double.TryParse(_inputScrrf, out _inputVcrrf))
                {
                    _inputVcrrf = CRAZY_RADIO_REDUCE_FACTOR;
                }
                if (!Double.TryParse(_inputScmrf, out _inputVcmrf))
                {
                    _inputVcmrf = CRAZY_MASSAGE_REDUCE_FACTOR;
                }
                if (!Double.TryParse(_inputScMinL, out _inputVcMinL))
                {
                    _inputVcMinL = CRAZY_MINOR_LIMIT;
                }
                if (!Double.TryParse(_inputScMajL, out _inputVcMajL))
                {
                    _inputVcMajL = CRAZY_MAJOR_LIMIT;
                }
            }

            if (GUILayout.Button(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000225"), Localizer.Format("#autoLOC_AmpYear_1000226"))))           // #autoLOC_AmpYear_1000225 = Save Settings		// #autoLOC_AmpYear_1000226 = This will save you settings changes to the config.cfg file
            {
                CLIMATE_BASE_DRAIN_FACTOR   = _inputVccbdf;
                CLIMATE_TARGET_TEMP         = _inputVctt;
                MASSAGE_BASE_DRAIN_FACTOR   = _inputVmbdf;
                RECHARGE_RESERVE_THRESHOLD  = _inputVrrt / 100;
                POWER_LOW_WARNING_AMT       = _inputVplw;
                CRAZY_BASE_DRAIN_FACTOR     = _inputVcbdf;
                CRAZY_CLIMATE_UNCOMF_FACTOR = _inputVccuf;
                CRAZY_CLIMATE_REDUCE_FACTOR = _inputVccrf;
                CRAZY_RADIO_REDUCE_FACTOR   = _inputVcrrf;
                CRAZY_MASSAGE_REDUCE_FACTOR = _inputVcmrf;
                CRAZY_MINOR_LIMIT           = _inputVcMinL;
                CRAZY_MAJOR_LIMIT           = _inputVcMajL;
                if (Useapplauncher != _inputAppL)
                {
                    Useapplauncher = _inputAppL;
                    AYSCMenuAppLToolBar.chgAppIconStockToolBar(Useapplauncher);
                }
                Useapplauncher            = _inputAppL;
                _debugging                = _inputVdebug;
                Utilities.debuggingOn     = _debugging;
                _toolTipsOn               = _inputToolTipsOn;
                ESPHighThreshold          = _inputVESPHighThreshold;
                ESPMediumThreshold        = _inputVESPMediumThreshold;
                ESPLowThreshold           = _inputVESPLowThreshold;
                EmgcyShutOverrideCooldown = _inputVEmgcyShutOverrideCooldown;
                AYMonitoringUseEC         = _inputAYMonitoringUseEC;
                ProdPartHighlightColor    = _inputProdPartHighlightColor;
                ConsPartHighlightColor    = _inputConsPartHighlightColor;
                //Textures.SetupHighLightStyles(ProdPartHighlightColor, ConsPartHighlightColor);
                PartModuleEmergShutDnDflt.Clear();
                foreach (KeyValuePair <ValidEmergencyPartModule, ESPValues> validentry in _inputPartModuleEmergShutDnDflt)
                {
                    PartModuleEmergShutDnDflt.Add(new KeyValuePair <ValidEmergencyPartModule, ESPValues>(validentry.Key, validentry.Value));
                }
                LoadSettingsSC = true;
                if (KKPresent)
                {
                    SaveKKSettings();
                }
            }
            if (GUILayout.Button(new GUIContent(Localizer.Format("#autoLOC_AmpYear_1000227"), Localizer.Format("#autoLOC_AmpYear_1000228"))))           // #autoLOC_AmpYear_1000227 = Reset Settings		// #autoLOC_AmpYear_1000228 = This will reload the settings from the config.cfg without saving your changes
            {
                LoadSettingsSC = true;
            }
            if (_toolTipsOn)
            {
                Utilities.SetTooltipText();
            }
            GUI.DragWindow();
        }