Skip to content

Commit

Permalink
Nuke more of the old gravity turner code
Browse files Browse the repository at this point in the history
somehow this never got cleaned up

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Nov 21, 2023
1 parent 96a998d commit 05475d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 278 deletions.
1 change: 0 additions & 1 deletion MechJeb2/MechJeb2.csproj
Expand Up @@ -100,7 +100,6 @@
<Compile Include="MechJebModuleAscentBaseAutopilot.cs"/>
<Compile Include="MechJebModuleAscentClassicAutopilot.cs"/>
<Compile Include="MechJebModuleAscentClassicPathMenu.cs"/>
<Compile Include="MechJebModuleAscentGTAutopilot.cs"/>
<Compile Include="MechJebModuleAscentMenu.cs"/>
<Compile Include="MechJebModuleAscentPVGAutopilot.cs"/>
<Compile Include="MechJebModuleAscentPVGSettingsMenu.cs"/>
Expand Down
240 changes: 0 additions & 240 deletions MechJeb2/MechJebModuleAscentGTAutopilot.cs

This file was deleted.

27 changes: 1 addition & 26 deletions MechJeb2/MechJebModuleAscentMenu.cs
Expand Up @@ -175,31 +175,6 @@ private void ShowTargetingGUIElements()
Profiler.EndSample();
}

private void ShowGuidanceSettingsGUIElements()
{
Profiler.BeginSample("MJ.GUIWindow.ShowGuidanceSettings");


if (_ascentSettings.AscentType == AscentType.GRAVITYTURN)
{
GUILayout.BeginVertical(GUI.skin.box);

GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel8, _ascentSettings.TurnStartAltitude,
"km"); //Turn start altitude:
GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel9, _ascentSettings.TurnStartVelocity,
"m/s"); //Turn start velocity:
GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel10, _ascentSettings.TurnStartPitch, "deg"); //Turn start pitch:
GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel11, _ascentSettings.IntermediateAltitude,
"km"); //Intermediate altitude:
GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel12, _ascentSettings.HoldAPTime, "s"); //Hold AP Time:
GUILayout.EndVertical();
}

_ascentSettings.LimitQaEnabled = _ascentSettings.AscentType == AscentType.PVG; // this is mandatory for PVG

Profiler.EndSample();
}

private void ShowStatusGUIElements()
{
Profiler.BeginSample("MJ.GUIWindow.ShowStatus");
Expand Down Expand Up @@ -413,8 +388,8 @@ protected override void WindowGUI(int windowID)
//PerformanceTestGUIElements();
VisibleSectionsGUIElements();
ShowTargetingGUIElements();
ShowGuidanceSettingsGUIElements();

_ascentSettings.LimitQaEnabled = _ascentSettings.AscentType == AscentType.PVG; // this is mandatory for PVG

GUILayout.BeginVertical(GUI.skin.box);
GUILayout.BeginHorizontal();
Expand Down
17 changes: 6 additions & 11 deletions MechJeb2/MechJebModuleAscentSettings.cs
Expand Up @@ -6,7 +6,7 @@

namespace MuMech
{
public enum AscentType { CLASSIC, GRAVITYTURN, PVG }
public enum AscentType { CLASSIC, PVG }

public class MechJebModuleAscentSettings : ComputerModule
{
Expand Down Expand Up @@ -287,17 +287,12 @@ public bool Autostage

private MechJebModuleAscentBaseAutopilot GetAscentModule(AscentType type)
{
switch (type)
return type switch
{
case AscentType.CLASSIC:
return Core.GetComputerModule<MechJebModuleAscentClassicAutopilot>();
case AscentType.GRAVITYTURN:
return Core.GetComputerModule<MechJebModuleAscentGTAutopilot>();
case AscentType.PVG:
return Core.GetComputerModule<MechJebModuleAscentPVGAutopilot>();
default:
return Core.GetComputerModule<MechJebModuleAscentClassicAutopilot>();
}
AscentType.CLASSIC => Core.GetComputerModule<MechJebModuleAscentClassicAutopilot>(),
AscentType.PVG => Core.GetComputerModule<MechJebModuleAscentPVGAutopilot>(),
_ => Core.GetComputerModule<MechJebModuleAscentClassicAutopilot>()
};
}

private void DisableAscentModules()
Expand Down

0 comments on commit 05475d6

Please sign in to comment.