Skip to content

Commit

Permalink
- Fixes selection gets canceled in list when not in an aircraft and a…
Browse files Browse the repository at this point in the history
…uto enabled.
  • Loading branch information
FalcoGer committed Jan 19, 2024
1 parent a2a9ee3 commit 1593703
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CoordinateConverter/CoordinateDataEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CoordinateConverter.DCS.Aircraft;
using CoordinateConverter.DCS.Aircraft.AH64;
using CoordinateConverter.DCS.Communication;
using Newtonsoft.Json;
using System;
Expand Down Expand Up @@ -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));
}

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions CoordinateConverter/DCS/Aircraft/F18CSpecificData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ public override string ToString()
/// </returns>
public override AircraftSpecificData Clone()
{
F18CSpecificData ret = new F18CSpecificData() { preplanPointIdx = this.preplanPointIdx, WeaponType = this.WeaponType, StationSetting = StationSetting };
return ret;
return new F18CSpecificData(WeaponType, preplanPointIdx, StationSetting);
}
}
}
8 changes: 4 additions & 4 deletions CoordinateConverter/DCS/Tools/FormUnitImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
10 changes: 7 additions & 3 deletions CoordinateConverter/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace CoordinateConverter
/// <seealso cref="Form" />
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;
Expand Down Expand Up @@ -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
{
Expand All @@ -1885,7 +1890,6 @@ private void AutoSelectAircraft(string model)
if (string.IsNullOrEmpty(model) || model == "null")
{
UpdateAircraftSelectionItemsBasedOnAutoSetting();
Tsmi_AircraftSelection_Click(null, null);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Installer/Installer.wixproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="WixToolset.Sdk/4.0.2">
<PropertyGroup>
<DefineConstants>Version=0.6.6</DefineConstants>
<DefineConstants>Version=0.6.7</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DefineConstants>Version=0.6.0</DefineConstants>
Expand Down

0 comments on commit 1593703

Please sign in to comment.