Exemplo n.º 1
0
 static CelestialBodies()
 {
     try
     {
         SystemBody = new BodyInfo(PSystemManager.Instance.localBodies.Find(b => b.referenceBody == null || b.referenceBody == b));
         if (!SetSelectedBody("Kerbin"))
         {
             SelectedBody = SystemBody;
             SelectedBody.SetSelected(true);
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex);
     }
 }
Exemplo n.º 2
0
 static CelestialBodies()
 {
     try
     {
         SystemBody = new BodyInfo(PSystemManager.Instance.localBodies.Find(b => b.referenceBody == null || b.referenceBody == b));
         String homeCBName = Planetarium.fetch.Home.bodyDisplayName.LocalizeRemoveGender();
         if (!SetSelectedBody(homeCBName))
         {
             SelectedBody = SystemBody;
             SelectedBody.SetSelected(true);
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Sets the selected body to one matching the supplied body name.  Returns true if successful.
 /// </summary>
 public static bool SetSelectedBody(string bodyName)
 {
     try
     {
         BodyInfo body = GetBodyInfo(bodyName);
         if (body != null)
         {
             if (SelectedBody != null)
             {
                 SelectedBody.SetSelected(false);
             }
             SelectedBody = body;
             SelectedBody.SetSelected(true);
             return(true);
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex);
     }
     return(false);
 }