Skip to content

Commit

Permalink
Allow * menu on vessels being rolled out/back
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Sep 11, 2023
1 parent ef3e727 commit cba9da9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Source/KerbalConstructionTime/GUI/GUI_BuildList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ private static void RenderWarehouseRow(BuildListVessel b, int listIdx, bool isCo
textColor = _redText;

GUILayout.BeginHorizontal();
if (b.LC.IsOperational && !HighLogic.LoadedSceneIsEditor && (padStatus == VesselPadStatus.InStorage || padStatus == VesselPadStatus.RolledOut))
if (b.LC.IsOperational && !HighLogic.LoadedSceneIsEditor && (padStatus != VesselPadStatus.Recovering))
{
if (GUILayout.Button("*", GUILayout.Width(_butW)))
{
Expand Down Expand Up @@ -1618,8 +1618,9 @@ private static void DrawBLPlusWindow(int windowID)
}
string blvID = b.shipID.ToString();
ReconRollout rollout = b.LC.GetReconRollout(ReconRollout.RolloutReconType.Rollout, launchSite);
ReconRollout rollback = rollout == null ? b.LC.GetReconRollout(ReconRollout.RolloutReconType.Rollback, launchSite) : null;
bool isRollingOut = rollout != null && rollout.associatedID == blvID;
bool onPad = isRollingOut && rollout.IsComplete();
bool isRollingBack = rollback != null && rollback.associatedID == blvID;

// Only allow selecting launch site for planes.
// Rockets use whatever location is set for their pad.
Expand All @@ -1638,7 +1639,7 @@ private static void DrawBLPlusWindow(int windowID)
}
}

if (!onPad && GUILayout.Button("Scrap"))
if (!isRollingOut && !isRollingBack && GUILayout.Button("Scrap"))
{
InputLockManager.SetControlLock(ControlTypes.KSC_ALL, "KCTPopupLock");
DialogGUIBase[] options = new DialogGUIBase[2];
Expand All @@ -1652,7 +1653,7 @@ private static void DrawBLPlusWindow(int windowID)
ResetBLWindow(false);
}

if (!onPad && GUILayout.Button("Edit"))
if (!isRollingOut && !isRollingBack && GUILayout.Button("Edit"))
{
GUIStates.ShowBLPlus = false;
EditorWindowPosition.height = 1;
Expand Down Expand Up @@ -1708,7 +1709,7 @@ private static void DrawBLPlusWindow(int windowID)
GUIStates.ShowBLPlus = false;
}

if (!b.IsFinished && GUILayout.Button("Move to Top"))
if (!isRollingOut && !isRollingBack && !b.IsFinished && GUILayout.Button("Move to Top"))
{
if (_isIntegrationSelected)
{
Expand Down

0 comments on commit cba9da9

Please sign in to comment.