diff --git a/GameData/CommNetConstellation/Textures/groundStationMark.png b/GameData/CommNetConstellation/Textures/groundStationMark.png index 44e5f8c..bc133a4 100644 Binary files a/GameData/CommNetConstellation/Textures/groundStationMark.png and b/GameData/CommNetConstellation/Textures/groundStationMark.png differ diff --git a/src/CommNetConstellation/CommNetLayer/CNCCommNetHome.cs b/src/CommNetConstellation/CommNetLayer/CNCCommNetHome.cs index 45163d4..f5b63ad 100644 --- a/src/CommNetConstellation/CommNetLayer/CNCCommNetHome.cs +++ b/src/CommNetConstellation/CommNetLayer/CNCCommNetHome.cs @@ -96,6 +96,9 @@ public void OnGUI() if ((!HighLogic.CurrentGame.Parameters.CustomParams().enableGroundStations && !this.isKSC) || !MapView.MapIsEnabled || MapView.MapCamera == null) return; + if (CNCCommNetScenario.Instance.hideGroundStations) + return; + Vector3d worldPos = ScaledSpace.LocalToScaledSpace(nodeTransform.transform.position); if (MapView.MapCamera.transform.InverseTransformPoint(worldPos).z < 0f) diff --git a/src/CommNetConstellation/CommNetLayer/CNCCommNetScenario.cs b/src/CommNetConstellation/CommNetLayer/CNCCommNetScenario.cs index 7e10e49..eb3239d 100644 --- a/src/CommNetConstellation/CommNetLayer/CNCCommNetScenario.cs +++ b/src/CommNetConstellation/CommNetLayer/CNCCommNetScenario.cs @@ -28,6 +28,7 @@ public class CNCCommNetScenario : CommNetScenario private List persistentGroundStations; // leave the initialisation to OnLoad() private List commVessels; private bool dirtyCommNetVesselList; + public bool hideGroundStations; public static new CNCCommNetScenario Instance { @@ -153,6 +154,9 @@ public override void OnLoad(ConfigNode gameNode) case "DisplayModeFlight": CNCCommNetUI.CustomModeFlightMap = (CNCCommNetUI.CustomDisplayMode)((int)Enum.Parse(typeof(CNCCommNetUI.CustomDisplayMode), value.value)); break; + case "HideGroundStations": + this.hideGroundStations = Boolean.Parse(value.value); + break; } } @@ -230,6 +234,7 @@ public override void OnSave(ConfigNode gameNode) //Other variables gameNode.AddValue("DisplayModeTracking", CNCCommNetUI.CustomModeTrackingStation); gameNode.AddValue("DisplayModeFlight", CNCCommNetUI.CustomModeFlightMap); + gameNode.AddValue("HideGroundStations", this.hideGroundStations); //Constellations if (!gameNode.HasNode("Constellations")) diff --git a/src/CommNetConstellation/UI/ConstellationControlDialog.cs b/src/CommNetConstellation/UI/ConstellationControlDialog.cs index 96e88fb..b928a33 100644 --- a/src/CommNetConstellation/UI/ConstellationControlDialog.cs +++ b/src/CommNetConstellation/UI/ConstellationControlDialog.cs @@ -451,6 +451,12 @@ private List populateVesselRows(VesselTypeFilter filt private List getGroundstationContentLayout() { List stationComponments = new List(); + + //toggle button for ground station markers + DialogGUIToggleButton toggleStationButton = new DialogGUIToggleButton(CNCCommNetScenario.Instance.hideGroundStations, "Hide all station markers", delegate (bool b) { CNCCommNetScenario.Instance.hideGroundStations = !CNCCommNetScenario.Instance.hideGroundStations; }, 60, 25); + DialogGUIHorizontalLayout toggleStationGroup = new DialogGUIHorizontalLayout(true, false, 4, new RectOffset(), TextAnchor.MiddleCenter, new DialogGUIBase[] { new DialogGUIFlexibleSpace(), toggleStationButton, new DialogGUIFlexibleSpace() }); + stationComponments.Add(toggleStationGroup); + List rows = populateGroundStationRows(); for (int i = 0; i < rows.Count; i++) { @@ -485,7 +491,7 @@ private DialogGUIHorizontalLayout createGroundStationRow(CNCCommNetHome thisStat DialogGUIImage colorImage = new DialogGUIImage(new Vector2(16, 16), Vector2.one, thisStation.Color, groundstationTexture); DialogGUILabel stationNameLabel = new DialogGUILabel(thisStation.stationName, 170, 12); DialogGUILabel locationLabel = new DialogGUILabel(string.Format("LAT: {0:0.0}\nLON: {1:0.0}", thisStation.latitude, thisStation.longitude), 100, 24); - DialogGUILabel freqsLabel = new DialogGUILabel(getFreqString(thisStation.Frequencies), 200, 12); + DialogGUILabel freqsLabel = new DialogGUILabel(getFreqString(thisStation.Frequencies), 210, 12); DialogGUIButton updateButton = new DialogGUIButton("Edit", delegate { groundstationEditClick(thisStation); }, 50, 32, false); DialogGUIBase[] rowGUIBase = new DialogGUIBase[] { colorImage, stationNameLabel, locationLabel, freqsLabel, updateButton }; diff --git a/src/groundStationMark.psd b/src/groundStationMark.psd new file mode 100644 index 0000000..2a5e754 Binary files /dev/null and b/src/groundStationMark.psd differ