Ejemplo n.º 1
0
        static void Render_Habitat(Panel p, Vessel v, Vessel_Info vi)
        {
            // if habitat feature is disabled, do not show the panel
            if (!Features.Habitat)
            {
                return;
            }

            // if vessel is unmanned, do not show the panel
            if (vi.crew_count == 0)
            {
                return;
            }

            // render panel, add some content based on enabled features
            p.SetSection("HABITAT");
            if (Features.Poisoning)
            {
                p.SetContent("co2 level", Lib.Color(Lib.HumanReadablePerc(vi.poisoning, "F2"), vi.poisoning > Settings.PoisoningThreshold, "yellow"));
            }
            if (!v.isEVA)
            {
                if (Features.Pressure)
                {
                    p.SetContent("pressure", Lib.HumanReadablePressure(vi.pressure * Sim.PressureAtSeaLevel()));
                }
                if (Features.Shielding)
                {
                    p.SetContent("shielding", Lib.HumanReadableShielding(vi.shielding));
                }
                if (Features.LivingSpace)
                {
                    p.SetContent("living space", Habitat.Living_Space_to_String(vi.living_space));
                }
                if (Features.Comfort)
                {
                    p.SetContent("comfort", vi.comforts.Summary(), vi.comforts.Tooltip());
                }
            }
        }