示例#1
0
 public override void Draw(SectionModule section)
 {
     if (ImpactProcessor.ShowDetails)
     {
         this.DrawLine(ImpactProcessor.Latitude.ToAngle(), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(SimulationProcessor.LastStage.isp.ToString("F1") + "s", section.IsHud);
     }
 }
示例#3
0
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(TimeFormatter.ConvertToString(RendezvousProcessor.OrbitalPeriod, "F3"), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(SimulationProcessor.LastStage.deltaV.ToString("N0") + "m/s" + " / " + SimulationProcessor.LastStage.totalDeltaV.ToString("N0") + "m/s", section.IsHud);
     }
 }
示例#5
0
 public override void Draw(SectionModule section)
 {
     if (ImpactProcessor.ShowDetails)
     {
         this.DrawLine(ImpactProcessor.Biome, section.IsHud);
     }
 }
示例#6
0
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToDistance(RendezvousProcessor.SemiMajorAxis, 3), section.IsHud);
     }
 }
示例#7
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToMass(SimulationProcessor.LastStage.mass, SimulationProcessor.LastStage.totalMass), section.IsHud);
     }
 }
示例#8
0
 public override void Draw(SectionModule section)
 {
     if (!Double.IsInfinity(FlightGlobals.currentMainBody.sphereOfInfluence))
     {
         this.DrawLine(FlightGlobals.currentMainBody.sphereOfInfluence.ToDistance(), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToAngle(SimulationProcessor.LastStage.thrustOffsetAngle, 1), section.IsHud);
     }
 }
示例#10
0
 public override void Draw(SectionModule section)
 {
     if (ImpactProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToAngleDMS(ImpactProcessor.Longitude) + (ImpactProcessor.Longitude < 0.0 ? " W" : " E"), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(RendezvousProcessor.AngleToDescendingNode.ToAngle(), section.IsHud);
     }
 }
示例#12
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToAcceleration(SimulationProcessor.LastStage.actualThrust / SimulationProcessor.LastStage.totalMass, SimulationProcessor.LastStage.thrust / SimulationProcessor.LastStage.totalMass), section.IsHud);
     }
 }
示例#13
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         DrawLine(FlightGlobals.ActiveVessel.vesselName);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (AtmosphericProcessor.ShowDetails)
     {
         this.DrawLine(AtmosphericProcessor.TerminalVelocity.ToSpeed(), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(RendezvousProcessor.RelativeInclination.ToAngle(), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
        this.DrawLine(RendezvousProcessor.RelativeRadialVelocity.ToSpeed(), section.IsHud);
     }
 }
示例#17
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToForce(SimulationProcessor.LastStage.actualThrust, SimulationProcessor.LastStage.thrust), section.IsHud);
     }
 }
示例#18
0
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(RendezvousProcessor.Distance.ToDistance(), section.IsHud);
     }
 }
示例#19
0
 public override void Draw(SectionModule section)
 {
     if (ImpactProcessor.ShowDetails)
     {
         this.DrawLine(TimeFormatter.ConvertToString(ImpactProcessor.Time), section.IsHud);
     }
 }
示例#20
0
        public override void Draw(SectionModule section)
        {
            switch (ScienceUtil.GetExperimentSituation(FlightGlobals.ActiveVessel))
            {
                case ExperimentSituations.SrfLanded:
                    this.DrawLine("Landed");
                    break;

                case ExperimentSituations.SrfSplashed:
                    this.DrawLine("Splashed");
                    break;

                case ExperimentSituations.FlyingLow:
                    this.DrawLine("Flying Low");
                    break;

                case ExperimentSituations.FlyingHigh:
                    this.DrawLine("Flying High");
                    break;

                case ExperimentSituations.InSpaceLow:
                    this.DrawLine("In Space Low");
                    break;

                case ExperimentSituations.InSpaceHigh:
                    this.DrawLine("In Space High");
                    break;
            }
        }
示例#21
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(SimulationProcessor.LastStage.totalDeltaV.ToString("N0") + "m/s (" + TimeFormatter.ConvertToString(SimulationProcessor.LastStage.totalTime) + ")", section.IsHud);
     }
 }
示例#22
0
        /// <summary>
        ///     Draws the target selector structure.
        /// </summary>
        public override void Draw(SectionModule section)
        {
            if (FlightGlobals.fetch.VesselTarget == null)
            {
                if (this.vesselType == VesselType.Unknown && !this.typeIsBody)
                {
                    this.DrawSearch();
                    if (this.searchQuery.Length == 0)
                    {
                        this.DrawTypes();
                    }
                    else
                    {
                        this.DrawTargetList();
                    }
                }
                else
                {
                    this.DrawBackToTypes();
                    this.DrawTargetList();
                }
            }
            else
            {
                this.DrawTarget(section);
            }

            if (this.targetObject != FlightGlobals.fetch.VesselTarget)
            {
                this.targetObject = FlightGlobals.fetch.VesselTarget;
                this.ResizeRequested = true;
            }
        }
示例#23
0
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(RendezvousProcessor.InterceptAngle.ToAngle(), section.IsHud);
     }
 }
示例#24
0
 public override void Draw(SectionModule section)
 {
     if (SimulationProcessor.ShowDetails)
     {
         this.DrawLine(Units.ToTorque(SimulationProcessor.LastStage.maxThrustTorque), section.IsHud);
     }
 }
 public override void Draw(SectionModule section)
 {
     if (RendezvousProcessor.ShowDetails)
     {
         this.DrawLine(TimeFormatter.ConvertToString(RendezvousProcessor.TimeToDescendingNode), section.IsHud);
     }
 }
示例#26
0
 public override void Draw(SectionModule section)
 {
     // Used to do this but the bug-fix to horizontalSrfSpeed in KSP 1.0.3 actually made it worse so workaround
     //this.DrawLine(FlightGlobals.ActiveVessel.horizontalSrfSpeed.ToSpeed(), section.IsHud);
     var ves = FlightGlobals.ActiveVessel;
     double horizSpeed = Math.Sqrt(ves.srfSpeed * ves.srfSpeed - ves.verticalSpeed * ves.verticalSpeed);
     this.DrawLine(horizSpeed.ToSpeed(), section.IsHud);
 }
        public override void Draw(SectionModule section)
        {
            if (!SuicideBurnProcessor.ShowDetails)
            {
                return;
            }

            this.DrawLine(SuicideBurnProcessor.Distance.ToDistance(), section.IsHud);
        }
        public override void Draw(SectionModule section)
        {
            if (!ManoeuvreProcessor.ShowDetails)
            {
                return;
            }

            this.DrawLine("Time to Node Burn", TimeFormatter.ConvertToString(ManoeuvreProcessor.UniversalTime - ManoeuvreProcessor.HalfBurnTime - Planetarium.GetUniversalTime()), section.IsHud);
        }
示例#29
0
        public override void Draw(SectionModule section)
        {
            if (!ManoeuvreProcessor.ShowDetails)
            {
                return;
            }

            this.DrawLine("Node DeltaV (Total)", ManoeuvreProcessor.TotalDeltaV.ToSpeed() + " (" + (ManoeuvreProcessor.HasDeltaV ? "S" + ManoeuvreProcessor.FinalStage : "X") + ")", section.IsHud);
        }
示例#30
0
        public override void Draw(SectionModule section)
        {
            if (!ManoeuvreProcessor.ShowDetails)
            {
                return;
            }

            this.DrawLine("Node DeltaV (Radial)", ManoeuvreProcessor.RadialDeltaV.ToSpeed(), section.IsHud);
        }
示例#31
0
        /// <summary>
        ///     Sets up and populates the library with the stock sections on creation.
        /// </summary>
        static SectionLibrary()
        {
            StockSections  = new List <SectionModule>();
            CustomSections = new List <SectionModule>();

            StockSections.Add(new SectionModule {
                Name           = "ORBITAL",
                Abbreviation   = "ORBT",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Orbital")).Where(r => r.IsDefault).ToList()
            });

            StockSections.Add(new SectionModule {
                Name           = "SURFACE",
                Abbreviation   = "SURF",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Surface")).Where(r => r.IsDefault).ToList()
            });

            StockSections.Add(new SectionModule {
                Name           = "VESSEL",
                Abbreviation   = "VESL",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Vessel")).Where(r => r.IsDefault).ToList()
            });

            StockSections.Add(new SectionModule {
                Name           = "RENDEZVOUS",
                Abbreviation   = "RDZV",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Rendezvous")).Where(r => r.IsDefault).ToList()
            });

            TrackingStationSection = new SectionModuleTS {
                Name            = "TRACKING",
                Abbreviation    = "TRCK",
                ReadoutModules  = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Rendezvous")).Where(r => r.IsDefault).ToList(),
                IsVisible       = true,
                showFloatButton = false
            };

            CustomSections.Add(new SectionModule {
                Name           = "THERMAL",
                Abbreviation   = "HEAT",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Thermal")).Where(r => r.IsDefault).ToList(),
                IsCustom       = true
            });

            CustomSections.Add(new SectionModule {
                Name           = "BODY",
                Abbreviation   = "BODY",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Body")).Where(r => r.IsDefault).ToList(),
                IsCustom       = true
            });

            SectionModule hud1 = new SectionModule {
                Name           = "HUD 1",
                Abbreviation   = "HUD 1",
                IsCustom       = true,
                IsVisible      = true,
                ReadoutModules = new List <ReadoutModule>
                {
                    ReadoutLibrary.GetReadout("ApoapsisHeight"),
                    ReadoutLibrary.GetReadout("TimeToApoapsis"),
                    ReadoutLibrary.GetReadout("PeriapsisHeight"),
                    ReadoutLibrary.GetReadout("TimeToPeriapsis")
                },
            };

            hud1.FloatingPositionX = Screen.width * 0.25f - (hud1.ReadoutModules.First().ContentWidth * 0.5f);
            hud1.FloatingPositionY = 0.0f;
            hud1.IsHud             = true;
            CustomSections.Add(hud1);

            SectionModule hud2 = new SectionModule {
                Name           = "HUD 2",
                Abbreviation   = "HUD 2",
                IsCustom       = true,
                IsVisible      = true,
                ReadoutModules = new List <ReadoutModule>
                {
                    ReadoutLibrary.GetReadout("AltitudeTerrain"),
                    ReadoutLibrary.GetReadout("VerticalSpeed"),
                    ReadoutLibrary.GetReadout("HorizontalSpeed"),
                    ReadoutLibrary.GetReadout("Biome"),
                    ReadoutLibrary.GetReadout("MachNumber")
                },
            };

            hud2.FloatingPositionX = Screen.width * 0.75f - (hud2.ReadoutModules.First().ContentWidth * 0.5f);
            hud2.FloatingPositionY = 0.0f;
            hud2.IsHud             = true;
            CustomSections.Add(hud2);
        }
        /// <summary>
        ///     Sets up and populates the library with the stock sections on creation.
        /// </summary>
        static SectionLibrary()
        {
            StockSections  = new List <SectionModule>();
            CustomSections = new List <SectionModule>();

            SectionModule obt = new SectionModule {
                Name           = "ORBITAL",
                Abbreviation   = "ORBT",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Orbital")).Where(r => r.IsDefault).ToList()
            };

            obt.ApplyPreset(Presets.PresetLibrary.GetPreset(obt.Abbreviation));
            StockSections.Add(obt);

            SectionModule srf = new SectionModule {
                Name           = "SURFACE",
                Abbreviation   = "SURF",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Surface")).Where(r => r.IsDefault).ToList()
            };

            srf.ApplyPreset(Presets.PresetLibrary.GetPreset(srf.Abbreviation));
            StockSections.Add(srf);

            SectionModule vsl = new SectionModule {
                Name           = "VESSEL",
                Abbreviation   = "VESL",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Vessel")).Where(r => r.IsDefault).ToList()
            };

            vsl.ApplyPreset(Presets.PresetLibrary.GetPreset(vsl.Abbreviation));
            StockSections.Add(vsl);

            SectionModule rdz = new SectionModule {
                Name           = "RENDEZVOUS",
                Abbreviation   = "RDZV",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Rendezvous")).Where(r => r.IsDefault).ToList()
            };

            rdz.ApplyPreset(Presets.PresetLibrary.GetPreset(rdz.Abbreviation));
            StockSections.Add(rdz);

            SectionModuleTS ts = new SectionModuleTS {
                Name            = "TRACKING",
                Abbreviation    = "TRCK",
                ReadoutModules  = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Rendezvous")).Where(r => r.IsDefault).ToList(),
                IsVisible       = true,
                showFloatButton = false
            };

            ts.ApplyPreset(Presets.PresetLibrary.GetPreset(ts.Abbreviation));
            TrackingStationSection = ts;

            var thr = new SectionModule {
                Name           = "THERMAL",
                Abbreviation   = "HEAT",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Thermal")).Where(r => r.IsDefault).ToList(),
            };

            thr.ApplyPreset(Presets.PresetLibrary.GetPreset(thr.Abbreviation));
            StockSections.Add(thr);

            var body = new SectionModule {
                Name           = "BODY",
                Abbreviation   = "BODY",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Body")).Where(r => r.IsDefault).ToList(),
            };

            body.ApplyPreset(Presets.PresetLibrary.GetPreset(body.Abbreviation));
            StockSections.Add(body);

            var burn = new SectionModule {
                Name           = "MANEUVER",
                Abbreviation   = "BURN",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Orbital")).Where(r => r.Name.StartsWith("Node")).ToList()
            };

            burn.ApplyPreset(Presets.PresetLibrary.GetPreset(burn.Abbreviation));
            StockSections.Add(burn);


            var land = new SectionModule {
                Name           = "LANDING",
                Abbreviation   = "LAND",
                ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Surface")).Where(r => r.Name.StartsWith("Impact")).ToList()
            };

            land.ReadoutModules.AddRange(ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Vessel")).Where(r => r.Name.StartsWith("Suicide")).ToList());
            land.ApplyPreset(Presets.PresetLibrary.GetPreset(land.Abbreviation));
            StockSections.Add(land);


            SectionModule hud1 = new SectionModule {
                Name           = "HUD 1",
                Abbreviation   = "HUD 1",
                IsVisible      = true,
                showButton     = false,
                ReadoutModules = new List <ReadoutModule>
                {
                    ReadoutLibrary.GetReadout("ApoapsisHeight"),
                    ReadoutLibrary.GetReadout("TimeToApoapsis"),
                    ReadoutLibrary.GetReadout("PeriapsisHeight"),
                    ReadoutLibrary.GetReadout("TimeToPeriapsis")
                },
            };

            hud1.FloatingPositionX = Screen.width * 0.33f - (hud1.ReadoutModules.First().ContentWidth * 0.5f);
            hud1.FloatingPositionY = 0.0f;
            hud1.IsHud             = true;

            hud1.ApplyPreset(Presets.PresetLibrary.GetPreset(hud1.Abbreviation));
            StockSections.Add(hud1);

            SectionModule hud2 = new SectionModule {
                Name           = "HUD 2",
                Abbreviation   = "HUD 2",
                IsVisible      = true,
                showButton     = false,
                ReadoutModules = new List <ReadoutModule>
                {
                    ReadoutLibrary.GetReadout("AltitudeTerrain"),
                    ReadoutLibrary.GetReadout("VerticalSpeed"),
                    ReadoutLibrary.GetReadout("HorizontalSpeed"),
                    ReadoutLibrary.GetReadout("Biome"),
                    ReadoutLibrary.GetReadout("MachNumber")
                },
            };

            hud2.FloatingPositionX = Screen.width * 0.7f - (hud2.ReadoutModules.First().ContentWidth * 0.5f);
            hud2.FloatingPositionY = 0.0f;
            hud2.IsHud             = true;

            hud2.ApplyPreset(Presets.PresetLibrary.GetPreset(hud2.Abbreviation));
            StockSections.Add(hud2);
        }