private DialogGUIToggleButton[] CreateMissionListItems()
        {
            List <DialogGUIToggleButton> list = new List <DialogGUIToggleButton>();
            DialogGUIVerticalLayout      dialogGUIVerticalLayout;
            DialogGUIToggleButton        dialogGUIToggleButton;
            List <QuickLaunchMission>    missions = quickLaunchVessel.GetMissions();

            for (int i = 0; i < missions.Count; i++)
            {
                int missionIndex           = i;
                QuickLaunchMission mission = missions[missionIndex];

                dialogGUIToggleButton = new DialogGUIToggleButton(false, string.Empty, delegate
                {
                    SelectItem(missionIndex);
                }, -1f, 1f);

                dialogGUIVerticalLayout = new DialogGUIVerticalLayout(true, false, 0f, new RectOffset(4, 4, 4, 4), TextAnchor.UpperLeft);
                dialogGUIVerticalLayout.AddChild(new DialogGUILabel(mission.missionName, skin.customStyles[0], true, false));
                DialogGUIVerticalLayout dialogGUIVerticalLayout2 = dialogGUIVerticalLayout;
                Orbit         orbit     = mission.protoVessel.orbitSnapShot.Load();
                CelestialBody body      = orbit.referenceBody;
                string        orbitBody = string.Format("<color=#ffffff>Orbiting {0}</color>", body.name);
                dialogGUIVerticalLayout2.AddChild(new DialogGUILabel(orbitBody, skin.customStyles[0], true, false));
                string orbitInfo = string.Format("<color=#ffffff>Ap: {0}, Pe: {1}, Inc: {2}</color>", Utils.FormatAltitude(orbit.ApA), Utils.FormatAltitude(orbit.PeA), Math.Round(orbit.inclination, 3));
                dialogGUIVerticalLayout.AddChild(new DialogGUILabel(orbitInfo, skin.customStyles[0], true, false));

                dialogGUIToggleButton.AddChild(dialogGUIVerticalLayout);
                dialogGUIToggleButton.OptionInteractableCondition = (() => true);
                list.Add(dialogGUIToggleButton);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
 internal void RemoveMission(QuickLaunchMission quickLaunchMission)
 {
     missions.Remove(quickLaunchMission);
 }