예제 #1
0
        protected void DrawBody()
        {
            string Title = "";
            string Text  = "";

            if (SelectedObject.celestialBody)
            {
                Body Body = _parent.Science.BodyList[SelectedObject.celestialBody];
                Title += "Body: " + GameHelper.LocalizeBodyName(Body.CelestialBody.displayName) + "\n";
                Title += Body.Type;
                if (Body.IsHome)
                {
                    Title += " - Home!";
                }



                Text += "Space high: " + (Body.CelestialBody.scienceValues.spaceAltitudeThreshold / 1000) + "km";
                if (Body.HasAtmosphere)
                {
                    Text += "\nAtmos depth: " + (Body.CelestialBody.atmosphereDepth / 1000) + "km";
                    Text += "\nFlying high: " + (Body.CelestialBody.scienceValues.flyingAltitudeThreshold / 1000) + "km";
                    if (Body.HasOxygen)
                    {
                        Text += "\nHas oxygen - jets work";
                    }
                }
                else
                {
                    Text += "\nNo kind of atmosphere";
                }

                if (Body.HasSurface)
                {
                    if (Body.HasOcean)
                    {
                        Text += "\nHas oceans";
                    }
                }
                else
                {
                    Text += "\nNo surface";
                }
            }

            scrollPosition = GUILayout.BeginScrollView(scrollPosition);
            GUILayout.BeginVertical(GUILayout.ExpandWidth(true));

            GUILayout.Label(Title, sectionStyle, GUILayout.ExpandWidth(true));
            GUILayout.Space(wScale(16));
            GUILayout.Label(Text, labelStyle, GUILayout.ExpandWidth(true));

            GUILayout.EndVertical();
            GUILayout.EndScrollView();

            GUILayout.Space(wScale(8));
        }
예제 #2
0
        private string MakeSituationToolTip( )
        {
            string Text = "";



            if (_filter.CurrentSituation != null)
            {
                Body Body = _filter.CurrentSituation.Body;
                Text += "Body: " + GameHelper.LocalizeBodyName(Body.CelestialBody.displayName) + "\n";
                Text += Body.Type;
                if (Body.IsHome)
                {
                    Text += " - Home!";
                }
                Text += "\n\n";
                Text += "Space high: " + (Body.CelestialBody.scienceValues.spaceAltitudeThreshold / 1000) + "km\n";

                if (Body.HasAtmosphere)
                {
                    Text += "Atmos depth: " + (Body.CelestialBody.atmosphereDepth / 1000) + "km\n";
                    Text += "Flying high: " + (Body.CelestialBody.scienceValues.flyingAltitudeThreshold / 1000) + "km\n";
                    if (Body.HasOxygen)
                    {
                        Text += "Has oxygen - jets work\n";
                    }
                }
                else
                {
                    Text += "No kind of atmosphere\n";
                }

                if (Body.HasSurface)
                {
                    if (Body.HasOcean)
                    {
                        Text += "Has oceans\n";
                    }
                }
                else
                {
                    Text += "No surface\n";
                }

                Text += "\n";
            }

            Text += "Current vessel: " + _parent.Science.CurrentVesselScience.Count( ) + " stored experiments";

            return(Text);
        }
예제 #3
0
        private string MakeSituationToolTip( )
        {
            string Text = "";



            if (_filter.CurrentSituation != null)
            {
                Body Body = _filter.CurrentSituation.Body;
                Text += Localizer.Format("#autoLOC_[x]_Science!_111") /*Body: */ + GameHelper.LocalizeBodyName(Body.CelestialBody.displayName) + "\n";
                Text += Body.Type;
                if (Body.IsHome)
                {
                    Text += Localizer.Format("#autoLOC_[x]_Science!_112") /* - Home!*/;
                }
                Text += "\n\n";
                Text += Localizer.Format("#autoLOC_[x]_Science!_113") /*Space high: */ + (Body.CelestialBody.scienceValues.spaceAltitudeThreshold / 1000) + "km\n";

                if (Body.HasAtmosphere)
                {
                    Text += Localizer.Format("#autoLOC_[x]_Science!_137") /*Atmos depth: */ + (Body.CelestialBody.atmosphereDepth / 1000) + "km\n";
                    Text += Localizer.Format("#autoLOC_[x]_Science!_138") /*Flying high: */ + (Body.CelestialBody.scienceValues.flyingAltitudeThreshold / 1000) + "km\n";
                    if (Body.HasOxygen)
                    {
                        Text += Localizer.Format("#autoLOC_[x]_Science!_139") /*Has oxygen - jets work\n*/;
                    }
                }
                else
                {
                    Text += Localizer.Format("#autoLOC_[x]_Science!_140") /*No kind of atmosphere\n*/;
                }

                if (Body.HasSurface)
                {
                    if (Body.HasOcean)
                    {
                        Text += Localizer.Format("#autoLOC_[x]_Science!_141") /*Has oceans\n*/;
                    }
                }
                else
                {
                    Text += Localizer.Format("#autoLOC_[x]_Science!_142") /*No surface\n*/;
                }

                Text += "\n";
            }

            Text += Localizer.Format("#autoLOC_[x]_Science!_143") /*Current vessel: */ + _parent.Science.CurrentVesselScience.Count( ) + Localizer.Format("#autoLOC_[x]_Science!_144") /* stored experiments*/;

            return(Text);
        }
예제 #4
0
 /// <summary>
 /// Creates a new instance of the Situation class.
 /// </summary>
 /// <param name="body">The CelestialBody around which this situation is for.</param>
 /// <param name="situation">The ExperimentSituations flag which this situation is for.</param>
 /// <param name="biome">Optionally, the biome which this situation is for.</param>
 /// <param name="subBiome">Optionally, the KSC biome which this situation is for.</param>
 public Situation(Body body, ExperimentSituations situation, string biome = null, string subBiome = null)
 {
     _body              = body;
     _situation         = situation;
     _biome             = biome;
     _subBiome          = subBiome;
     _formattedBiome    = BiomeToString(_biome);
     _formattedSubBiome = BiomeToString(_subBiome);
     _description       = string.Format("{0} {1}{2}",
                                        ToString(_situation),
                                        GameHelper.LocalizeBodyName(Body.CelestialBody.displayName),
                                        string.IsNullOrEmpty(_formattedBiome)
                                 ? string.Empty
                                 : string.IsNullOrEmpty(_formattedSubBiome)
                                         ? string.Format("'s {0}", _formattedBiome)
                                         : string.Format("'s {0} ({1})", _formattedSubBiome, _formattedBiome));
 }