From c7199b7ae325def649c08c3ac99fe2f8dc4ad332 Mon Sep 17 00:00:00 2001 From: KSP-TaxiService Date: Fri, 20 Apr 2018 22:53:42 +0800 Subject: [PATCH] Beautify station marker and add toggle button to hide/show station markers --- .../Textures/groundStationMark.png | Bin 293 -> 1073 bytes .../CommNetLayer/CNCCommNetHome.cs | 3 +++ .../CommNetLayer/CNCCommNetScenario.cs | 5 +++++ .../UI/ConstellationControlDialog.cs | 8 +++++++- src/groundStationMark.psd | Bin 0 -> 32596 bytes 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/groundStationMark.psd diff --git a/GameData/CommNetConstellation/Textures/groundStationMark.png b/GameData/CommNetConstellation/Textures/groundStationMark.png index 44e5f8cd81539fbc0e3231ac1bc438773a09d1e7..bc133a4533d89c39a5e91480bfafd40627fedb0f 100644 GIT binary patch literal 1073 zcmbVLJ8aWH7&b&yRZ)3~1q9N`U63HQ&v72M8Y;(j+MuRHNuc2|)U_{-)!1k3D{(6( zkdP27JBW#a$5^Ba0aaBA2D&h@cj^EO5@IRmJPJeAfs^dJ|L*_3|NW>kGdVhPc7$P= z(bAM&rTdBa8&1&wh2-%X-OdoBL29^3I%a?v)yDG(lw5NGRgq~g-}!{b875&n^#*B_ zrxgpkoEhtIk?T`5!;DWvzG*EY0_M?z~|JWD<8h2Z+-@*c4l_7g=@#z&^l zLr&mbH;${T9g-^g>&Cv?VSU+0d=-UwDX?fgnqvbn&E3IBdMCCLP;`m5Ee42oN5SaP8U)|QI-cB`(X=m0TurlIWtb8C=(E?-=9Mmyx4?3XI!UTsc>;tWq2D6T5 z<4zbCrx&Y^0_QHWive~)H@k|nk9ARpx?0dPYNi*ptma@*PZ=3Cm(Ibg&i1kP|747( z&hT+-{L?CfE82hYaj)^Ius1r$qw^Bb!FYc2R*MeRP-VJq>~`0+dq3Os<}j(w)OMNe zRpAPiw34pYqi?srsK*#EocOrC`}F$Qkr8-q=<%sHpl)AW|N7zKgSD-xR~ya5+sPZJ qe?57&`r`b~&O5>!T|e}D^W+@kzGOac{@B`}bWF*Z(O(zl?*9R)Z&L~Y delta 241 zcmVCf%q>IR3MN9%?wbr{vZa(04X50V;~(k0I>wf04u0Lqyn&B5TVIHKF|Ug zAVPrw{7ej#0Va?E?@lN%;5`#GPRRu~n4rn?9~qiKdX9k%cm~9W$uQs$NG~i9*OBNI rklOWB%}m&`vl?100000NkvXXu0mjfXBt|g 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 0000000000000000000000000000000000000000..2a5e7546529feea46c1ba6da529f012b053575ec GIT binary patch literal 32596 zcmeHQ34Bw<)}Ncb>Aq0P9?A}O-wTws=_(DBwybWX$!!`)ZbEX?1$RVL@QEOzfE&nD zQ6IR1;*KaTJQP&i{Xiaq&ka;SMeTRa+$Blb@)X|p-tWsTx%bSOGiT2H&&=GpGncuA z<@Jq(A;O`AOC0^_2-0xOIapX;Yf`CbAhs_vgDCq9sqU*F1pW~kH-yH;{r#<9E`MO# z^AT!y+xiXamnYD;!5CNl+n8}3ZnI@J%Nv?mo1Gh*`rR`xq#Eqjv8hw@OqnLPk!`it z%=NI1b0;)e=FYYhSyRWA=*M&vcR1ZnmNy$ZoDR-g+%Y!QY;`rW#XuuFBh^4f_}ODq z%P_()%~WqNx;(5QFFiBOl9``r$j?g8%E>J#C^*lMotc%Hk(r&5m7SJVP@I!poSA75 zkJJ)9P-8sSmg0trDlt0^MHQCu|Ad%+nJ9k`J+5PPd#9=S`<&Ot-k4869SKMpk-e zhO8M9jsZ-HjULv_yF5)Um!m`|d3~#kcX?Y~ZiBHg&oI@_SzYbkF&W*3{ki+~uoY&W zEdg{2(lYbYGIN@;@`|(bi?j1aWflTP0ZIhPZaPdZtG%UD(ovX}nVXiK*_54)2IjhRt^>SjHS^|>v;@kEdd6fR!~u{~eyJK*1Bs_y4+A(Y0S?m%Fj>BPR|Nd6Cig|JrypC z4-qcoEUXu5wpVhX&{U`!%gwf6uH;{by#(rcy47wi&dbfs&n+|NmSyGURu*PumFMRa zmQ`k!6;@>CRAmgQCVSDRYgu^epz8&VOBu}?Hf#{z@&a)MYR%mqT0~BBv=%X^aQmNJ$AU2m>mH! zp;rPy{Yg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