forked from jrbudda/KerbalEngineer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a character-limit bug; Added bearing and distance readouts for …
…targets and waypoints from CYBUTEK#132 (with bugs fixed)
- Loading branch information
Showing
10 changed files
with
458 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
KerbalEngineer/Flight/Readouts/Rendezvous/BearingToTarget.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
| ||
/*using KerbalEngineer.Flight.Sections; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
*/ | ||
|
||
|
||
// | ||
// Kerbal Engineer Redux | ||
// | ||
// Copyright (C) 2017 fat-lobyte | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
#region Using Directives | ||
|
||
using KerbalEngineer.Extensions; | ||
using KerbalEngineer.Flight.Readouts.Surface; | ||
using KerbalEngineer.Flight.Sections; | ||
|
||
#endregion | ||
|
||
namespace KerbalEngineer.Flight.Readouts.Rendezvous | ||
{ | ||
public class BearingToTarget : ReadoutModule | ||
{ | ||
#region Constructors | ||
|
||
public BearingToTarget() | ||
{ | ||
this.Name = "Bearing to Target"; | ||
this.Category = ReadoutCategory.GetCategory("Rendezvous"); | ||
this.HelpString = "Bearing to the target on the surface"; | ||
this.IsDefault = false; | ||
} | ||
|
||
#endregion | ||
|
||
#region Methods: public | ||
|
||
public override void Draw(Unity.Flight.ISectionModule section) | ||
{ | ||
if (SurfaceDistanceProcessor.ShowTargetDetails) | ||
{ | ||
this.DrawLine(SurfaceDistanceProcessor.SurfaceBearingToTarget.ToAngle(section.IsHud ? HudDecimalPlaces : DecimalPlaces), section); | ||
} | ||
} | ||
|
||
public override void Reset() | ||
{ | ||
FlightEngineerCore.Instance.AddUpdatable(SurfaceDistanceProcessor.Instance); | ||
} | ||
|
||
public override void Update() | ||
{ | ||
SurfaceDistanceProcessor.RequestUpdate(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
KerbalEngineer/Flight/Readouts/Rendezvous/SurfaceDistanceToTarget.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Kerbal Engineer Redux | ||
// | ||
// Copyright (C) 2017 fat-lobyte | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
#region Using Directives | ||
|
||
using KerbalEngineer.Extensions; | ||
using KerbalEngineer.Flight.Readouts.Surface; | ||
|
||
#endregion | ||
|
||
namespace KerbalEngineer.Flight.Readouts.Rendezvous | ||
{ | ||
public class SurfaceDistanceToTarget : ReadoutModule | ||
{ | ||
#region Constructors | ||
|
||
public SurfaceDistanceToTarget() | ||
{ | ||
this.Name = "Distance (Surface)"; | ||
this.Category = ReadoutCategory.GetCategory("Rendezvous"); | ||
this.HelpString = "Great-circle distance from the current vessel to the target on the surface"; | ||
this.IsDefault = false; | ||
} | ||
|
||
#endregion | ||
|
||
#region Methods: public | ||
|
||
public override void Draw(Unity.Flight.ISectionModule section) | ||
{ | ||
if (SurfaceDistanceProcessor.ShowTargetDetails) | ||
{ | ||
this.DrawLine(SurfaceDistanceProcessor.TargetInSameSOI ? SurfaceDistanceProcessor.SurfaceDistanceToTarget.ToDistance(section.IsHud ? HudDecimalPlaces : DecimalPlaces) : "Different SOI", section); | ||
} | ||
} | ||
|
||
public override void Reset() | ||
{ | ||
FlightEngineerCore.Instance.AddUpdatable(SurfaceDistanceProcessor.Instance); | ||
} | ||
|
||
public override void Update() | ||
{ | ||
SurfaceDistanceProcessor.RequestUpdate(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
KerbalEngineer/Flight/Readouts/Surface/BearingToWaypoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// Kerbal Engineer Redux | ||
// | ||
// Copyright (C) 2017 fat-lobyte | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
#region Using Directives | ||
|
||
using KerbalEngineer.Extensions; | ||
using KerbalEngineer.Flight.Readouts.Surface; | ||
using KerbalEngineer.Flight.Sections; | ||
|
||
#endregion | ||
|
||
namespace KerbalEngineer.Flight.Readouts.Rendezvous | ||
{ | ||
public class BearingToWaypoint : ReadoutModule | ||
{ | ||
#region Constructors | ||
|
||
public BearingToWaypoint() | ||
{ | ||
this.Name = "Bearing to Waypoint"; | ||
this.Category = ReadoutCategory.GetCategory("Surface"); | ||
this.HelpString = "Bearing to the waypoint along the surface"; | ||
this.IsDefault = false; | ||
} | ||
|
||
#endregion | ||
|
||
#region Methods: public | ||
|
||
public override void Draw(Unity.Flight.ISectionModule section) | ||
{ | ||
if (SurfaceDistanceProcessor.ShowWaypointDetails) | ||
{ | ||
this.DrawLine(SurfaceDistanceProcessor.SurfaceBearingToWaypoint.ToAngle(section.IsHud ? HudDecimalPlaces : DecimalPlaces), section); | ||
} | ||
} | ||
|
||
public override void Reset() | ||
{ | ||
FlightEngineerCore.Instance.AddUpdatable(SurfaceDistanceProcessor.Instance); | ||
} | ||
|
||
public override void Update() | ||
{ | ||
SurfaceDistanceProcessor.RequestUpdate(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Oops, something went wrong.