Skip to content

Commit 462c840

Browse files
authored
Merge pull request #52 from schlosrat/Dev
0.10.4
2 parents 419dec9 + d76287d commit 462c840

12 files changed

Lines changed: 248 additions & 458 deletions

File tree

.github/workflows/discord.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
content: ${{ env.discord_message }}
4646
thread-id: ${{ env.MOD_DISCORD_THREAD_ID }}
4747
username: "Flight Plan"
48-
avatar-url: "https://avatars.githubusercontent.com/u/98559431?s=200&v=4"
48+
avatar-url: "https://avatars.githubusercontent.com/u/50781429?s=120&v=4"
4949

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ jobs:
7777
with:
7878
username: ${{ secrets.KSP_FORUM_USERNAME }}
7979
password: ${{ secrets.KSP_FORUM_PASSWORD }}
80+
post_title: "## Release {version}" # (without the v)
8081
forum_topic_url: https://forum.kerbalspaceprogram.com/topic/216393-flight-plan-0100/
81-
forum_topic_title: "Flight Plan [{version} for KSP2 v{ksp2_version}]"
82+
forum_topic_title: "Flight Plan [{version} for KSP2 v{ksp2_version}+]"
8283
spacedock_url: "https://spacedock.info/mod/3359/Flight%20Plan#changelog"
8384
version: ${{ env.version }}
8485
changelog: ./changelog.md

plugin_template/swinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Flight Plan",
66
"description": "Plan your (Space) Flight! Set up useful maneuver nodes to get you where you want to be",
77
"source": "https://github.com/schlosrat/FlightPlan",
8-
"version": "0.10.3",
8+
"version": "0.10.4",
99
"version_check": "https://raw.githubusercontent.com/schlosrat/FlightPlan/master/plugin_template/swinfo.json",
1010
"ksp2_version": {
1111
"min": "0.2.0",

src/FlightPlan/FlightPlan.csproj

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@
66
<!-- References -->
77
<ItemGroup Label="NuGet package references">
88
<!-- Add references to any NuGet packages you want to use in your mod here -->
9-
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all"/>
10-
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all"/>
11-
<PackageReference Include="BepInEx.Core" Version="5.*"/>
12-
<PackageReference Include="HarmonyX" Version="2.10.1"/>
13-
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.2.0" PrivateAssets="all" Publicize="true"/>
14-
<PackageReference Include="NodeManager" Version="0.7.1"/>
15-
<PackageReference Include="SpaceWarp" Version="1.8.0"/>
16-
<PackageReference Include="SpaceWarp.PluginInfoProps" Version="1.*"/>
17-
<PackageReference Include="UitkForKsp2" Version="2.4.0"/>
18-
<PackageReference Include="UnityEngine.Modules" Version="2022.3.5"/>
9+
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
10+
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
11+
<PackageReference Include="BepInEx.Core" Version="5.*" />
12+
<PackageReference Include="HarmonyX" Version="2.10.1" />
13+
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.2.0" PrivateAssets="all" Publicize="true" />
14+
<PackageReference Include="NodeManager" Version="0.7.1" />
15+
<PackageReference Include="SpaceWarp" Version="1.8.0" />
16+
<PackageReference Include="SpaceWarp.PluginInfoProps" Version="1.*" />
17+
<PackageReference Include="UitkForKsp2" Version="2.4.0" />
18+
<PackageReference Include="UnityEngine.Modules" Version="2022.3.5" />
1919
</ItemGroup>
2020
<ItemGroup Label="Project references">
2121
<!-- Add references to any other projects in your solution that you want to use in your mod here -->
22-
<ProjectReference Include="..\FlightPlan.Unity\FlightPlan.Unity.csproj" Private="false"/>
22+
<ProjectReference Include="..\FlightPlan.Unity\FlightPlan.Unity.csproj" Private="false" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<Folder Include="MJ\LandingAutopilot\" />
2326
</ItemGroup>
2427
</Project>

src/FlightPlan/FlightPlanPlugin.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public enum ManeuverType
5454
/// <summary>
5555
/// The selected time Reference
5656
/// </summary>
57-
public enum TimeRef
57+
public enum TimeReference
5858
{
5959
None,
6060
COMPUTED,
@@ -949,7 +949,7 @@ public bool SetNewSMA(double burnUT, double newSMA, double burnOffsetFactor = -0
949949
}
950950

951951
// No longer takes double burnUT. Need to sort out how this can be called as an API method
952-
public bool MatchPlanes(TimeRef time_ref, double burnOffsetFactor = -0.5)
952+
public bool MatchPlanes(TimeReference time_ref, double burnOffsetFactor = -0.5)
953953
{
954954
double _UT = Game.UniverseModel.UniverseTime;
955955
PatchedConicsOrbit _orbit = _activeVessel.Orbit;
@@ -970,18 +970,18 @@ public bool MatchPlanes(TimeRef time_ref, double burnOffsetFactor = -0.5)
970970
FPStatus.Ok($"Ready to Match Planes with {_currentTarget.Name} {BurnTimeOption.TimeRefDesc}");
971971

972972
Vector3d _deltaV = Vector3d.zero;
973-
if (time_ref == TimeRef.REL_ASCENDING)
973+
if (time_ref == TimeReference.REL_ASCENDING)
974974
_deltaV = OrbitalManeuverCalculator.DeltaVAndTimeToMatchPlanesAscending(_orbit, tgtOrbit, _UT, out burnUTout);
975-
else if (time_ref == TimeRef.REL_DESCENDING)
975+
else if (time_ref == TimeReference.REL_DESCENDING)
976976
_deltaV = OrbitalManeuverCalculator.DeltaVAndTimeToMatchPlanesDescending(_orbit, tgtOrbit, _UT, out burnUTout);
977-
else if (time_ref == TimeRef.REL_NEAREST_AD)
977+
else if (time_ref == TimeReference.REL_NEAREST_AD)
978978
{
979979
if (_orbit.TimeOfAscendingNode(tgtOrbit, _UT) < _orbit.TimeOfDescendingNode(tgtOrbit, _UT))
980980
_deltaV = OrbitalManeuverCalculator.DeltaVAndTimeToMatchPlanesAscending(_orbit, tgtOrbit, _UT, out burnUTout);
981981
else
982982
_deltaV = OrbitalManeuverCalculator.DeltaVAndTimeToMatchPlanesDescending(_orbit, tgtOrbit, _UT, out burnUTout);
983983
}
984-
else if (time_ref == TimeRef.REL_HIGHEST_AD)
984+
else if (time_ref == TimeReference.REL_HIGHEST_AD)
985985
{
986986
var anTime = _orbit.TimeOfAscendingNode(tgtOrbit, _UT);
987987
var dnTime = _orbit.TimeOfDescendingNode(tgtOrbit, _UT);
@@ -1168,7 +1168,7 @@ public bool MoonReturn(double burnUT, double targetMRPeR, double burnOffsetFacto
11681168
PatchedConicsOrbit _orbit = _activeVessel.Orbit;
11691169
Vector3d _deltaV;
11701170

1171-
Logger.LogDebug($"MoonReturn: Return from {_orbit.referenceBody.Name} {BurnTimeOption.TimeRefDesc}");
1171+
Logger.LogDebug($"MoonReturn: Return from {_orbit.referenceBody.Name} {BurnTimeOption.TimeRefDesc} seeking Pe {targetMRPeR/1000:N3} km");
11721172
var _e = _orbit.eccentricity;
11731173

11741174
FPStatus.Warning($"Ready to Return from {_orbit.referenceBody.Name}?");
@@ -1249,7 +1249,7 @@ public bool PlanetaryXfer(double burnUT, double burnOffsetFactor = -0.5)
12491249

12501250
bool _syncPhaseAngle = true;
12511251
// Check the BurnOptionsDropdown
1252-
if (FpUiController.BurnOptionsDropdown.value == BurnTimeOption.TextTimeRef[TimeRef.NEXT_WINDOW])
1252+
if (FpUiController.BurnOptionsDropdown.value == BurnTimeOption.TextTimeRef[TimeReference.NEXT_WINDOW])
12531253
_syncPhaseAngle = true;
12541254
else
12551255
_syncPhaseAngle = false;

src/FlightPlan/MJ/Maneuver/Operation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public abstract class Operation
4040

4141
// Draw the parameter part of the Operation (ask for time, altitudes etc)
4242
// Input parameters are orbit and time parameters after the last maneuver and current target
43-
public abstract void DoParametersGUI(PatchedConicsOrbit o, double UniverseTime, CelestialBodyComponent target, OperationAdvancedTransfer.Mode selectionMode); // was: MechJebModuleTargetController
43+
public abstract void DoParametersGUI(PatchedConicsOrbit o, double UniverseTime, CelestialBodyComponent target); // was: MechJebModuleTargetController
4444

4545
// Function called when create node is pressed; input parameters are orbit and time parameters after the last maneuver and current target
4646
// ManeuverParameters contain a single time and dV describing the node that should be executed

src/FlightPlan/MJ/Maneuver/OperationAdvancedTransfer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private string CheckPreconditions(PatchedConicsOrbit o, CelestialBodyComponent t
8383
return "Must select a target for the interplanetary transfer."; // Localizer.Format("#MechJeb_adv_Preconditions3");
8484

8585
if (o.referenceBody.referenceBody == null)
86-
return $"Doesn't make sense to plot an interplanetary transfer from an orbit around {o.referenceBody.Name}..LocalizeRemoveGender()";
86+
return $"Doesn't make sense to plot an interplanetary transfer from an orbit around {o.referenceBody.Name.LocalizeRemoveGender()}.";
8787
// Localizer.Format("#MechJeb_adv_Preconditions4"); //"doesn't make sense to plot an interplanetary transfer from an orbit around <<1>>."
8888

8989
if (o.referenceBody.referenceBody != target.Orbit.referenceBody)
@@ -321,14 +321,14 @@ public void DoPorkchopGui(PatchedConicsOrbit o, double UniverseTime, CelestialBo
321321
lastTargetCelestial = targetCelestial;
322322
}
323323

324-
public override void DoParametersGUI(PatchedConicsOrbit o, double UniverseTime, CelestialBodyComponent target, Mode thisSelectionMode) // was: MechJebModuleTargetController target
324+
public override void DoParametersGUI(PatchedConicsOrbit o, double UniverseTime, CelestialBodyComponent target) // was: MechJebModuleTargetController target
325325
{
326326
_draggable = true;
327-
selectionMode = thisSelectionMode;
327+
selectionMode = FpUiController.thisSelectionMode;
328328
// If there is a worker running without a target selected (and event type is Layout) then stop the worker and clear the plot
329329
if (worker != null && (target == null || target != previousTarget || selectionMode != previousSelectiionMode)) // was: !target.NormalTargetExists && Event.current.type == EventType.Layout
330330
{
331-
FlightPlanPlugin.Logger.LogInfo($"DoParametersGUI: Stopping/Clearing worker and plot. Target = {target.Name}, thisSelectionMode = {modeNames[(int)thisSelectionMode]}");
331+
FlightPlanPlugin.Logger.LogInfo($"DoParametersGUI: Stopping/Clearing worker and plot. Target = {target.Name}, thisSelectionMode = {modeNames[(int)selectionMode]}");
332332
worker.Stop = true;
333333
worker = null;
334334
plot = null;
@@ -372,7 +372,7 @@ public override void DoParametersGUI(PatchedConicsOrbit o, double UniverseTime,
372372
if (GUI.changed || guiChanged || worker == null || worker.DestinationOrbit != target.Orbit || worker.OriginOrbit != o)
373373
ComputeStuff(o, UniverseTime, target);
374374

375-
previousSelectiionMode = thisSelectionMode;
375+
previousSelectiionMode = selectionMode;
376376
previousTarget = target;
377377

378378
}

0 commit comments

Comments
 (0)