From c3ba36db00570aefa2856bdb765eae7526557f49 Mon Sep 17 00:00:00 2001 From: Capkirk123 Date: Fri, 19 Jul 2024 01:16:19 -0400 Subject: [PATCH] Try making a function check? --- src/RealAntennasProject/PlannerGUI.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/RealAntennasProject/PlannerGUI.cs b/src/RealAntennasProject/PlannerGUI.cs index 935c21b..ac5b4ab 100644 --- a/src/RealAntennasProject/PlannerGUI.cs +++ b/src/RealAntennasProject/PlannerGUI.cs @@ -256,17 +256,27 @@ private bool RenderPanel(SelectionMode mode, ref RealAntenna antenna, ref Vector res = true; } foreach (Network.RACommNetHome home in homes) - foreach (RealAntenna ra in home.Comm.RAAntennaList.Where(x => x.Compatible(peer))) - if (GUILayout.Button($"{home.displaynodeName} {ra.ToStringShort()}", buttonStyle)) - { - antenna = ra; - res = true; - } + foreach (RealAntenna ra in home.Comm.RAAntennaList) + if(CheckMatchingGroundStation(peer, ra) + if (GUILayout.Button($"{home.displaynodeName} {ra.ToStringShort()}", buttonStyle)) + { + antenna = ra; + res = true; + } } GUILayout.EndScrollView(); return res; } + public bool CheckMatchingGroundStation(RealAntenna peer, RealAntenna station) + { + if(peer.RFBand == station.RFBand) + { + return true; + } + return false; + } + public RealAntenna GetBestMatchingGroundStation(RealAntenna peer, IEnumerable stations) { RealAntenna best = null;