From 159370330e79afe33758197bb5c8a5305bcfcc65 Mon Sep 17 00:00:00 2001 From: Falco Date: Fri, 19 Jan 2024 04:16:23 +0100 Subject: [PATCH] - Fixes selection gets canceled in list when not in an aircraft and auto enabled. --- CoordinateConverter/CoordinateDataEntry.cs | 6 ++++++ CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs | 3 +-- CoordinateConverter/DCS/Tools/FormUnitImporter.cs | 8 ++++---- CoordinateConverter/MainForm.cs | 10 +++++++--- Installer/Installer.wixproj | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CoordinateConverter/CoordinateDataEntry.cs b/CoordinateConverter/CoordinateDataEntry.cs index 7b897d5..4f83fa6 100644 --- a/CoordinateConverter/CoordinateDataEntry.cs +++ b/CoordinateConverter/CoordinateDataEntry.cs @@ -1,4 +1,5 @@ using CoordinateConverter.DCS.Aircraft; +using CoordinateConverter.DCS.Aircraft.AH64; using CoordinateConverter.DCS.Communication; using Newtonsoft.Json; using System; @@ -121,6 +122,11 @@ public CoordinateDataEntry(int id, CoordinateSharp.Coordinate coordinate, double XFer = xfer; AltitudeIsAGL = altitudeIsAGL; GroundElevationInM = null; + + AircraftSpecificData.Add(typeof(AH64), new AH64SpecificData()); + AircraftSpecificData.Add(typeof(F18C), new F18CSpecificData()); + AircraftSpecificData.Add(typeof(JF17), new JF17SpecificData(JF17.EPointType.Waypoint)); + AircraftSpecificData.Add(typeof(KA50), new KA50SpecificData(KA50.EPointType.Waypoint)); } /// diff --git a/CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs b/CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs index d7cf8b9..b73b6c0 100644 --- a/CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs +++ b/CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs @@ -139,8 +139,7 @@ public override string ToString() /// public override AircraftSpecificData Clone() { - F18CSpecificData ret = new F18CSpecificData() { preplanPointIdx = this.preplanPointIdx, WeaponType = this.WeaponType, StationSetting = StationSetting }; - return ret; + return new F18CSpecificData(WeaponType, preplanPointIdx, StationSetting); } } } diff --git a/CoordinateConverter/DCS/Tools/FormUnitImporter.cs b/CoordinateConverter/DCS/Tools/FormUnitImporter.cs index c15f358..2de8d2a 100644 --- a/CoordinateConverter/DCS/Tools/FormUnitImporter.cs +++ b/CoordinateConverter/DCS/Tools/FormUnitImporter.cs @@ -112,10 +112,10 @@ private void Btn_Import_Click(object sender, EventArgs e) }; // Add aircraft specific data data - entry.AircraftSpecificData.Add(typeof(AH64), new AH64SpecificData(unit)); - entry.AircraftSpecificData.Add(typeof(KA50), new KA50SpecificData(KA50.EPointType.TargetPoint)); - entry.AircraftSpecificData.Add(typeof(JF17), new JF17SpecificData(JF17.EPointType.Waypoint)); - entry.AircraftSpecificData.Add(typeof(F18C), new F18CSpecificData()); + entry.AircraftSpecificData[typeof(AH64)] = new AH64SpecificData(unit); + entry.AircraftSpecificData[typeof(KA50)] = new KA50SpecificData(KA50.EPointType.TargetPoint); + entry.AircraftSpecificData[typeof(JF17)] = new JF17SpecificData(JF17.EPointType.Waypoint); + entry.AircraftSpecificData[typeof(F18C)] = new F18CSpecificData(); Coordinates.Add(entry); } } diff --git a/CoordinateConverter/MainForm.cs b/CoordinateConverter/MainForm.cs index fab13cc..749fd79 100644 --- a/CoordinateConverter/MainForm.cs +++ b/CoordinateConverter/MainForm.cs @@ -20,7 +20,7 @@ namespace CoordinateConverter /// public partial class MainForm : Form { - private readonly GitHub.Version VERSION = new GitHub.Version(0, 6, 6); + private readonly GitHub.Version VERSION = new GitHub.Version(0, 6, 7); #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public static readonly Color ERROR_COLOR = Color.Pink; @@ -1868,7 +1868,12 @@ private void UpdateAircraftSelectionItemsBasedOnAutoSetting() } if (tsmi_Auto.Checked) { - selectedAircraft = null; + if (selectedAircraft != null) + { + selectedAircraft = null; + Tsmi_AircraftSelection_Click(null, null); + RefreshDataGrid(EDataGridUpdateType.UpdateCells); + } } else { @@ -1885,7 +1890,6 @@ private void AutoSelectAircraft(string model) if (string.IsNullOrEmpty(model) || model == "null") { UpdateAircraftSelectionItemsBasedOnAutoSetting(); - Tsmi_AircraftSelection_Click(null, null); return; } diff --git a/Installer/Installer.wixproj b/Installer/Installer.wixproj index 623c09e..fb91187 100644 --- a/Installer/Installer.wixproj +++ b/Installer/Installer.wixproj @@ -1,6 +1,6 @@  - Version=0.6.6 + Version=0.6.7 Version=0.6.0