void main_window(int WindowID)
 {
     GUILayout.BeginVertical();
     vessels_scroll = GUILayout.BeginScrollView(vessels_scroll, Styles.white);
     foreach (var vsl in FlightGlobals.VesselsLoaded)
     {
         GUILayout.BeginHorizontal();
         GUILayout.Label(vsl.vesselName, Styles.white, GUILayout.ExpandWidth(true));
         if (GUILayout.Button("Convert", Styles.danger_button, GUILayout.ExpandWidth(false)))
         {
             if (to_convert == null)
             {
                 to_convert      = vsl;
                 warning.Message = string.Format(
                     "This will convert '{0}' resource into '{1}' by mass in every part that contains it.\n" +
                     "<color=red><b>This cannot be undone!</b></color>\n" +
                     "It is best that you <b>save the game</b> before doing this.\n" +
                     "Are you sure you wish to continue?",
                     old_res.name, Globals.Instance.ConstructionResource.name);
                 warning.Show(true);
             }
         }
         GUILayout.EndHorizontal();
     }
     GUILayout.EndScrollView();
     if (GUILayout.Button("Close", Styles.close_button, GUILayout.ExpandWidth(true)))
     {
         show_window = false;
     }
     GUILayout.EndVertical();
     GUIWindowBase.TooltipsAndDragWindow();
 }
 public void Deflate()
 {
     if (State != AnimatorState.Opened)
     {
         return;
     }
     if (!CanDisableModules())
     {
         return;
     }
     if (warning.WindowEnabled)
     {
         return;
     }
     if (has_compressed_gas || Recompressable)
     {
         deflate();
     }
     else
     {
         if (!Compressor.Valid)
         {
             warning.Message = "This part is not equipped with a compressor. " +
                               "You will not be able to inflate it again. " +
                               "Are you sure you want to deflate the hangar?";
         }
         else if (!part.vessel.mainBody.atmosphere)
         {
             warning.Message = "There's no atmosphere here. " +
                               "You will not be able to inflate this part again." +
                               "Are you sure you want to deflate it?";
         }
         warning.Show(true);
     }
 }
Example #3
0
 public virtual void Deploy()
 {
     if (can_deploy())
     {
         if (same_vessel_collision_if_deployed())
         {
             warning.Show(Name + Colors.Warning.Tag(" <b>will intersect other parts of the vessel</b>") +
                          "if deployed.\nYou may proceed with the deployment if you are sure the constructed vessel " +
                          "will not collide with anything when launched.\n" +
                          Colors.Danger.Tag("Start the deployment?"),
                          () => warning.Show(true));
         }
         else
         {
             warning.Show(true);
         }
     }
 }
Example #4
0
 public void FixGrapple()
 {
     if (!IsDocked)
     {
         Utils.Message("Nothing to fix to");
         return;
     }
     if (fixAnimator != null && fixAnimator.Playing)
     {
         Utils.Message("Already working...");
         return;
     }
     warning.Show(true);
 }