Ejemplo n.º 1
0
 public void CancelDockingPortSelection()
 {
     if (_dockingPortSelectionWindow != null)
     {
         WindowManager.Close(_dockingPortSelectionWindow);
         _dockingPortSelectionWindow = null;
     }
 }
Ejemplo n.º 2
0
        public void DockingPortSelection(uint dockingPortFlightId, IWindow parent = null)
        {
            CancelDockingPortSelection();
            _dockingPortSelectionWindow = new DockingPortSelectionWindow(this, dockingPortFlightId);
            WindowManager.Open(_dockingPortSelectionWindow, parent: parent);

            List <RegisteredDockingPort> registeredDockingPorts = new List <RegisteredDockingPort>();

            foreach (Part part in FlightGlobals.ActiveVessel.parts)
            {
                string name = RmmScenario.Instance.GetRegisteredDockingPort(part.flightID);
                if (!String.IsNullOrEmpty(name))
                {
                    registeredDockingPorts.Add(new RegisteredDockingPort
                    {
                        flightId = part.flightID,
                        Name     = name,
                    });
                }
            }
            _dockingPortSelectionWindow.DockingPorts = registeredDockingPorts;
        }