示例#1
0
 /// <summary>
 /// Restore the Portrait for a kerbal and register them to the KerbalPortraitGallery
 /// </summary>
 /// <param name="kerbal">the kerbal we want restored</param>
 /// <param name="part">the part the kerbal is in</param>
 internal static void RestorePortrait(Part part, Kerbal kerbal)
 {
     //We don't process DEAD, Unowned kerbals - Compatibility with DeepFreeze Mod.
     if (kerbal.rosterStatus != ProtoCrewMember.RosterStatus.Dead &&
         kerbal.protoCrewMember.type != ProtoCrewMember.KerbalType.Unowned)
     {
         //Set the Kerbals InPart back to their part.
         kerbal.InPart = part;
         //Set their portrait state to ALIVE and set their portrait back to visible.
         kerbal.state = Kerbal.States.ALIVE;
         kerbal.SetVisibleInPortrait(true);
         //If they aren't in ActiveCrew and don't have a Portrait them via the kerbal.Start method.
         if (!InActiveCrew(kerbal) && !HasPortrait(kerbal))
         {
             kerbal.staticOverlayDuration = 1f;
             kerbal.randomizeOnStartup    = false;
             kerbal.Start();
         }
         kerbal.state = Kerbal.States.ALIVE;
     }
 }
 /// <summary>
 /// Restore the Portrait for a kerbal and register them to the KerbalPortraitGallery
 /// </summary>
 /// <param name="kerbal">the kerbal we want restored</param>
 /// <param name="part">the part the kerbal is in</param>
 internal static void RestorePortrait(Part part, Kerbal kerbal)
 {
     //We don't process DEAD, Unowned kerbals - Compatibility with DeepFreeze Mod.
     if (kerbal.rosterStatus != ProtoCrewMember.RosterStatus.Dead &&
         kerbal.protoCrewMember.type != ProtoCrewMember.KerbalType.Unowned)
     {
         //Set the Kerbals InPart back to their part.
         kerbal.InPart = part;
         //Set their portrait state to ALIVE and set their portrait back to visible.
         kerbal.state = Kerbal.States.ALIVE;
         kerbal.SetVisibleInPortrait(true);
         //Find an ActiveCrew entry and Portraits entry for our kerbal?
         //If they aren't in ActiveCrew and don't have a Portrait them via the kerbal.Start method.
         if (!InActiveCrew(kerbal) && !HasPortrait(kerbal))
         {
             kerbal.staticOverlayDuration = 1f;
             kerbal.randomizeOnStartup = false;
             kerbal.Start();
         }
         kerbal.state = Kerbal.States.ALIVE;
     }
 }