Skip to content

Commit 5091371

Browse files
authored
Merge pull request #53 from schlosrat/Dev
0.10.5
2 parents 462c840 + fe1a269 commit 5091371

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Upload release
22

33
env:
44
SPACEDOCK_MOD_ID: 3359 # Flight Plan
5+
MOD_DISCORD_THREAD_ID: "1201143568274821210" # It should be quoted to prevent YAML from interpreting it as an integer
56

67
on:
78
release:
@@ -83,3 +84,23 @@ jobs:
8384
spacedock_url: "https://spacedock.info/mod/3359/Flight%20Plan#changelog"
8485
version: ${{ env.version }}
8586
changelog: ./changelog.md
87+
88+
- name: Prepare content
89+
shell: bash
90+
run: |
91+
echo -e "## Release ${version}\n" > ./content.md
92+
cat ./changelog.md >> ./content.md
93+
{
94+
echo 'discord_message<<EOF'
95+
cat ./content.md
96+
echo EOF
97+
} >> "$GITHUB_ENV"
98+
99+
- name: Update mod topic
100+
uses: tsickert/[email protected]
101+
with:
102+
webhook-url: ${{ secrets.DISCORD_KMS_WEBHOOK_URL }}
103+
content: ${{ env.discord_message }}
104+
thread-id: ${{ env.MOD_DISCORD_THREAD_ID }}
105+
username: "Flight Plan"
106+
avatar-url: "https://avatars.githubusercontent.com/u/50781429?s=120&v=4"

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.4",
8+
"version": "0.10.5",
99
"version_check": "https://raw.githubusercontent.com/schlosrat/FlightPlan/master/plugin_template/swinfo.json",
1010
"ksp2_version": {
1111
"min": "0.2.0",

src/FlightPlan/UI/FpUiController.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ private void Update()
839839
relativeInc = Orbit.RelativeInclination(targetOrbit);
840840
phase = Orbit.PhaseAngle(targetOrbit, UT);
841841
transfer = Orbit.Transfer(targetOrbit, out _);
842-
if (transfer < phase)
842+
if (targetOrbit.semiMajorAxis > Orbit.semiMajorAxis)
843843
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(phase - transfer) / 360;
844844
else
845845
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(transfer - phase) / 360;
@@ -919,7 +919,7 @@ private void Update()
919919
relativeInc = Orbit.RelativeInclination(targetOrbit);
920920
phase = Orbit.PhaseAngle(targetOrbit, UT);
921921
transfer = Orbit.Transfer(targetOrbit, out double _transferTime);
922-
if (transfer < phase)
922+
if (targetOrbit.semiMajorAxis > Orbit.semiMajorAxis)
923923
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(phase - transfer) / 360;
924924
else
925925
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(transfer - phase) / 360;
@@ -968,7 +968,7 @@ private void Update()
968968
// double phase2 = Phase();
969969
transfer = ReferenceBody.Orbit.Transfer(targetOrbit, out _transferTime);
970970
// double transfer2 = Transfer(out _);
971-
if (transfer < phase)
971+
if (targetOrbit.semiMajorAxis > ReferenceBody.Orbit.semiMajorAxis)
972972
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(phase - transfer) / 360;
973973
else
974974
nextWindow = synodicPeriod * MuUtils.ClampDegrees360(transfer - phase) / 360;
@@ -2812,6 +2812,7 @@ public string SetOptionsList(ManeuverType type)
28122812
private static SimulationObjectModel tgtVessel = null;
28132813
public static bool SelectTarget, doNewList;
28142814
public static bool SelectDockingPort = false;
2815+
public static CelestialBodyComponent Kerbol;
28152816

28162817
private void ListBodies()
28172818
{
@@ -2820,6 +2821,7 @@ private void ListBodies()
28202821
{
28212822
_rootBody = _rootBody.referenceBody;
28222823
}
2824+
Kerbol = _rootBody;
28232825
// allBodies.Clear();
28242826
if (targetBodies != null)
28252827
targetBodies.Clear();

0 commit comments

Comments
 (0)