Added UseAdditiveRanges toggle in the configuration, and support for it elsewhere.
[AntennaRange.git] / ARConfiguration.cs
blob:a/ARConfiguration.cs -> blob:b/ARConfiguration.cs
--- a/ARConfiguration.cs
+++ b/ARConfiguration.cs
@@ -23,6 +23,7 @@
 		private const string FIXED_POWER_KEY = "fixedPowerCost";
 		private const string PRETTY_LINES_KEY = "drawPrettyLines";
 		private const string UPDATE_DELAY_KEY = "updateDelay";
+		private const string USE_ADDITIVE_KEY = "useAdditiveRanges";
 
 		private const string TRACKING_STATION_RANGES_KEY = "TRACKING_STATION_RANGES";
 		private const string RANGE_KEY = "range";
@@ -82,6 +83,12 @@
 			private set;
 		}
 
+		public static bool UseAdditiveRanges
+		{
+			get;
+			private set;
+		}
+
 		/// <summary>
 		/// Gets Kerbin's relay range based on the current tracking station level.
 		/// </summary>
@@ -158,6 +165,8 @@
 			ARConfiguration.PrettyLines = this.LoadConfigValue(PRETTY_LINES_KEY, true);
 
 			ARConfiguration.UpdateDelay = this.LoadConfigValue(UPDATE_DELAY_KEY, 16L);
+
+			ARConfiguration.UseAdditiveRanges = this.LoadConfigValue(USE_ADDITIVE_KEY, true);
 
 			this.updateDelayStr = ARConfiguration.UpdateDelay.ToString();
 
@@ -314,6 +323,17 @@
 
 			GUILayout.BeginHorizontal();
 
+			bool useAdditive = GUITools.Toggle(ARConfiguration.UseAdditiveRanges, "Use Additive Ranges");
+			if (useAdditive != ARConfiguration.UseAdditiveRanges)
+			{
+				ARConfiguration.UseAdditiveRanges = useAdditive;
+				this.SaveConfigValue(USE_ADDITIVE_KEY, useAdditive);
+			}
+
+			GUILayout.EndHorizontal();
+
+			GUILayout.BeginHorizontal();
+
 			bool prettyLines = GUITools.Toggle(ARConfiguration.PrettyLines, "Draw Pretty Lines");
 			if (prettyLines != ARConfiguration.PrettyLines)
 			{